| telepathy-logger Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
TplLogStoreTplLogStore — LogStore interface can register into TplLogManager as "writable" or "readable" log stores. |
#define TPL_LOG_STORE_GET_INTERFACE (inst)
#define TPL_LOG_STORE_ERROR
enum TplLogStoreError;
TplLogStore;
gboolean (*TplLogMessageFilter) (TplLogEntry *message,
gpointer user_data);
gboolean is_writable (TplLogStore *self);
gboolean is_readable (TplLogStore *self);
const gchar * get_name (TplLogStore *self);
gboolean exists (TplLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom);
gboolean add_message (TplLogStore *self,
TplLogEntry *message,
GError **error);
GList * get_dates (TplLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom);
GList * get_messages_for_date (TplLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom,
const gchar *date);
GList * get_recent_messages (TplLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom);
GList * get_chats (TplLogStore *self,
TpAccount *account);
GList * search_new (TplLogStore *self,
const gchar *text);
GList * search_in_identifier_chats_new (TplLogStore *self,
TpAccount *account,
gchar const *identifier,
const gchar *text);
GList * get_filtered_messages (TplLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom,
guint num_messages,
TplLogMessageFilter filter,
gpointer user_data);
const gchar * tpl_log_store_get_name (TplLogStore *self);
gboolean tpl_log_store_exists (TplLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom);
gboolean tpl_log_store_add_message (TplLogStore *self,
TplLogEntry *message,
GError **error);
GList * tpl_log_store_get_dates (TplLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom);
GList * tpl_log_store_get_messages_for_date (TplLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom,
const gchar *date);
GList * tpl_log_store_get_recent_messages (TplLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom);
GList * tpl_log_store_get_chats (TplLogStore *self,
TpAccount *account);
GList * tpl_log_store_search_in_identifier_chats_new
(TplLogStore *self,
TpAccount *account,
gchar const *identifier,
const gchar *text);
GList * tpl_log_store_search_new (TplLogStore *self,
const gchar *text);
GList * tpl_log_store_get_filtered_messages (TplLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom,
guint num_messages,
TplLogMessageFilter filter,
gpointer user_data);
gboolean tpl_log_store_is_writable (TplLogStore *self);
gboolean tpl_log_store_is_readable (TplLogStore *self);
The TplLogStore defines all the public methods that a TPL Log Store has to implement in order to be used into a TplLogManager.
#define TPL_LOG_STORE_ERROR g_quark_from_static_string ("tpl-log-store-error-quark")
typedef enum
{
/* generic error */
TPL_LOG_STORE_ERROR_FAILED,
TPL_LOG_STORE_ERROR_ADD_MESSAGE,
} TplLogStoreError;
gboolean (*TplLogMessageFilter) (TplLogEntry *message, gpointer user_data);
|
|
|
|
Returns : |
gboolean exists (TplLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom);
|
|
|
|
|
|
|
|
Returns : |
gboolean add_message (TplLogStore *self, TplLogEntry *message, GError **error);
|
|
|
|
|
|
Returns : |
GList * get_dates (TplLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom);
|
|
|
|
|
|
|
|
Returns : |
GList * get_messages_for_date (TplLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom, const gchar *date);
|
|
|
|
|
|
|
|
|
|
Returns : |
GList * get_recent_messages (TplLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom);
|
|
|
|
|
|
|
|
Returns : |
GList * search_in_identifier_chats_new (TplLogStore *self, TpAccount *account, gchar const *identifier, const gchar *text);
|
|
|
|
|
|
|
|
Returns : |
GList * get_filtered_messages (TplLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom, guint num_messages, TplLogMessageFilter filter, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
const gchar * tpl_log_store_get_name (TplLogStore *self);
|
|
Returns : |
gboolean tpl_log_store_exists (TplLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom);
|
|
|
|
|
|
|
|
Returns : |
gboolean tpl_log_store_add_message (TplLogStore *self, TplLogEntry *message, GError **error);
Sends message to the LogStore self, in order to be stored.
GList * tpl_log_store_get_dates (TplLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom);
Retrieves a list of dates, in string form YYYYMMDD, corrisponding to each day
at least a message was sent to or received from chat_id.
chat_id may be the id of a buddy or a chatroom, depending on the value of
chatroom.
|
a TplLogStore |
|
a TpAccount |
|
a non-NULL chat identifier |
|
whather if the request is related to a chatroom or not. |
Returns : |
a GList of (char *), to be freed using something like g_list_foreach (lst, g_free, NULL); g_list_free (lst); |
GList * tpl_log_store_get_messages_for_date (TplLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom, const gchar *date);
Retrieves a list of text messages, with timestamp matching date.
|
a TplLogStore |
|
a TpAccount |
|
a non-NULL chat identifier |
|
whather if the request is related to a chatroom or not. |
|
a date, in YYYYMMDD string form |
Returns : |
a GList of TplLogEntryText, to be freed using something like g_list_foreach (lst, g_object_unref, NULL); g_list_free (lst); |
GList * tpl_log_store_get_recent_messages (TplLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom);
|
|
|
|
|
|
|
|
Returns : |
GList * tpl_log_store_get_chats (TplLogStore *self, TpAccount *account);
Retrieves a list of search hits, corrisponding to each buddy/chatroom id
the user exchanged at least a message with, using account.
|
a TplLogStore |
|
a TpAccount |
Returns : |
a GList of (TplLogSearchHit *), to be freed using something like g_list_foreach (lst, tpl_log_manager_search_free, NULL); g_list_free (lst); |
GList * tpl_log_store_search_in_identifier_chats_new (TplLogStore *self, TpAccount *account, gchar const *identifier, const gchar *text);
Filters all messages related to chat_id, using the boolean function
filter.
It will return at most the last (ie most recent) num_messages messages.
Pass G_MAXUINT if all the message are needed.
|
a TplLogStore |
|
a TpAccount |
|
|
|
|
Returns : |
a GList of TplLogEntryText, to be freed using something like g_list_foreach (lst, g_object_unref, NULL); g_list_free (lst); |
GList * tpl_log_store_search_new (TplLogStore *self, const gchar *text);
Searches all textual log entries (all accounts and all chat_ids) matching
text
|
a TplLogStore |
|
a text to be searched among chat_id messages
|
Returns : |
a GList of (TplLogSearchHit *), to be freed using something like g_list_foreach (lst, tpl_log_manager_search_free, NULL); g_list_free (lst); |
GList * tpl_log_store_get_filtered_messages (TplLogStore *self, TpAccount *account, const gchar *chat_id, gboolean chatroom, guint num_messages, TplLogMessageFilter filter, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
gboolean tpl_log_store_is_writable (TplLogStore *self);
|
|
Returns : |
gboolean tpl_log_store_is_readable (TplLogStore *self);
|
|
Returns : |