tracker-property.h 10.4 KB
Newer Older
1
/*
2
 * Copyright (C) 2009, Nokia <ivan.frade@nokia.com>
3 4
 *
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2.1 of the License, or (at your option) any later version.
8 9 10 11
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
15 16 17 18 19
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 */

20 21
#ifndef __LIBTRACKER_DATA_PROPERTY_H__
#define __LIBTRACKER_DATA_PROPERTY_H__
22 23 24

#include <glib-object.h>

25 26
#include "tracker-class.h"

27 28
G_BEGIN_DECLS

29 30
#if !defined (__LIBTRACKER_DATA_INSIDE__) && !defined (TRACKER_COMPILATION)
#error "only <libtracker-data/tracker-data.h> must be included directly."
31 32
#endif

33 34 35
/*
 * TrackerPropertyType
 */
36 37 38
#define TRACKER_TYPE_PROPERTY_TYPE (tracker_property_type_get_type ())

typedef enum {
39
	TRACKER_PROPERTY_TYPE_UNKNOWN,
40
	TRACKER_PROPERTY_TYPE_STRING,
41
	TRACKER_PROPERTY_TYPE_BOOLEAN,
42 43 44
	TRACKER_PROPERTY_TYPE_INTEGER,
	TRACKER_PROPERTY_TYPE_DOUBLE,
	TRACKER_PROPERTY_TYPE_DATE,
45 46
	TRACKER_PROPERTY_TYPE_DATETIME,
	TRACKER_PROPERTY_TYPE_RESOURCE,
47 48
} TrackerPropertyType;

49
GType        tracker_property_type_get_type  (void) G_GNUC_CONST;
50

51 52 53
/*
 * TrackerProperty
 */
54
#define TRACKER_TYPE_PROPERTY         (tracker_property_get_type ())
55
#define TRACKER_TYPE_PROPERTY_TYPE    (tracker_property_type_get_type ())
56
#define TRACKER_PROPERTY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_PROPERTY, TrackerProperty))
57
#define TRACKER_PROPERTY_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), TRACKER_TYPE_PROPERTY, TrackerPropertyClass))
58
#define TRACKER_IS_PROPERTY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), TRACKER_TYPE_PROPERTY))
59 60 61
#define TRACKER_IS_PROPERTY_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), TRACKER_TYPE_PROPERTY))
#define TRACKER_PROPERTY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TRACKER_TYPE_PROPERTY, TrackerPropertyClass))

62
/* Forward typedef for TrackerProperty in tracker-class.h */
63
typedef struct _TrackerPropertyClass TrackerPropertyClass;
64
typedef struct _TrackerPropertyPrivate TrackerPropertyPrivate;
65 66

struct _TrackerProperty {
67
	GObject parent;
68
	TrackerPropertyPrivate *priv;
69 70 71 72 73 74
};

struct _TrackerPropertyClass {
	GObjectClass parent_class;
};

75
GType               tracker_property_get_type                (void) G_GNUC_CONST;
76
TrackerProperty *   tracker_property_new                     (gboolean              use_gvdb);
77 78 79 80 81 82
const gchar *       tracker_property_get_uri                 (TrackerProperty      *property);
const gchar *       tracker_property_get_name                (TrackerProperty      *property);
const gchar *       tracker_property_get_table_name          (TrackerProperty      *property);
TrackerPropertyType tracker_property_get_data_type           (TrackerProperty      *property);
TrackerClass *      tracker_property_get_domain              (TrackerProperty      *property);
TrackerClass *      tracker_property_get_range               (TrackerProperty      *property);
83
TrackerClass **     tracker_property_get_domain_indexes      (TrackerProperty      *property);
84 85 86 87
gint                tracker_property_get_weight              (TrackerProperty      *property);
gint                tracker_property_get_id                  (TrackerProperty      *property);
gboolean            tracker_property_get_indexed             (TrackerProperty      *property);
TrackerProperty *   tracker_property_get_secondary_index     (TrackerProperty      *property);
88
gboolean            tracker_property_get_orig_fulltext_indexed(TrackerProperty      *property);
89 90
gboolean            tracker_property_get_fulltext_indexed    (TrackerProperty      *property);
gboolean            tracker_property_get_multiple_values     (TrackerProperty      *property);
91
gboolean            tracker_property_get_last_multiple_values(TrackerProperty      *property);
92
gboolean            tracker_property_get_orig_multiple_values(TrackerProperty      *property);
93 94
gboolean            tracker_property_get_transient           (TrackerProperty      *property);
gboolean            tracker_property_get_is_new              (TrackerProperty      *property);
95 96
gboolean            tracker_property_get_is_new_domain_index (TrackerProperty      *property,
                                                              TrackerClass         *class);
97 98 99
gboolean            tracker_property_get_writeback           (TrackerProperty      *property);
const gchar *       tracker_property_get_default_value       (TrackerProperty      *property);
gboolean            tracker_property_get_db_schema_changed   (TrackerProperty      *property);
100
gboolean            tracker_property_get_cardinality_changed (TrackerProperty      *property);
101
gboolean            tracker_property_get_is_inverse_functional_property
102
                                                             (TrackerProperty      *property);
103
gboolean            tracker_property_get_force_journal       (TrackerProperty      *property);
104 105 106 107 108
TrackerProperty **  tracker_property_get_super_properties    (TrackerProperty      *property);
void                tracker_property_set_uri                 (TrackerProperty      *property,
                                                              const gchar          *value);
void                tracker_property_set_domain              (TrackerProperty      *property,
                                                              TrackerClass         *value);
109
void                tracker_property_add_domain_index        (TrackerProperty      *property,
110
                                                              TrackerClass         *value);
111 112 113
void                tracker_property_del_domain_index        (TrackerProperty      *property,
                                                              TrackerClass         *value);
void                tracker_property_reset_domain_indexes    (TrackerProperty      *property);
114 115 116 117 118 119 120 121 122 123
void                tracker_property_set_range               (TrackerProperty      *property,
                                                              TrackerClass         *range);
void                tracker_property_set_weight              (TrackerProperty      *property,
                                                              gint                  value);
void                tracker_property_set_id                  (TrackerProperty      *property,
                                                              gint                  value);
void                tracker_property_set_indexed             (TrackerProperty      *property,
                                                              gboolean              value);
void                tracker_property_set_secondary_index     (TrackerProperty      *property,
                                                              TrackerProperty      *value);
124 125
void                tracker_property_set_orig_fulltext_indexed(TrackerProperty      *property,
                                                               gboolean              value);
126 127 128 129
void                tracker_property_set_fulltext_indexed    (TrackerProperty      *property,
                                                              gboolean              value);
void                tracker_property_set_multiple_values     (TrackerProperty      *property,
                                                              gboolean              value);
130 131
void                tracker_property_set_last_multiple_values(TrackerProperty      *property,
                                                              gboolean              value);
132 133
void                tracker_property_set_orig_multiple_values(TrackerProperty      *property,
                                                              gboolean              value);
134 135 136 137 138
void                tracker_property_set_transient           (TrackerProperty      *property,
                                                              gboolean              value);
void                tracker_property_set_is_new              (TrackerProperty      *property,
                                                              gboolean              value);
void                tracker_property_set_is_new_domain_index (TrackerProperty      *property,
139
                                                              TrackerClass         *class,
140 141 142 143 144 145 146
                                                              gboolean              value);
void                tracker_property_set_writeback           (TrackerProperty      *property,
                                                               gboolean              value);
void                tracker_property_set_default_value       (TrackerProperty      *property,
                                                              const gchar          *value);
void                tracker_property_set_db_schema_changed   (TrackerProperty      *property,
                                                              gboolean              value);
147 148
void                tracker_property_set_cardinality_changed (TrackerProperty      *property,
                                                              gboolean              value);
149
void                tracker_property_set_is_inverse_functional_property
150 151
                                                             (TrackerProperty      *property,
                                                              gboolean              value);
152 153
void                tracker_property_set_force_journal       (TrackerProperty      *property,
                                                              gboolean              value);
154 155
void                tracker_property_add_super_property      (TrackerProperty      *property,
                                                              TrackerProperty      *value);
156 157
void                tracker_property_del_super_property      (TrackerProperty      *property,
                                                              TrackerProperty      *value);
158 159 160
TrackerProperty   **tracker_property_get_last_super_properties
                                                             (TrackerProperty      *property);
void                tracker_property_reset_super_properties  (TrackerProperty      *property);
161 162 163

G_END_DECLS

164
#endif /* __LIBTRACKER_DATA_PROPERTY_H__ */
165