![]() |
![]() |
![]() |
libjana Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Signals |
JanaStoreView; enum JanaStoreViewField; void jana_store_view_get_range (JanaStoreView *self, JanaTime **start, JanaTime **end); void jana_store_view_set_range (JanaStoreView *self, JanaTime *start, JanaTime *end); JanaStoreViewMatch * jana_store_view_add_match (JanaStoreView *self, JanaStoreViewField field, const gchar *data); GList * jana_store_view_get_matches (JanaStoreView *self); void jana_store_view_remove_match (JanaStoreView *self, JanaStoreViewMatch *match); void jana_store_view_clear_matches (JanaStoreView *self); void jana_store_view_start (JanaStoreView *self); JanaStore * jana_store_view_get_store (JanaStoreView *self);
JanaStoreView is the interface for a query, or 'view' on a JanaStore. A store view has functions to query a particular time range of components.
typedef struct _JanaStoreView JanaStoreView;
The JanaStoreView struct contains only private data.
typedef enum { JANA_STORE_VIEW_SUMMARY, JANA_STORE_VIEW_LOCATION, JANA_STORE_VIEW_DESCRIPTION, JANA_STORE_VIEW_AUTHOR, JANA_STORE_VIEW_RECIPIENT, JANA_STORE_VIEW_BODY, JANA_STORE_VIEW_CATEGORY, JANA_STORE_VIEW_ANYFIELD, } JanaStoreViewField;
Enum values for different types of field to use in the
jana_store_view_set_match()
function. Using field values for incorrect
JanaComponent types can have undefined results.
An event summary | |
An event location | |
An event description | |
A note author | |
A note recipient | |
A note body | |
A component category | |
Match any field |
void jana_store_view_get_range (JanaStoreView *self, JanaTime **start, JanaTime **end);
Retrieves the range over which this JanaStoreView is set to span. A NULL
start or end indicate an unbounded range.
|
A JanaStoreView |
|
Return location for the start of the view range, or NULL
|
|
Return location for the end of the view range, or NULL
|
void jana_store_view_set_range (JanaStoreView *self, JanaTime *start, JanaTime *end);
Sets the range for the JanaStoreView to span. A NULL
parameter indicates
that that end of the range should be unbounded (i.e. extended infinitely
into the past or future). For event stores, this query will match against
events that have occurences within this range; for note stores, this query
will match against notes that were created or modified within this range.
|
A JanaStoreView |
|
The start of the range, or NULL
|
|
The end of the range, or NULL
|
JanaStoreViewMatch * jana_store_view_add_match (JanaStoreView *self, JanaStoreViewField field, const gchar *data);
Adds a matching query to the store view. This allows to search for components
whose fields contain a particular string. The matching is done disregarding
the case of letters in the string. field
must contain a field that matches
the component type being store by the underlying JanaStore, otherwise
unexpected results may occur.
|
A JanaStoreView |
|
The field to match against |
|
The matching string to use |
Returns : |
A JanaStoreViewMatch, representing the matching query. |
GList * jana_store_view_get_matches (JanaStoreView *self);
Retrieves all matching queries that have been added to the store view. See
jana_store_view_add_match()
.
|
A JanaStoreView |
Returns : |
A newly allocated GList, containing all the JanaStoreViewMatch
structures added to the store view. This list must be freed with
g_list_free() .
|
void jana_store_view_remove_match (JanaStoreView *self, JanaStoreViewMatch *match);
Removes a matching query from a store view. match
must have been returned
by jana_store_view_add_match()
.
|
A JanaStoreView |
|
A JanaStoreViewMatch |
void jana_store_view_clear_matches (JanaStoreView *self);
Removes all matching queries from a store view.
|
A JanaStoreView |
void jana_store_view_start (JanaStoreView *self);
Starts the view. No signals will be emitted prior to calling this function.
|
A JanaStoreView |
JanaStore * jana_store_view_get_store (JanaStoreView *self);
Retrieves the JanaStore that this view operates on.
|
A JanaStoreView |
Returns : |
The JanaStore that this view operates on. |
"added"
signalvoid user_function (JanaStoreView *store_view, gpointer components, gpointer user_data) : Run Last
The ::added signal is emitted when new components become visible in the scope of the store view.
|
the store view that received the signal |
|
A list of JanaComponents |
|
user data set when the signal handler was connected. |
"modified"
signalvoid user_function (JanaStoreView *store_view, gpointer components, gpointer user_data) : Run Last
The ::modified signal is emitted when components that were previously in view have been modified in some way.
|
the store view that received the signal |
|
A list of JanaComponents |
|
user data set when the signal handler was connected. |
"progress"
signalvoid user_function (JanaStoreView *store_view, gint percent, gpointer user_data) : Run Last
The ::progress signal is emitted periodically as the
query progresses. When the query is complete, percent
will
be 100.
|
the store view that received the signal |
|
Percentage completion of the current running query |
|
user data set when the signal handler was connected. |
"removed"
signalvoid user_function (JanaStoreView *store_view, gpointer uids, gpointer user_data) : Run Last
The ::removed signal is emitted when components that were previously in view have been removed from the underling JanaStore.
|
the store view that received the signal |
|
A list of uids |
|
user data set when the signal handler was connected. |