00001
00002
00003 #ifndef _LIBGDAMM_RENDERER_H
00004 #define _LIBGDAMM_RENDERER_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <glibmm/interface.h>
00031 #include <libgdamm/parameterlist.h>
00032 #include <libgda/gda-renderer.h>
00033
00034
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GdaRenderer GdaRenderer;
00037 typedef struct _GdaRendererClass GdaRendererClass;
00038 #endif
00039
00040
00041 namespace Gnome
00042 {
00043
00044 namespace Gda
00045 { class Renderer_Class; }
00046
00047 }
00048 namespace Gnome
00049 {
00050
00051 namespace Gda
00052 {
00053
00067 enum RendererOptions
00068 {
00069 RENDERER_EXTRA_PRETTY_SQL = 1 << 0,
00070 RENDERER_PARAMS_AS_DETAILED = 1 << 1,
00071 RENDERER_ERROR_IF_DEFAULT = 1 << 2,
00072 RENDERER_FIELDS_NO_TARGET_ALIAS = 1 << 3,
00073 RENDERER_PARAMS_AS_COLON = 1 << 4,
00074 RENDERER_PARAMS_AS_DOLLAR = 1 << 5
00075 };
00076
00078 inline RendererOptions operator|(RendererOptions lhs, RendererOptions rhs)
00079 { return static_cast<RendererOptions>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00080
00082 inline RendererOptions operator&(RendererOptions lhs, RendererOptions rhs)
00083 { return static_cast<RendererOptions>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00084
00086 inline RendererOptions operator^(RendererOptions lhs, RendererOptions rhs)
00087 { return static_cast<RendererOptions>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00088
00090 inline RendererOptions operator~(RendererOptions flags)
00091 { return static_cast<RendererOptions>(~static_cast<unsigned>(flags)); }
00092
00094 inline RendererOptions& operator|=(RendererOptions& lhs, RendererOptions rhs)
00095 { return (lhs = static_cast<RendererOptions>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00096
00098 inline RendererOptions& operator&=(RendererOptions& lhs, RendererOptions rhs)
00099 { return (lhs = static_cast<RendererOptions>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00100
00102 inline RendererOptions& operator^=(RendererOptions& lhs, RendererOptions rhs)
00103 { return (lhs = static_cast<RendererOptions>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00104
00105 }
00106
00107 }
00108
00109
00110 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00111 namespace Glib
00112 {
00113
00114 template <>
00115 class Value<Gnome::Gda::RendererOptions> : public Glib::Value_Flags<Gnome::Gda::RendererOptions>
00116 {
00117 public:
00118 static GType value_type() G_GNUC_CONST;
00119 };
00120
00121 }
00122 #endif
00123
00124
00125 namespace Gnome
00126 {
00127
00128 namespace Gda
00129 {
00130
00131
00135 class Renderer : public Glib::Interface
00136 {
00137
00138 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00139
00140 public:
00141 typedef Renderer CppObjectType;
00142 typedef Renderer_Class CppClassType;
00143 typedef GdaRenderer BaseObjectType;
00144 typedef GdaRendererIface BaseClassType;
00145
00146 private:
00147 friend class Renderer_Class;
00148 static CppClassType renderer_class_;
00149
00150
00151 Renderer(const Renderer&);
00152 Renderer& operator=(const Renderer&);
00153
00154 protected:
00155 Renderer();
00156 explicit Renderer(GdaRenderer* castitem);
00157
00158 #endif
00159
00160 public:
00161 virtual ~Renderer();
00162
00163 static void add_interface(GType gtype_implementer);
00164
00165 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00166 static GType get_type() G_GNUC_CONST;
00167 static GType get_base_type() G_GNUC_CONST;
00168 #endif
00169
00171 GdaRenderer* gobj() { return reinterpret_cast<GdaRenderer*>(gobject_); }
00172
00174 const GdaRenderer* gobj() const { return reinterpret_cast<GdaRenderer*>(gobject_); }
00175
00176 private:
00177
00178 public:
00179
00180
00181
00182
00183
00188 Glib::ustring render_as_str(const Glib::RefPtr<ParameterList>& context) const;
00189
00196 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00197 bool is_valid(const Glib::RefPtr<ParameterList>& context) const;
00198 #else
00199 bool is_valid(const Glib::RefPtr<ParameterList>& context, std::auto_ptr<Glib::Error>& error) const;
00200 #endif //GLIBMM_EXCEPTIONS_ENABLED
00201
00202
00203 public:
00204
00205 public:
00206
00207 #ifdef GLIBMM_VFUNCS_ENABLED
00208 #endif //GLIBMM_VFUNCS_ENABLED
00209
00210 protected:
00211
00212 #ifdef GLIBMM_VFUNCS_ENABLED
00213 #endif //GLIBMM_VFUNCS_ENABLED
00214
00215
00216 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00217 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00218
00219
00220 };
00221
00222 }
00223 }
00224
00225
00226 namespace Glib
00227 {
00233 Glib::RefPtr<Gnome::Gda::Renderer> wrap(GdaRenderer* object, bool take_copy = false);
00234
00235 }
00236
00237
00238 #endif
00239