![]() |
![]() |
![]() |
Tracker Miner Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <libtracker-miner/tracker-miner.h> #define TRACKER_MINER_ERROR_DOMAIN #define TRACKER_MINER_ERROR TrackerMinerPrivate; TrackerMiner; TrackerMinerClass; GQuark tracker_miner_error_quark (void
); void tracker_miner_start (TrackerMiner *miner
); void tracker_miner_stop (TrackerMiner *miner
); void tracker_miner_ignore_next_update (TrackerMiner *miner
,const GStrv urls
); gboolean tracker_miner_is_started (TrackerMiner *miner
); gint tracker_miner_pause (TrackerMiner *miner
,const gchar *reason
,GError **error
); gboolean tracker_miner_resume (TrackerMiner *miner
,gint cookie
,GError **error
); TrackerSparqlConnection * tracker_miner_get_connection (TrackerMiner *miner
);
"name" gchar* : Read / Write / Construct Only "progress" gdouble : Read / Write / Construct "status" gchar* : Read / Write
"ignore-next-update" : Run Last "paused" : Run Last "progress" : Run Last "resumed" : Run Last "started" : Run Last "stopped" : Run Last
TrackerMiner is an abstract base class to help developing data miners for tracker-store, being an abstract class it doesn't do much by itself, but provides the basic signaling and operation control so the miners implementing this class are properly recognized by Tracker, and can be controlled properly by external means such as TrackerMinerManager.
typedef struct { GObjectClass parent_class; /* signals */ void (* started) (TrackerMiner *miner); void (* stopped) (TrackerMiner *miner); void (* paused) (TrackerMiner *miner); void (* resumed) (TrackerMiner *miner); void (* progress) (TrackerMiner *miner, const gchar *status, gdouble progress); void (* ignore_next_update) (TrackerMiner *miner, const GStrv urls); } TrackerMinerClass;
Virtual methods left to implement.
GObjectClass |
parent object class. |
Called when the miner is told to start collecting data. | |
Called when the miner is told to stop collecting data. | |
Called when the miner is told to pause. | |
Called when the miner is told to resume activity. | |
progress. | |
Called after ignore on next update event happens. |
GQuark tracker_miner_error_quark (void
);
Returns the GQuark used to identify miner errors in GError structures.
Returns : |
the error GQuark |
void tracker_miner_start (TrackerMiner *miner
);
Tells the miner to start processing data.
|
a TrackerMiner |
void tracker_miner_stop (TrackerMiner *miner
);
Tells the miner to stop processing data.
|
a TrackerMiner |
void tracker_miner_ignore_next_update (TrackerMiner *miner
,const GStrv urls
);
Tells the miner to mark urls
are to ignore on next update.
|
a TrackerMiner |
|
the urls to mark as to ignore on next update |
gboolean tracker_miner_is_started (TrackerMiner *miner
);
Returns TRUE if the miner has been started.
|
a TrackerMiner |
Returns : |
TRUE if the miner is already started. |
gint tracker_miner_pause (TrackerMiner *miner
,const gchar *reason
,GError **error
);
Asks miner
to pause. On success the cookie ID is returned,
this is what must be used in tracker_miner_resume()
to resume
operations. On failure error
will be set and -1 will be returned.
|
a TrackerMiner |
|
reason to pause |
|
return location for errors |
Returns : |
The pause cookie ID. |
gboolean tracker_miner_resume (TrackerMiner *miner
,gint cookie
,GError **error
);
Asks the miner to resume processing. The cookie must be something
returned by tracker_miner_pause()
. The miner won't actually resume
operations until all pause requests have been resumed.
|
a TrackerMiner |
|
pause cookie |
|
return location for errors |
Returns : |
TRUE if the cookie was valid. |
TrackerSparqlConnection * tracker_miner_get_connection (TrackerMiner *miner
);
|
|
Returns : |
"progress"
property"progress" gdouble : Read / Write / Construct
Miner progress.
Allowed values: [0,1]
Default value: 0
"status"
property"status" gchar* : Read / Write
Translatable string with status description.
Default value: NULL
"ignore-next-update"
signalvoid user_function (TrackerMiner *miner, GStrv *urls, gpointer user_data) : Run Last
the ::ignore-next-update signal is emitted in the miner
right after it has been asked to mark urls
as to ignore on next update
through tracker_miner_ignore_next_update()
.
|
the TrackerMiner |
|
the urls to mark as ignore on next update |
|
user data set when the signal handler was connected. |
"paused"
signalvoid user_function (TrackerMiner *miner, gpointer user_data) : Run Last
the ::paused signal is emitted whenever
there is any reason to pause, either
internal (through tracker_miner_pause()
) or
external (through DBus, see TrackerMinerManager).
|
the TrackerMiner |
|
user data set when the signal handler was connected. |
"progress"
signalvoid user_function (TrackerMiner *miner, gchar *status, gdouble progress, gpointer user_data) : Run Last
the ::progress signal will be emitted by TrackerMiner implementations
to indicate progress about the data mining process. status
will
contain a translated string with the current miner status and progress
will indicate how much has been processed so far.
|
the TrackerMiner |
|
miner status |
|
a gdouble indicating miner progress, from 0 to 1. |
|
user data set when the signal handler was connected. |
"resumed"
signalvoid user_function (TrackerMiner *miner, gpointer user_data) : Run Last
the ::resumed signal is emitted whenever
all reasons to pause have disappeared, see
tracker_miner_resume()
and TrackerMinerManager.
|
the TrackerMiner |
|
user data set when the signal handler was connected. |
"started"
signalvoid user_function (TrackerMiner *miner, gpointer user_data) : Run Last
the ::started signal is emitted in the miner
right after it has been started through
tracker_miner_start()
.
|
the TrackerMiner |
|
user data set when the signal handler was connected. |
"stopped"
signalvoid user_function (TrackerMiner *miner, gpointer user_data) : Run Last
the ::stopped signal is emitted in the miner
right after it has been stopped through
tracker_miner_stop()
.
|
the TrackerMiner |
|
user data set when the signal handler was connected. |