summaryrefslogtreecommitdiff
path: root/src/libtracker-data/tracker-property.h
blob: c2a75d90ab7db02e0a8937454f43815babf67f90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/*
 * Copyright (C) 2009, Nokia <ivan.frade@nokia.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 */

#ifndef __LIBTRACKER_DATA_PROPERTY_H__
#define __LIBTRACKER_DATA_PROPERTY_H__

#include <glib-object.h>

#include "tracker-class.h"

G_BEGIN_DECLS

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

/*
 * TrackerPropertyType
 */
#define TRACKER_TYPE_PROPERTY_TYPE (tracker_property_type_get_type ())

typedef enum {
	TRACKER_PROPERTY_TYPE_UNKNOWN,
	TRACKER_PROPERTY_TYPE_STRING,
	TRACKER_PROPERTY_TYPE_BOOLEAN,
	TRACKER_PROPERTY_TYPE_INTEGER,
	TRACKER_PROPERTY_TYPE_DOUBLE,
	TRACKER_PROPERTY_TYPE_DATE,
	TRACKER_PROPERTY_TYPE_DATETIME,
	TRACKER_PROPERTY_TYPE_RESOURCE,
} TrackerPropertyType;

GType        tracker_property_type_get_type  (void) G_GNUC_CONST;

/*
 * TrackerProperty
 */
#define TRACKER_TYPE_PROPERTY         (tracker_property_get_type ())
#define TRACKER_TYPE_PROPERTY_TYPE    (tracker_property_type_get_type ())
#define TRACKER_PROPERTY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_PROPERTY, TrackerProperty))
#define TRACKER_PROPERTY_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), TRACKER_TYPE_PROPERTY, TrackerPropertyClass))
#define TRACKER_IS_PROPERTY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), TRACKER_TYPE_PROPERTY))
#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))

/* Forward typedef for TrackerProperty in tracker-class.h */
typedef struct _TrackerPropertyClass TrackerPropertyClass;
typedef struct _TrackerPropertyPrivate TrackerPropertyPrivate;

struct _TrackerProperty {
	GObject parent;
	TrackerPropertyPrivate *priv;
};

struct _TrackerPropertyClass {
	GObjectClass parent_class;
};

GType               tracker_property_get_type                (void) G_GNUC_CONST;
TrackerProperty *   tracker_property_new                     (gboolean              use_gvdb);
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);
TrackerClass **     tracker_property_get_domain_indexes      (TrackerProperty      *property);
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);
gboolean            tracker_property_get_fulltext_indexed    (TrackerProperty      *property);
gboolean            tracker_property_get_multiple_values     (TrackerProperty      *property);
gboolean            tracker_property_get_last_multiple_values(TrackerProperty      *property);
gboolean            tracker_property_get_transient           (TrackerProperty      *property);
gboolean            tracker_property_get_is_new              (TrackerProperty      *property);
gboolean            tracker_property_get_is_new_domain_index (TrackerProperty      *property,
                                                              TrackerClass         *class);
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);
gboolean            tracker_property_get_is_inverse_functional_property
                                                             (TrackerProperty      *property);
gboolean            tracker_property_get_force_journal       (TrackerProperty      *property);
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);
void                tracker_property_add_domain_index        (TrackerProperty      *property,
                                                              TrackerClass         *value);
void                tracker_property_del_domain_index        (TrackerProperty      *property,
                                                              TrackerClass         *value);
void                tracker_property_reset_domain_indexes    (TrackerProperty      *property);
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);
void                tracker_property_set_fulltext_indexed    (TrackerProperty      *property,
                                                              gboolean              value);
void                tracker_property_set_multiple_values     (TrackerProperty      *property,
                                                              gboolean              value);
void                tracker_property_set_last_multiple_values(TrackerProperty      *property,
                                                              gboolean              value);
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,
                                                              TrackerClass         *class,
                                                              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);
void                tracker_property_set_is_inverse_functional_property
                                                             (TrackerProperty      *property,
                                                              gboolean              value);
void                tracker_property_set_force_journal       (TrackerProperty      *property,
                                                              gboolean              value);
void                tracker_property_add_super_property      (TrackerProperty      *property,
                                                              TrackerProperty      *value);
void                tracker_property_del_super_property      (TrackerProperty      *property,
                                                              TrackerProperty      *value);
TrackerProperty   **tracker_property_get_last_super_properties
                                                             (TrackerProperty      *property);
void                tracker_property_reset_super_properties  (TrackerProperty      *property);

G_END_DECLS

#endif /* __LIBTRACKER_DATA_PROPERTY_H__ */