#include <pdf_prerender_policy.h>
Public Member Functions | |
PDFPrerenderPolicyNormal () | |
virtual | ~PDFPrerenderPolicyNormal () |
virtual void | generate_requests_list (const int current_page, const int previous_page, const int total, std::vector< size_t > &result) |
virtual int | get_allowed_hyperlinks_number () |
Definition at line 60 of file pdf_prerender_policy.h.
pdf::PDFPrerenderPolicyNormal::PDFPrerenderPolicyNormal | ( | ) |
Definition at line 118 of file pdf_prerender_policy.cpp.
00119 : PDFPrerenderPolicy() 00120 { 00121 }
pdf::PDFPrerenderPolicyNormal::~PDFPrerenderPolicyNormal | ( | ) | [virtual] |
Definition at line 123 of file pdf_prerender_policy.cpp.
void pdf::PDFPrerenderPolicyNormal::generate_requests_list | ( | const int | current_page, | |
const int | previous_page, | |||
const int | total, | |||
std::vector< size_t > & | result | |||
) | [virtual] |
Implements pdf::PDFPrerenderPolicy.
Definition at line 132 of file pdf_prerender_policy.cpp.
References pdf::PDFPrerenderPolicy::requests, and pdf::PDFRenderRequests::update().
00136 { 00137 // clear the requests and put the current page at the front of the vector 00138 result.clear(); 00139 result.push_back(current_page); 00140 00141 // get the step of previous page and current page 00142 int step = current_page - previous_page; 00143 00144 // the current page should always be added 00145 switch (step) 00146 { 00147 case -1: 00148 case 1: 00149 { 00150 // prerender the next pages 00151 next_pages_first(current_page, total, step > 0, result); 00152 } 00153 break; 00154 case -5: 00155 case 5: 00156 { 00157 // prerender the next 5 pages 00158 faraway_pages_first(current_page, total, step > 0, result); 00159 } 00160 case 0: 00161 { 00162 // prerender the nearby pages 00163 nearby_pages_first(current_page, total, result); 00164 } 00165 break; 00166 default: 00167 { 00168 // prerender the nearby pages 00169 nearby_pages_first(current_page, total, result); 00170 } 00171 break; 00172 } 00173 00174 // update the requests queue 00175 requests.update(result); 00176 }
int pdf::PDFPrerenderPolicyNormal::get_allowed_hyperlinks_number | ( | ) | [virtual] |
Implements pdf::PDFPrerenderPolicy.
Definition at line 127 of file pdf_prerender_policy.cpp.
References pdf::ALLOWED_HYPERLINKS_NUMBER.
00128 { 00129 return ALLOWED_HYPERLINKS_NUMBER; 00130 }