pdf/plugin_impl/render_result_impl.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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
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
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
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
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
00116 PagePtr page;
00117
00118
00119 unsigned int page_number;
00120
00121
00122 unsigned int ref_id;
00123
00124
00125 bool discard;
00126
00127 friend class PDFPage;
00128 };
00129
00130 typedef PluginRenderResultImpl * RenderResultPtr;
00131
00132 };
00133
00134 #endif
00135