pdf/plugin_impl/render_result_impl.h

Go to the documentation of this file.
00001 /*
00002  * File Name: render_result_impl.h
00003  */
00004 
00005 /*
00006  * This file is part of uds-plugin-pdf.
00007  *
00008  * uds-plugin-pdf is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * uds-plugin-pdf is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00022 /**
00023  * Copyright (C) 2008 iRex Technologies B.V.
00024  * All rights reserved.
00025  */
00026 
00027 #ifndef PDF_PLUGIN_RENDER_RESULT_IMPL_H_
00028 #define PDF_PLUGIN_RENDER_RESULT_IMPL_H_
00029 
00030 #include "plugin_inc.h"
00031 #include "interfaces_utils.h"
00032 #include "signal_slot.h"
00033 #include "pdf_page.h"
00034 
00035 using namespace utils;
00036 
00037 namespace pdf
00038 {
00039 
00040 class PluginRenderSettingsImpl;
00041 
00042 class PluginRenderResultImpl : public IPluginUnknown
00043                              , public IPluginRenderResult
00044                              , public IPluginRenderSettings
00045                              , public IPluginZoom
00046                              , public IPluginRotation
00047 {
00048 public:
00049     PluginRenderResultImpl(const unsigned int page_num, const unsigned int id);
00050     ~PluginRenderResultImpl(void);
00051 
00052 public:
00053     utils::Signal<PluginRenderResultImpl *> release_signal;
00054 
00055 public:
00056     void set_page(PagePtr ptr);
00057     PagePtr get_page() {return page;}
00058 
00059     void set_discard(bool s) {discard = s;}
00060     bool is_discard() {return discard;}
00061 
00062     void set_page_number(const unsigned int n) {page_number = n;}
00063     unsigned int get_page_number() {return page_number;}
00064     void set_ref_id(const unsigned int r) {ref_id = r;}
00065     unsigned int get_ref_id() {return ref_id;}
00066 
00067 private:
00068     // IPluginUnknown
00069     static PluginStatus query_interface_impl(
00070         IPluginUnknown    *thiz,
00071         const UDSString   *id, 
00072         void              **ptr );
00073 
00074     static int release_impl(
00075         IPluginUnknown  *thiz );
00076 
00077     // IPluginRenderResult 
00078     static PluginStatus get_bitmap_attributes_impl(
00079         IPluginUnknown         *thiz, 
00080         PluginBitmapAttributes *attributes);
00081 
00082     static PluginStatus get_anchor_from_coordinates_impl(
00083         IPluginUnknown *thiz,
00084         const int      x,
00085         const int      y,
00086         UDSString      *anchor );
00087 
00088     static IPluginUnknown* get_bounding_rectangles_from_range_impl(
00089         IPluginUnknown      *thiz,
00090         const PluginRange   *range);
00091 
00092     static PluginStatus get_rendered_range_impl(
00093         IPluginUnknown  *thiz,
00094         PluginRange     *range);
00095 
00096     // IPluginZoom
00097     static PluginStatus set_zoom_factor_impl(
00098         IPluginUnknown* thiz,
00099         const float zoom_factor );
00100 
00101     static float get_zoom_factor_impl(
00102         IPluginUnknown* thiz );
00103 
00104     // IPluginRotation
00105     static PluginStatus set_rotation_impl(
00106         IPluginUnknown               *thiz,
00107         const PluginRotationDegree   rotation );
00108     
00109     static PluginRotationDegree get_rotation_impl(
00110         IPluginUnknown  *thiz );
00111 
00112 private:
00113     static utils::ObjectTable<PluginRenderResultImpl> g_instances_table;
00114 
00115     // reference to a PDFPage, it can be null
00116     PagePtr page;
00117 
00118     // page number
00119     unsigned int page_number;
00120 
00121     // reference id
00122     unsigned int ref_id;
00123 
00124     // flag indicating whether the render result is discarded or not
00125     bool discard;
00126 
00127     friend class PDFPage;
00128 };
00129 
00130 typedef PluginRenderResultImpl * RenderResultPtr;
00131 
00132 };  // namespace pdf
00133 
00134 #endif
00135 
Generated by  doxygen 1.6.2-20100208