diff options
author | Chris Toshok <toshok@ximian.com> | 2004-03-25 03:58:15 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2004-03-25 03:58:15 +0800 |
commit | 5b496f26137ee1d0920a94e7c19926d6584cd624 (patch) | |
tree | ae50b2b8fcc1334e0f9a3ad9451656304662c41c /addressbook/gui/contact-editor/eab-editor.h | |
parent | 9f004e15d508cd979852f0b31c421ee7bc87eb7b (diff) | |
download | gsoc2013-evolution-5b496f26137ee1d0920a94e7c19926d6584cd624.tar.gz gsoc2013-evolution-5b496f26137ee1d0920a94e7c19926d6584cd624.tar.zst gsoc2013-evolution-5b496f26137ee1d0920a94e7c19926d6584cd624.zip |
superclass for both EContactEditor and EContactListEditor. A start toward
2004-03-24 Chris Toshok <toshok@ximian.com>
* gui/contact-editor/eab-editor.[ch]: superclass for both
EContactEditor and EContactListEditor. A start toward simplifying
the interface to both of them, and a place to abstract code.
* gui/contact-editor/Makefile.am (libecontacteditor_la_SOURCES):
add eab-editor.[ch]
svn path=/trunk/; revision=25172
Diffstat (limited to 'addressbook/gui/contact-editor/eab-editor.h')
-rw-r--r-- | addressbook/gui/contact-editor/eab-editor.h | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/addressbook/gui/contact-editor/eab-editor.h b/addressbook/gui/contact-editor/eab-editor.h new file mode 100644 index 0000000000..e4e90622d2 --- /dev/null +++ b/addressbook/gui/contact-editor/eab-editor.h @@ -0,0 +1,110 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* eab-editor.h + * Copyright (C) 2004 Novell, Inc. + * Author: Chris Toshok <toshok@ximian.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU 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 __EAB_EDITOR_H__ +#define __EAB_EDITOR_H__ + +#include <libgnomeui/gnome-app.h> +#include <libgnomeui/gnome-app-helper.h> +#include <bonobo/bonobo-ui-component.h> +#include <glade/glade.h> + +#include <libebook/e-book-async.h> +#include <libebook/e-contact.h> + +#include <gtk/gtktreeview.h> +#include <gtk/gtkliststore.h> + +G_BEGIN_DECLS + +/* EABEditor - A dialog displaying information about a contact. + * + * The following arguments are available: + * + * name type read/write description + * -------------------------------------------------------------------------------- + * card ECard * RW The card currently being edited + */ + +#define EAB_TYPE_EDITOR (eab_editor_get_type ()) +#define EAB_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EAB_TYPE_EDITOR, EABEditor)) +#define EAB_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EAB_TYPE_EDITOR, EABEditorClass)) +#define EAB_IS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EAB_TYPE_EDITOR)) +#define EAB_IS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EAB_TYPE_EDITOR)) +#define EAB_EDITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EAB_EDITOR_TYPE, EABEditorClass)) + + +typedef struct _EABEditor EABEditor; +typedef struct _EABEditorClass EABEditorClass; + +struct _EABEditor +{ + GObject parent; +}; + +struct _EABEditorClass +{ + GObjectClass parent_class; + + /* virtual functions */ + void (* show) (EABEditor *editor); + void (* close) (EABEditor *editor); + void (* raise) (EABEditor *editor); + void (* save_contact) (EABEditor *editor, gboolean should_close); + gboolean (* is_valid) (EABEditor *editor); + gboolean (* is_changed) (EABEditor *editor); + GtkWindow* (* get_window) (EABEditor *editor); + + /* signals */ + void (* contact_added) (EABEditor *editor, EBookStatus status, EContact *contact); + void (* contact_modified) (EABEditor *editor, EBookStatus status, EContact *contact); + void (* contact_deleted) (EABEditor *editor, EBookStatus status, EContact *contact); + void (* editor_closed) (EABEditor *editor); +}; + +GType eab_editor_get_type (void); + +/* virtual functions */ +void eab_editor_show (EABEditor *editor); +void eab_editor_close (EABEditor *editor); +void eab_editor_raise (EABEditor *editor); +void eab_editor_save_contact (EABEditor *editor, gboolean should_close); +gboolean eab_editor_is_valid (EABEditor *editor); +gboolean eab_editor_is_changed (EABEditor *editor); +GtkWindow* eab_editor_get_window (EABEditor *editor); + +gboolean eab_editor_prompt_to_save_changes (EABEditor *editor, GtkWindow *window); +gboolean eab_editor_confirm_delete (GtkWindow *parent); + +/* these four generate EABEditor signals */ +void eab_editor_contact_added (EABEditor *editor, EBookStatus status, EContact *contact); +void eab_editor_contact_modified (EABEditor *editor, EBookStatus status, EContact *contact); +void eab_editor_contact_deleted (EABEditor *editor, EBookStatus status, EContact *contact); +void eab_editor_closed (EABEditor *editor); + +/* these maintain the global list of editors so we can prompt the user + if there are unsaved changes when they exit. */ +void eab_editor_add (EABEditor *editor); +void eab_editor_remove (EABEditor *editor); +gboolean eab_editor_request_close_all (void); +const GSList* eab_editor_get_all_editors (void); + +G_END_DECLS + +#endif /* __E_CONTACT_EDITOR_H__ */ |