00001
00002
00003 #ifndef _LIBGDAMM_QUERYCONDITION_H
00004 #define _LIBGDAMM_QUERYCONDITION_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/object.h>
00031
00032 #include <libgdamm/xmlstorage.h>
00033 #include <libgdamm/referer.h>
00034 #include <libgdamm/renderer.h>
00035 #include <libgdamm/queryobject.h>
00036
00037
00038 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00039 typedef struct _GdaQueryCondition GdaQueryCondition;
00040 typedef struct _GdaQueryConditionClass GdaQueryConditionClass;
00041 #endif
00042
00043
00044 namespace Gnome
00045 {
00046
00047 namespace Gda
00048 { class QueryCondition_Class; }
00049
00050 }
00051 namespace Gnome
00052 {
00053
00054 namespace Gda
00055 {
00056
00057 class Query;
00058 class QueryField;
00059 class QueryTarget;
00060
00066 enum QueryConditionType
00067 {
00068 QUERY_CONDITION_NODE_AND,
00069 QUERY_CONDITION_NODE_OR,
00070 QUERY_CONDITION_NODE_NOT,
00071 QUERY_CONDITION_LEAF_EQUAL,
00072 QUERY_CONDITION_LEAF_DIFF,
00073 QUERY_CONDITION_LEAF_SUP,
00074 QUERY_CONDITION_LEAF_SUPEQUAL,
00075 QUERY_CONDITION_LEAF_INF,
00076 QUERY_CONDITION_LEAF_INFEQUAL,
00077 QUERY_CONDITION_LEAF_LIKE,
00078 QUERY_CONDITION_LEAF_SIMILAR,
00079 QUERY_CONDITION_LEAF_REGEX,
00080 QUERY_CONDITION_LEAF_REGEX_NOCASE,
00081 QUERY_CONDITION_LEAF_NOT_REGEX,
00082 QUERY_CONDITION_LEAF_NOT_REGEX_NOCASE,
00083 QUERY_CONDITION_LEAF_IN,
00084 QUERY_CONDITION_LEAF_BETWEEN,
00085 QUERY_CONDITION_TYPE_UNKNOWN
00086 };
00087
00088 }
00089
00090 }
00091
00092
00093 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00094 namespace Glib
00095 {
00096
00097 template <>
00098 class Value<Gnome::Gda::QueryConditionType> : public Glib::Value_Enum<Gnome::Gda::QueryConditionType>
00099 {
00100 public:
00101 static GType value_type() G_GNUC_CONST;
00102 };
00103
00104 }
00105 #endif
00106
00107
00108 namespace Gnome
00109 {
00110
00111 namespace Gda
00112 {
00113
00117 enum QueryConditionOperator
00118 {
00119 QUERY_CONDITION_OP_LEFT,
00120 QUERY_CONDITION_OP_RIGHT,
00121 QUERY_CONDITION_OP_RIGHT2
00122 };
00123
00124 }
00125
00126 }
00127
00128
00129 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00130 namespace Glib
00131 {
00132
00133 template <>
00134 class Value<Gnome::Gda::QueryConditionOperator> : public Glib::Value_Enum<Gnome::Gda::QueryConditionOperator>
00135 {
00136 public:
00137 static GType value_type() G_GNUC_CONST;
00138 };
00139
00140 }
00141 #endif
00142
00143
00144 namespace Gnome
00145 {
00146
00147 namespace Gda
00148 {
00149
00150
00156 class QueryCondition
00157 : public QueryObject,
00158 public XmlStorage,
00159 public Referer,
00160 public Renderer
00161 {
00162
00163 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00164
00165 public:
00166 typedef QueryCondition CppObjectType;
00167 typedef QueryCondition_Class CppClassType;
00168 typedef GdaQueryCondition BaseObjectType;
00169 typedef GdaQueryConditionClass BaseClassType;
00170
00171 private: friend class QueryCondition_Class;
00172 static CppClassType querycondition_class_;
00173
00174 private:
00175
00176 QueryCondition(const QueryCondition&);
00177 QueryCondition& operator=(const QueryCondition&);
00178
00179 protected:
00180 explicit QueryCondition(const Glib::ConstructParams& construct_params);
00181 explicit QueryCondition(GdaQueryCondition* castitem);
00182
00183 #endif
00184
00185 public:
00186 virtual ~QueryCondition();
00187
00188 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00189 static GType get_type() G_GNUC_CONST;
00190 static GType get_base_type() G_GNUC_CONST;
00191 #endif
00192
00194 GdaQueryCondition* gobj() { return reinterpret_cast<GdaQueryCondition*>(gobject_); }
00195
00197 const GdaQueryCondition* gobj() const { return reinterpret_cast<GdaQueryCondition*>(gobject_); }
00198
00200 GdaQueryCondition* gobj_copy();
00201
00202 private:
00203
00204
00205 protected:
00206 QueryCondition(const Glib::RefPtr<Query>& query, QueryConditionType type);
00207
00208
00209
00210
00211
00212
00213 public:
00214
00215 static Glib::RefPtr<QueryCondition> create(const Glib::RefPtr<Query>& query, QueryConditionType type);
00216
00217
00222 void set_cond_type(QueryConditionType type);
00223
00227 QueryConditionType get_cond_type() const;
00228
00229
00230
00231
00232
00236 Glib::SListHandle<Glib::RefPtr<QueryCondition> > get_children();
00237
00241 Glib::SListHandle<Glib::RefPtr<const QueryCondition> > get_children() const;
00242
00243
00247 Glib::RefPtr<QueryCondition> get_parent();
00248
00252 Glib::RefPtr<const QueryCondition> get_parent() const;
00253
00258 Glib::RefPtr<QueryCondition> get_child_by_xml_id(const Glib::ustring& xml_id);
00259
00264 Glib::RefPtr<const QueryCondition> get_child_by_xml_id(const Glib::ustring& xml_id) const;
00265
00266
00271 bool is_ancestor(const Glib::RefPtr<QueryCondition>& ancestor) const;
00272
00276 bool is_leaf() const;
00277
00283 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00284 bool node_add_child(const Glib::RefPtr<QueryCondition>& child);
00285 #else
00286 bool node_add_child(const Glib::RefPtr<QueryCondition>& child, std::auto_ptr<Glib::Error>& error);
00287 #endif //GLIBMM_EXCEPTIONS_ENABLED
00288
00289
00293 void node_del_child(const Glib::RefPtr<QueryCondition>& child);
00294
00295 void leaf_set_operator(QueryConditionOperator op, const Glib::RefPtr<QueryField>& field);
00296
00301 Glib::RefPtr<QueryField> leaf_get_operator(QueryConditionOperator op);
00302
00307 Glib::RefPtr<const QueryField> leaf_get_operator(QueryConditionOperator op) const;
00308
00309
00310
00311
00325 Glib::SListHandle<Glib::RefPtr<QueryCondition> > get_main_conditions();
00326
00340 Glib::SListHandle<Glib::RefPtr<const QueryCondition> > get_main_conditions() const;
00341
00342
00343
00344 #ifdef GLIBMM_PROPERTIES_ENABLED
00345
00351 Glib::PropertyProxy<QueryConditionType> property_cond_type() ;
00352 #endif //#GLIBMM_PROPERTIES_ENABLED
00353
00354 #ifdef GLIBMM_PROPERTIES_ENABLED
00355
00361 Glib::PropertyProxy_ReadOnly<QueryConditionType> property_cond_type() const;
00362 #endif //#GLIBMM_PROPERTIES_ENABLED
00363
00364
00365 #ifdef GLIBMM_PROPERTIES_ENABLED
00366
00372 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Query> > property_query() const;
00373 #endif //#GLIBMM_PROPERTIES_ENABLED
00374
00375
00376 public:
00377
00378 public:
00379
00380 #ifdef GLIBMM_VFUNCS_ENABLED
00381 #endif //GLIBMM_VFUNCS_ENABLED
00382
00383 protected:
00384
00385 #ifdef GLIBMM_VFUNCS_ENABLED
00386 #endif //GLIBMM_VFUNCS_ENABLED
00387
00388
00389 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00390 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00391
00392
00393 };
00394
00395 }
00396 }
00397
00398
00399 namespace Glib
00400 {
00406 Glib::RefPtr<Gnome::Gda::QueryCondition> wrap(GdaQueryCondition* object, bool take_copy = false);
00407 }
00408
00409
00410 #endif
00411