plaintext/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-plaintext.
00007  *
00008  * uds-plugin-plaintext 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-plaintext 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 TEXT_PLUGIN_RENDER_RESULT_H_
00028 #define TEXT_PLUGIN_RENDER_RESULT_H_
00029 
00030 #include "plugin_inc.h"
00031 #include "signal_slot.h"
00032 #include "text_base_types.h"
00033 #include "interfaces_utils.h"
00034 
00035 using namespace utils;
00036 
00037 namespace text
00038 {
00039 
00040 class PluginViewImpl;
00041 class PluginRenderSettingsImpl;
00042 
00043 class PluginRenderResultImpl : public IPluginUnknown
00044                              , public IPluginRenderResult
00045                              , public IPluginRenderSettings
00046                              // , public IPluginZoom
00047                              // , public IPluginRotation
00048 {
00049 public:
00050     PluginRenderResultImpl(PluginViewImpl *view,
00051                            const PluginBitmapAttributes&,
00052                            const unsigned long id,
00053                            PluginRenderSettingsImpl * settings);
00054     ~PluginRenderResultImpl(void);
00055 
00056 public:
00057     void set_render_result_range(const Position& start, const Position& end)
00058     {
00059         page_range.start = start;
00060         page_range.end = end;
00061     }
00062     Signal<PluginRenderResultImpl *> release_signal;
00063 
00064 private:
00065     // IPluginUnknown
00066     static PluginStatus query_interface_impl(
00067         IPluginUnknown    *thiz,
00068         const UDSString   *id, 
00069         void              **ptr );
00070 
00071     static int release_impl(
00072         IPluginUnknown  *thiz );
00073 
00074     // IPluginRenderResult 
00075     static PluginStatus get_bitmap_attributes_impl(
00076         IPluginUnknown         *thiz, 
00077         PluginBitmapAttributes *attributes);
00078 
00079     static PluginStatus get_anchor_from_coordinates_impl(
00080         IPluginUnknown *thiz,
00081         const int      x,
00082         const int      y,
00083         UDSString      *anchor );
00084 
00085     static IPluginUnknown* get_bounding_rectangles_from_range_impl(
00086         IPluginUnknown      *thiz,
00087         const PluginRange   *range);
00088 
00089     static PluginStatus get_rendered_range_impl(
00090         IPluginUnknown *thiz,
00091         PluginRange    *range);
00092 
00093     // IPluginZoom
00094     // IPluginRotation
00095 
00096 private:
00097     PluginViewImpl *view_impl;
00098     typedef PluginRenderResultImpl * RenderResultPtr;
00099     static utils::ObjectTable<PluginRenderResultImpl> g_instances_table;
00100 
00101     PluginBitmapAttributes atts;    ///< Reference to the image.
00102     unsigned long ref_id;           ///< The reference id.
00103     Range page_range;               ///< [start_anchor, end_anchor] of the render result.
00104     PluginRenderSettingsImpl *settings;
00105 };
00106 
00107 };  // namespace text
00108 
00109 #endif
00110 
Generated by  doxygen 1.6.2-20100208