pdf::PDFController Class Reference

The document class. More...

#include <pdf_doc_controller.h>

Collaboration diagram for pdf::PDFController:
Collaboration graph
[legend]

Public Member Functions

 PDFController (void)
 ~PDFController (void)
PluginStatus open (const string &path)
bool close ()
 Close and release all allocated resource.
bool is_open ()
 Check whether the document has been opened.
PDFTocget_toc (void)
 Get the TOC.
const stringname () const
 Get the file name.
unsigned int page_count ()
 The pages number.
int get_cur_page_num () const
 Get current page.
bool get_anchor_of_page (const unsigned int page_number, string &anchor)
 Get the anchor by page number.
bool is_anchor_in_current_document (const string &anchor)
 Is the anchor in current document.
unsigned int get_page_number_of_anchor (const string &anchor)
 Get the page number by anchor.
int compare_anchor (const string &first, const string &second)
 Compare the anchor object.
PDFCollectionBaseget_hyperlinks_from_range (const string &start, const string &end)
 Get all of the hyperlinks from a given range.
bool get_text_from_range (const PDFAnchor &start, const PDFAnchor &end, string &result)
 Get the text from a given range.
bool get_prev_page_anchor (string &anchor)
 Anchor iteraotr: retrieve the previous anchor.
bool get_next_page_anchor (string &anchor)
 Anchor iteraotr: retrieve the next anchor.
bool get_page_crop_width (const string &anchor, double &width)
 Get the crop width/height of a page by anchor.
bool get_page_crop_height (const string &anchor, double &height)
bool get_page_content_area (const string &anchor, RenderArea &area)
 Get the content area of a page by anchor.
double get_page_crop_width (const int page_num)
 Get the crop width/height of a page by number.
double get_page_crop_height (const int page_num)
int get_display_width ()
 Get current display size.
int get_display_height ()
PluginRotationDegree get_page_original_rotation (const int page_num)
 Get the original rotation of a page.
PluginRotationDegree get_page_original_rotation (const string &anchor)
PagePtr get_page (const int page_num)
 Get the PDFPage by page number.
bool search_next (const PDFSearchCriteria &criteria, const string &from_anchor, unsigned int search_id)
 Search for the next record.
bool search_all (const PDFSearchCriteria &criteria, unsigned int search_id)
 Search all of the matched words.
bool abort_search (unsigned int search_id)
 Abort a search task.
bool get_bounding_rectangles (const string &start_anchor, const string &end_anchor, PDFRectangles &rects)
 Get the characters rectangle of the range.
PDFRendererget_renderer ()
 Get the renderer.
PDFPrerenderPolicyget_prerender_policy ()
 Get the prerender policy.
PDFDoc * get_pdf_doc ()
bool set_memory_limit (const unsigned int bytes)
 Set/get the memory limitation value to the cache.
unsigned int get_memory_limit ()
void clear_cache ()
 Clear all of the cached pages.

Data Fields

Signal< void, RenderResultPtr,
RenderStatus
sig_page_ready
 Page has been rendered signal.
Signal< void, SearchResult,
PDFRangeCollection *, unsigned
int > 
sig_search_results_ready
 Search results have been generated signal.

Friends

class PDFRenderer
class PDFSearcher
class PDFPage
class PDFLibrary

Detailed Description

The document class.

Definition at line 40 of file pdf_doc_controller.h.


Constructor & Destructor Documentation

pdf::PDFController::PDFController ( void   ) 

Definition at line 79 of file pdf_doc_controller.cpp.

References pdf::PDFLibrary::add_document(), and pdf::PDFLibrary::instance().

00080 : pages_cache()
00081 , pdf_doc(0)
00082 , toc(this)
00083 , renderer()
00084 , current_page_num(1)
00085 , searcher(this)
00086 , file_name()
00087 , prerender_policy(new PDFPrerenderPolicyNormal)
00088 {
00089     PDFLibrary::instance().add_document(this);
00090 }

Here is the call graph for this function:

pdf::PDFController::~PDFController ( void   ) 

Definition at line 92 of file pdf_doc_controller.cpp.

References close(), pdf::PDFLibrary::instance(), and pdf::PDFLibrary::remove_document().

00093 {
00094     PDFLibrary::instance().remove_document(this);
00095 
00096     // close the previous document if it exists
00097     if (pdf_doc)
00098     {
00099         close();
00100     }
00101 
00102     delete prerender_policy;
00103 }

Here is the call graph for this function:


Member Function Documentation

bool pdf::PDFController::abort_search ( unsigned int  search_id  ) 

Abort a search task.

Definition at line 407 of file pdf_doc_controller.cpp.

References pdf::Thread::abort_task(), pdf::PDFLibrary::get_thread(), pdf::PDFLibrary::instance(), and pdf::TASK_SEARCH.

00408 {
00409     return PDFLibrary::instance().get_thread().abort_task(this, TASK_SEARCH
00410         , search_id);
00411 }

Here is the call graph for this function:

void pdf::PDFController::clear_cache (  )  [inline]

Clear all of the cached pages.

Definition at line 155 of file pdf_doc_controller.h.

00155 {return pdf_doc;}

bool pdf::PDFController::close (  ) 

Close and release all allocated resource.

Definition at line 137 of file pdf_doc_controller.cpp.

References pdf::PDFRenderer::destroy(), pdf::PDFLibrary::instance(), and pdf::PDFLibrary::remove_tasks_by_document().

Referenced by open(), and ~PDFController().

00138 {
00139     // remove all of the tasks related to this document
00140     PDFLibrary::instance().remove_tasks_by_document(this);
00141 
00142     renderer.destroy();
00143 
00144     if (pdf_doc != 0)
00145     {
00146         delete pdf_doc;
00147         pdf_doc = 0;
00148     }
00149 
00150     return true;
00151 }

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf::PDFController::compare_anchor ( const string first,
const string second 
)

Compare the anchor object.

Definition at line 190 of file pdf_doc_controller.cpp.

00192 {
00193     PDFAnchor first_param(first);
00194     PDFAnchor second_param(second);
00195     return compare_anchor_param(first_param, second_param);
00196 }

bool pdf::PDFController::get_anchor_of_page ( const unsigned int  page_number,
string anchor 
)

Get the anchor by page number.

Definition at line 168 of file pdf_doc_controller.cpp.

References pdf::PDFAnchor::get_string(), and pdf::PDFAnchor::page_num.

00170 {
00171     PDFAnchor param;
00172     param.page_num = page_number;
00173     //param.file_name = name();
00174 
00175     anchor = param.get_string();
00176     return true;
00177 }

Here is the call graph for this function:

bool pdf::PDFController::get_bounding_rectangles ( const string start_anchor,
const string end_anchor,
PDFRectangles rects 
)

Get the characters rectangle of the range.

Definition at line 569 of file pdf_doc_controller.cpp.

References pdf::PDFPage::get_bounding_rectangles(), get_page(), and get_page_number_of_anchor().

00572 {
00573     int page_num = get_page_number_of_anchor(start_anchor);
00574 
00575     //Get the rendered page
00576     PagePtr page = get_page(page_num);
00577     if (!page)
00578     {
00579         return false;
00580     }
00581 
00582     return page->get_bounding_rectangles(start_anchor, end_anchor, rects);
00583 }

Here is the call graph for this function:

int pdf::PDFController::get_cur_page_num (  )  const [inline]

Get current page.

Definition at line 70 of file pdf_doc_controller.h.

Referenced by pdf::PDFRenderer::post_render_task().

00071 { return file_name; }

Here is the caller graph for this function:

int pdf::PDFController::get_display_height (  )  [inline]

Definition at line 115 of file pdf_doc_controller.h.

00121 { return renderer.get_view_attr().get_display_width(); }

int pdf::PDFController::get_display_width (  )  [inline]

Get current display size.

Definition at line 114 of file pdf_doc_controller.h.

00121 { return renderer.get_view_attr().get_display_width(); }

PDFCollectionBase * pdf::PDFController::get_hyperlinks_from_range ( const string start,
const string end 
)

Get all of the hyperlinks from a given range.

Definition at line 258 of file pdf_doc_controller.cpp.

References pdf::PDFAnchor::is_end_anchor(), and pdf::PDFAnchor::page_num.

00260 {
00261     PDFAnchor start_param(start), end_param(end);
00262 
00263     PDFRangeCollection *results = new PDFRangeCollection;
00264     if (start_param.page_num == end_param.page_num)
00265     {
00266         get_hyperlinks_in_page(start_param.page_num, &start_param, &end_param
00267             , *results);
00268         return results;
00269     }
00270 
00271     get_hyperlinks_in_page(start_param.page_num, &start_param, 0, *results);
00272 
00273     if (end_param.is_end_anchor())
00274     {
00275         return results;
00276     }
00277     
00278     int cur_page_num = start_param.page_num + 1;
00279     while (cur_page_num < end_param.page_num)
00280     {
00281         get_hyperlinks_in_page(cur_page_num, 0, 0, *results);
00282         cur_page_num ++;
00283     }
00284     
00285     get_hyperlinks_in_page(cur_page_num, 0, &end_param, *results);
00286 
00287     return results;
00288 }

Here is the call graph for this function:

unsigned int pdf::PDFController::get_memory_limit (  ) 

Definition at line 595 of file pdf_doc_controller.cpp.

References pdf::PagesCache::size().

00596 {
00597     return pages_cache.size();
00598 }

Here is the call graph for this function:

bool pdf::PDFController::get_next_page_anchor ( string anchor  ) 

Anchor iteraotr: retrieve the next anchor.

Definition at line 368 of file pdf_doc_controller.cpp.

References pdf::PDFAnchor::get_string(), page_count(), and pdf::PDFAnchor::page_num.

00369 {
00370     PDFAnchor current_page(anchor);
00371     int next_page = current_page.page_num + 1;
00372     if (next_page > static_cast<int>(page_count()))
00373     {
00374         return false;
00375     }
00376 
00377     current_page.page_num  = next_page;
00378     //current_page.file_name = name();
00379     anchor = current_page.get_string();
00380     return true;
00381 }

Here is the call graph for this function:

PagePtr pdf::PDFController::get_page ( const int  page_num  ) 

Get the PDFPage by page number.

Definition at line 185 of file pdf_doc_controller.cpp.

References pdf::PagesCache::get_page().

Referenced by pdf::PDFRenderTask::execute(), get_bounding_rectangles(), get_page_content_area(), get_text_from_range(), and pdf::PDFRenderer::post_render_task().

00186 {
00187     return pages_cache.get_page(page_num);
00188 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool pdf::PDFController::get_page_content_area ( const string anchor,
RenderArea area 
)

Get the content area of a page by anchor.

Definition at line 451 of file pdf_doc_controller.cpp.

References ERRORPRINTF, pdf::PDFPage::get_content_area(), get_page(), get_page_number_of_anchor(), and page_count().

00452 {
00453     int page_number = get_page_number_of_anchor(anchor);
00454 
00455     if (page_number <= 0 || page_number > static_cast<int>(page_count()))
00456     {
00457         // invalid page number
00458         ERRORPRINTF("Invalid Page Number when getting content area");
00459         return false;
00460     }
00461 
00462     PagePtr page = get_page(page_number);
00463 
00464     if (page == 0)
00465     {
00466         return false;
00467     }
00468 
00469     return page->get_content_area(&renderer, area);
00470 }

Here is the call graph for this function:

double pdf::PDFController::get_page_crop_height ( const int  page_num  ) 

Definition at line 432 of file pdf_doc_controller.cpp.

References Clockwise_Degrees_270, Clockwise_Degrees_90, pdf::PDFViewAttributes::get_device_dpi_v(), get_page_original_rotation(), pdf::PDFRenderer::get_view_attr(), and rotation.

00433 {
00434     PluginRotationDegree rotation = get_page_original_rotation(page_num);
00435     int height = 0;
00436     double crop_width  = pdf_doc->getPageCropWidth(page_num);
00437     double crop_height = pdf_doc->getPageCropHeight(page_num);
00438 
00439     if (rotation == Clockwise_Degrees_90 ||
00440         rotation == Clockwise_Degrees_270  )
00441     {
00442         height = static_cast<int>(crop_width);
00443     }
00444     else
00445     {
00446         height = static_cast<int>(crop_height);
00447     }
00448     return height * renderer.get_view_attr().get_device_dpi_v() / 72.0f;
00449 }

Here is the call graph for this function:

bool pdf::PDFController::get_page_crop_height ( const string anchor,
double &  height 
)

Definition at line 500 of file pdf_doc_controller.cpp.

References get_page_number_of_anchor(), and page_count().

Referenced by pdf::PDFRenderTask::execute(), and pdf::PDFRenderer::render_cover_page().

00501 {
00502     int page_number = get_page_number_of_anchor(anchor);
00503 
00504     if (page_number > 0 && page_number <= static_cast<int>(page_count()))
00505     {
00506         height = get_page_crop_height(page_number);
00507         return true;
00508     }
00509 
00510     return false;
00511 }

Here is the call graph for this function:

Here is the caller graph for this function:

double pdf::PDFController::get_page_crop_width ( const int  page_num  ) 

Get the crop width/height of a page by number.

Definition at line 413 of file pdf_doc_controller.cpp.

References Clockwise_Degrees_270, Clockwise_Degrees_90, pdf::PDFViewAttributes::get_device_dpi_h(), get_page_original_rotation(), pdf::PDFRenderer::get_view_attr(), and rotation.

00414 {
00415     PluginRotationDegree rotation = get_page_original_rotation(page_num);
00416     int width = 0;
00417     double crop_width  = pdf_doc->getPageCropWidth(page_num);
00418     double crop_height = pdf_doc->getPageCropHeight(page_num);
00419 
00420     if (rotation == Clockwise_Degrees_90 ||
00421         rotation == Clockwise_Degrees_270  )
00422     {
00423         width = static_cast<int>(crop_height);
00424     }
00425     else
00426     {
00427         width = static_cast<int>(crop_width);
00428     }
00429     return width * renderer.get_view_attr().get_device_dpi_h() / 72.0f;
00430 }

Here is the call graph for this function:

bool pdf::PDFController::get_page_crop_width ( const string anchor,
double &  width 
)

Get the crop width/height of a page by anchor.

Definition at line 487 of file pdf_doc_controller.cpp.

References get_page_number_of_anchor(), and page_count().

Referenced by pdf::PDFRenderTask::execute(), and pdf::PDFRenderer::render_cover_page().

00488 {
00489     int page_number = get_page_number_of_anchor(anchor);
00490 
00491     if (page_number > 0 && page_number <= static_cast<int>(page_count()))
00492     {
00493         width = get_page_crop_width(page_number);
00494         return true;
00495     }
00496 
00497     return false;
00498 }

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int pdf::PDFController::get_page_number_of_anchor ( const string anchor  ) 

Get the page number by anchor.

Definition at line 179 of file pdf_doc_controller.cpp.

References pdf::PDFAnchor::page_num.

Referenced by get_bounding_rectangles(), get_page_content_area(), get_page_crop_height(), get_page_crop_width(), and get_page_original_rotation().

00180 {
00181     PDFAnchor param(anchor);
00182     return static_cast<unsigned int>(param.page_num);
00183 }

Here is the caller graph for this function:

PluginRotationDegree pdf::PDFController::get_page_original_rotation ( const string anchor  ) 

Definition at line 535 of file pdf_doc_controller.cpp.

References Clockwise_Degrees_0, get_page_number_of_anchor(), get_page_original_rotation(), and page_count().

00536 {
00537     int page_number = get_page_number_of_anchor(anchor);
00538 
00539     if (page_number <= 0 || page_number > static_cast<int>(page_count()))
00540     {
00541         // invalid page number
00542         return Clockwise_Degrees_0;
00543     }
00544 
00545     return get_page_original_rotation(page_number);
00546 }

Here is the call graph for this function:

PluginRotationDegree pdf::PDFController::get_page_original_rotation ( const int  page_num  ) 

Get the original rotation of a page.

Definition at line 513 of file pdf_doc_controller.cpp.

References Clockwise_Degrees_0, Clockwise_Degrees_180, Clockwise_Degrees_270, Clockwise_Degrees_90, and rotation.

Referenced by get_page_crop_height(), get_page_crop_width(), and get_page_original_rotation().

00514 {
00515     PluginRotationDegree rotation = Clockwise_Degrees_0;
00516 
00517     switch( pdf_doc->getPageRotate(page_num) )
00518     {
00519         case 90:
00520             rotation = Clockwise_Degrees_90;
00521             break;
00522         case 180:
00523             rotation = Clockwise_Degrees_180;
00524             break;
00525         case 270:
00526             rotation = Clockwise_Degrees_270;
00527             break;
00528         default:
00529             ; //ignore
00530     }
00531 
00532     return rotation;
00533 }

Here is the caller graph for this function:

PDFDoc* pdf::PDFController::get_pdf_doc (  )  [inline]
PDFPrerenderPolicy* pdf::PDFController::get_prerender_policy (  )  [inline]

Get the prerender policy.

Definition at line 145 of file pdf_doc_controller.h.

Referenced by pdf::operator<(), and pdf::PDFRenderer::post_render_task().

00149 { return &renderer; }

Here is the caller graph for this function:

bool pdf::PDFController::get_prev_page_anchor ( string anchor  ) 

Anchor iteraotr: retrieve the previous anchor.

Definition at line 353 of file pdf_doc_controller.cpp.

References pdf::PDFAnchor::get_string(), and pdf::PDFAnchor::page_num.

00354 {
00355     PDFAnchor current_page(anchor);
00356     int prev_page = current_page.page_num - 1;
00357     if (prev_page < 1)
00358     {
00359         return false;
00360     }
00361 
00362     current_page.page_num  = prev_page;
00363     //current_page.file_name = name();
00364     anchor = current_page.get_string();
00365     return true;
00366 }

Here is the call graph for this function:

PDFRenderer* pdf::PDFController::get_renderer (  )  [inline]

Get the renderer.

Definition at line 142 of file pdf_doc_controller.h.

Referenced by pdf::PDFRenderTask::execute(), and pdf::PluginDocImpl::get_renderer().

00149 { return &renderer; }

Here is the caller graph for this function:

bool pdf::PDFController::get_text_from_range ( const PDFAnchor start,
const PDFAnchor end,
string result 
)

Get the text from a given range.

Definition at line 290 of file pdf_doc_controller.cpp.

References get_page(), pdf::PDFPage::get_text_by_range(), pdf::PDFAnchor::is_end_anchor(), pdf::PDFAnchor::page_num, pdf::PDFAnchor::set_end_anchor(), and pdf::PDFAnchor::word_num.

00293 {
00294     bool ret = false;
00295     result.clear();
00296 
00297     PagePtr page = 0;
00298     if ( start.page_num == end.page_num || end.is_end_anchor() )
00299     {
00300         page = get_page(start.page_num);
00301         ret = page->get_text_by_range(start, end, result);
00302     }
00303     else
00304     {
00305         // make an end anchor
00306         PDFAnchor end_anchor;
00307         end_anchor.set_end_anchor();
00308         string  text;
00309 
00310         // get text from start page
00311         page = get_page(start.page_num);
00312         ret = page->get_text_by_range(start, end_anchor, text);
00313         if (!ret)
00314         {
00315             return false;
00316         }
00317         result += text;
00318 
00319         // get text from middle pages
00320         for (int idx = (start.page_num + 1); idx < end.page_num; ++idx)
00321         {
00322             // make start anchor of current page
00323             PDFAnchor start_anchor;
00324             start_anchor.page_num = idx;
00325             start_anchor.word_num = 0;
00326 
00327             page = get_page(idx);
00328             ret = page->get_text_by_range(start_anchor, end_anchor, text);
00329             if (!ret)
00330             {
00331                 break;
00332             }
00333 
00334             result += text;
00335         }
00336 
00337         // get text from the last page
00338         PDFAnchor start_anchor;
00339         start_anchor.page_num = end.page_num;
00340         start_anchor.word_num = 0;
00341 
00342         page = get_page(end.page_num);
00343         ret = page->get_text_by_range(start_anchor, end, text);
00344         if (!ret)
00345         {
00346             return false;
00347         }
00348         result += text;
00349     }
00350     return ret;
00351 }

Here is the call graph for this function:

PDFToc * pdf::PDFController::get_toc ( void   ) 

Get the TOC.

Definition at line 153 of file pdf_doc_controller.cpp.

00154 {
00155     return &toc;
00156 }

bool pdf::PDFController::is_anchor_in_current_document ( const string anchor  ) 

Is the anchor in current document.

Definition at line 548 of file pdf_doc_controller.cpp.

References pdf::PDFAnchor::file_name, name(), page_count(), and pdf::PDFAnchor::page_num.

00549 {
00550     PDFAnchor anchor_param(anchor);
00551 
00552     // check the file name
00553     if (!anchor_param.file_name.empty() &&
00554         anchor_param.file_name != name())
00555     {
00556         return false;
00557     }
00558 
00559     // check the page number
00560     if (anchor_param.page_num <= 0 ||
00561         anchor_param.page_num > static_cast<int>(page_count()))
00562     {
00563         return false;
00564     }
00565 
00566     return true;
00567 }

Here is the call graph for this function:

bool pdf::PDFController::is_open (  )  [inline]

Check whether the document has been opened.

Definition at line 58 of file pdf_doc_controller.h.

00058 : PluginStatus, take the password into account

const string& pdf::PDFController::name (  )  const [inline]

Get the file name.

Definition at line 64 of file pdf_doc_controller.h.

Referenced by pdf::PluginDocImpl::get_file_name(), is_anchor_in_current_document(), and open().

00065 { return (pdf_doc && pdf_doc->isOk()); }

Here is the caller graph for this function:

PluginStatus pdf::PDFController::open ( const string path  ) 

Open a pdf document TODO. Return error code : PluginStatus, take the password into account

Definition at line 105 of file pdf_doc_controller.cpp.

References close(), ERRORPRINTF, pdf::PDFRenderer::initialize(), pdf::PDFGlobalParams::make_instance(), name(), PLUGIN_ERROR_OPEN_FILE, and PLUGIN_OK.

00106 {
00107     // close the previous document if it exists
00108     if (pdf_doc)
00109     {
00110         close();
00111     }
00112 
00113     // initialize the pdf global parameters
00114     PDFGlobalParams::make_instance();
00115 
00116     GooString * name = new GooString(path.c_str());
00117 
00118     // create PDFDoc instance
00119     pdf_doc = new PDFDoc(name);
00120 
00121     if (!pdf_doc->isOk())
00122     {
00123         ERRORPRINTF("could not open poppler doc %s", path.c_str());
00124         return PLUGIN_ERROR_OPEN_FILE;
00125     }
00126 
00127     if (!renderer.initialize(this))
00128     {
00129         return PLUGIN_ERROR_OPEN_FILE;
00130     }
00131 
00132     // set the file name
00133     file_name = path;
00134     return PLUGIN_OK;
00135 }

Here is the call graph for this function:

unsigned int pdf::PDFController::page_count (  ) 

The pages number.

Definition at line 158 of file pdf_doc_controller.cpp.

Referenced by pdf::PDFSearcher::begin_search_next(), get_next_page_anchor(), get_page_content_area(), get_page_crop_height(), get_page_crop_width(), get_page_original_rotation(), is_anchor_in_current_document(), pdf::PDFRenderer::post_render_task(), pdf::PDFRenderer::render_cover_page(), pdf::PDFSearcher::seach_all(), and pdf::PDFSearcher::search_next().

00159 {
00160     if (pdf_doc == 0)
00161     {
00162         return 0;
00163     }
00164 
00165     return pdf_doc->getNumPages();
00166 }

Here is the caller graph for this function:

bool pdf::PDFController::search_all ( const PDFSearchCriteria criteria,
unsigned int  search_id 
)

Search all of the matched words.

Definition at line 395 of file pdf_doc_controller.cpp.

References pdf::PDFLibrary::instance(), pdf::PDF_SEARCH_ALL, and pdf::PDFLibrary::thread_add_search_task().

00397 {
00398     string s;
00399     PDFSearchTask *task = new PDFSearchTask(criteria, s
00400         , PDF_SEARCH_ALL, &searcher, search_id);
00401 
00402     PDFLibrary::instance().thread_add_search_task(task);
00403 
00404     return true;
00405 }

Here is the call graph for this function:

bool pdf::PDFController::search_next ( const PDFSearchCriteria criteria,
const string from_anchor,
unsigned int  search_id 
)

Search for the next record.

Definition at line 383 of file pdf_doc_controller.cpp.

References pdf::PDFLibrary::instance(), pdf::PDF_SEARCH_NEXT, and pdf::PDFLibrary::thread_add_search_task().

00386 {
00387     PDFSearchTask *task = new PDFSearchTask(criteria, from_anchor
00388         , PDF_SEARCH_NEXT, &searcher, search_id);
00389 
00390     PDFLibrary::instance().thread_add_search_task(task);
00391 
00392     return true;
00393 }

Here is the call graph for this function:

bool pdf::PDFController::set_memory_limit ( const unsigned int  bytes  ) 

Set/get the memory limitation value to the cache.

Definition at line 585 of file pdf_doc_controller.cpp.

References pdf::PDFLibrary::instance(), LOGPRINTF, pdf::PagesCache::reset(), and pdf::PDFLibrary::thread_cancel_render_tasks().

00586 {
00587     // clear all of the render tasks related to this document
00588     PDFLibrary::instance().thread_cancel_render_tasks(this);
00589 
00590     int size = static_cast<int>(bytes >> 1);
00591     LOGPRINTF("Set memory:%d to document:%s", size, file_name.c_str());
00592     return pages_cache.reset(size);
00593 }

Here is the call graph for this function:


Friends And Related Function Documentation

friend class PDFLibrary [friend]

Definition at line 212 of file pdf_doc_controller.h.

friend class PDFPage [friend]

Definition at line 211 of file pdf_doc_controller.h.

friend class PDFRenderer [friend]

Definition at line 209 of file pdf_doc_controller.h.

friend class PDFSearcher [friend]

Definition at line 210 of file pdf_doc_controller.h.


Field Documentation

Page has been rendered signal.

Definition at line 40 of file pdf_doc_controller.h.

Referenced by pdf::PluginViewImpl::PluginViewImpl(), and pdf::PluginViewImpl::~PluginViewImpl().

Search results have been generated signal.

Definition at line 44 of file pdf_doc_controller.h.

Referenced by pdf::PDFSearcher::notify(), and pdf::PluginDocImpl::PluginDocImpl().


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208