diff options
author | Chris Toshok <toshok@ximian.com> | 2002-06-30 16:18:44 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-06-30 16:18:44 +0800 |
commit | 987eeb288e6773997f38178747532d894d890d85 (patch) | |
tree | fb7cb27ca212e9e0a920ec4f093f66e64e882058 /addressbook/backend/pas/pas-backend-summary.h | |
parent | 6256cb6fe996561bdfdc2e954279eb6ecd3f53d9 (diff) | |
download | gsoc2013-evolution-987eeb288e6773997f38178747532d894d890d85.tar.gz gsoc2013-evolution-987eeb288e6773997f38178747532d894d890d85.tar.zst gsoc2013-evolution-987eeb288e6773997f38178747532d894d890d85.zip |
add pas-backend-summary.[ch].
2002-06-29 Chris Toshok <toshok@ximian.com>
* backend/pas/Makefile.am (libpas_a_SOURCES): add
pas-backend-summary.[ch].
* backend/pas/pas-backend-file.c (string_to_dbt): move this to the
top of the file so it can be used in..
(build_summary): loop over the db, adding cards ot the summary.
(do_summary_query): call pas_backend_summary_search and loop over
the returned id's looking them up in the db.
(pas_backend_file_search): call
pas_backend_summary_is_summary_query, and either call
do_summary_query if it's a query over just the set of attributes
in the summary or use the old, slow method if not.
(pas_backend_file_process_create_card): call
pas_backend_summary_add_card.
(pas_backend_file_process_remove_card): call
pas_backend_summary_remove_card.
(pas_backend_file_process_modify_card): call remove_card/add_card.
(pas_backend_file_load_uri): try to load the summary file, and if
it doesn't exist create it.
(pas_backend_file_destroy): unref the summary.
* backend/pas/pas-backend-summary.[ch]: new files, reading and
writing (and querying) summaries.
svn path=/trunk/; revision=17330
Diffstat (limited to 'addressbook/backend/pas/pas-backend-summary.h')
-rw-r--r-- | addressbook/backend/pas/pas-backend-summary.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/addressbook/backend/pas/pas-backend-summary.h b/addressbook/backend/pas/pas-backend-summary.h new file mode 100644 index 0000000000..8feac77339 --- /dev/null +++ b/addressbook/backend/pas/pas-backend-summary.h @@ -0,0 +1,63 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * pas-backend-summary.h + * Copyright 2000, 2001, Ximian, Inc. + * + * Authors: + * Chris Toshok <toshok@ximian.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __PAS_BACKEND_SUMMARY_H__ +#define __PAS_BACKEND_SUMMARY_H__ + +#include <gtk/gtk.h> + +typedef struct _PASBackendSummaryPrivate PASBackendSummaryPrivate; + +typedef struct { + GtkObject parent_object; + PASBackendSummaryPrivate *priv; +} PASBackendSummary; + +typedef struct { + GtkObjectClass parent_class; +} PASBackendSummaryClass; + +PASBackendSummary* pas_backend_summary_new (const char *db_path, int flush_timeout_millis); +GtkType pas_backend_summary_get_type (void); + +/* returns FALSE if the load fails for any reason (including that the + summary is out of date), TRUE if it succeeds */ +gboolean pas_backend_summary_load (PASBackendSummary *summary); +/* returns FALSE if the save fails, TRUE if it succeeds (or isn't required due to no changes) */ +gboolean pas_backend_summary_save (PASBackendSummary *summary); + +void pas_backend_summary_add_card (PASBackendSummary *summary, const char *vcard); +void pas_backend_summary_remove_card (PASBackendSummary *summary, const char *id); + +void pas_backend_summary_touch (PASBackendSummary *summary); + +gboolean pas_backend_summary_is_summary_query (PASBackendSummary *summary, const char *query); +GPtrArray* pas_backend_summary_search (PASBackendSummary *summary, const char *query); + +#define PAS_BACKEND_SUMMARY_TYPE (pas_backend_summary_get_type ()) +#define PAS_BACKEND_SUMMARY(o) (GTK_CHECK_CAST ((o), PAS_BACKEND_SUMMARY_TYPE, PASBackendSummary)) +#define PAS_BACKEND_SUMMARY_CLASS(k) (GTK_CHECK_CLASS_CAST((k), PAS_BACKEND_TYPE, PASBackendSummaryClass)) +#define PAS_IS_BACKEND_SUMMARY(o) (GTK_CHECK_TYPE ((o), PAS_BACKEND_SUMMARY_TYPE)) +#define PAS_IS_BACKEND_SUMMARY_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), PAS_BACKEND_SUMMARY_TYPE)) + +#endif /* __PAS_BACKEND_SUMMARY_H__ */ |