![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
RBSourceSearch; RBSourceSearchClass; gboolean rb_source_search_is_subset (RBSourceSearch *search, const char *current, const char *next); RhythmDBQuery * rb_source_search_create_query (RBSourceSearch *search, RhythmDB *db, const char *search_text); void rb_source_search_action_attach (RBSourceSearch *search, GObject *action); RBSourceSearch * rb_source_search_get_from_action (GObject *action);
These translate the text in the search entry box into a RhythmDBQuery. The basic implementation will return a query like RHYTHMDB_QUERY_PROP_LIKE, RHYTHMDB_PROP_SEARCH_MATCH, text. Simple variants can restrict the search to single properties (artist, album, genre). More complicated searches could implement something like the Xesam User Query spec.
The source header finds the search instance to use by looking for the 'rb-source-search' data item on the active search action.
typedef struct { GObjectClass parent_class; /* virtual functions */ gboolean (*is_subset) (RBSourceSearch *search, const char *current, const char *next); RhythmDBQuery *(*create_query) (RBSourceSearch *search, RhythmDB *db, const char *search_text); } RBSourceSearchClass;
gboolean rb_source_search_is_subset (RBSourceSearch *search, const char *current, const char *next);
Determines whether the new search text will result in a subset of entries matched by the previous search. This is used to optimise the search query.
|
a RBSourceSearch |
|
the current search text (or NULL if the current search was done with a different search implementation and so cannot be considered) |
|
the new search text |
Returns : |
TRUE iff the new search text will match a subset of those matched by the current search. |
RhythmDBQuery * rb_source_search_create_query (RBSourceSearch *search, RhythmDB *db, const char *search_text);
Creates a RhythmDBQuery from the user's search text.
|
a RBSourceSearch |
|
the RhythmDB |
|
the search text |
Returns : |
RhythmDBQuery for the source to use |
void rb_source_search_action_attach (RBSourceSearch *search, GObject *action);
Attaches a RBSourceSearch to a UI action so that the search implementation will be used when the action is active.
|
RBSourceSearch to associate with the action |
|
UI action to associate the search with |
RBSourceSearch * rb_source_search_get_from_action (GObject *action);
Returns the RBSourceSearch associated with the specified UI action.
|
the action to find the RBSourceSearch for |
Returns : |
associated RBSourceSearch |