/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

/* e-name-selector-dialog.c - Dialog that lets user pick EDestinations.
 *
 * Copyright (C) 2004 Novell, Inc.
 *
 * 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.
 *
 * Authors: Hans Petter Jansson <hpj@novell.com>
 */

#ifndef E_NAME_SELECTOR_DIALOG_H
#define E_NAME_SELECTOR_DIALOG_H

#include <gtk/gtkbox.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkentry.h>
#include <gtk/gtklabel.h>
#include <gtk/gtktreeview.h>
#include <gtk/gtktreemodelsort.h>
#include <gtk/gtksizegroup.h>
#include <glade/glade.h>
#include <libebook/e-book.h>
#include <libedataserverui/e-contact-store.h>
#include <libedataserverui/e-name-selector-model.h>

G_BEGIN_DECLS

#define E_TYPE_NAME_SELECTOR_DIALOG            (e_name_selector_dialog_get_type ())
#define E_NAME_SELECTOR_DIALOG(obj)            (GTK_CHECK_CAST ((obj), e_name_selector_dialog_get_type (), ENameSelectorDialog))
#define E_NAME_SELECTOR_DIALOG_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), e_name_selector_dialog_get_type (), ENameSelectorDialogClass))
#define E_IS_NAME_SELECTOR_DIALOG(obj)         (GTK_CHECK_TYPE (obj, e_name_selector_dialog_get_type ()))
#define E_IS_NAME_SELECTOR_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), e_name_selector_dialog_get_type ()))
#define E_NAME_SELECTOR_DIALOG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), E_NAME_SELECTOR_DIALOG_TYPE, ENameSelectorDialogClass))

typedef struct ENameSelectorDialog      ENameSelectorDialog;
typedef struct ENameSelectorDialogClass ENameSelectorDialogClass;

struct ENameSelectorDialogClass {
	GtkDialogClass parent_class;
};

struct ENameSelectorDialog {
	GtkDialog           parent;

	/* Private */

	EBook              *pending_book;
	ESourceList        *source_list;
	ENameSelectorModel *name_selector_model;
	GtkTreeModelSort   *contact_sort;

	GladeXML           *gui;
	GtkTreeView        *contact_view;
	GtkLabel           *status_label;
	GtkBox             *destination_box;
	GtkEntry           *search_entry;
	GtkSizeGroup       *button_size_group;

	GArray             *sections;
};

GType                e_name_selector_dialog_get_type   (void);
ENameSelectorDialog *e_name_selector_dialog_new        (void);

ENameSelectorModel  *e_name_selector_dialog_peek_model (ENameSelectorDialog *name_selector_dialog);
void                 e_name_selector_dialog_set_model  (ENameSelectorDialog *name_selector_dialog,
							ENameSelectorModel  *model);

G_END_DECLS

#endif /* E_NAME_SELECTOR_DIALOG_H */
