/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/***************************************************************************
 *            e-kolab-folder-permissions.h
 *
 *  Fri Feb 10 11:23:05 2012
 *  Copyright  2012  Christian Hilberg
 *  <hilberg@kernelconcepts.de>
 *
 ****************************************************************************/

/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */

/*----------------------------------------------------------------------------*/

#ifndef _E_KOLAB_FOLDER_PERMISSIONS_H_
#define _E_KOLAB_FOLDER_PERMISSIONS_H_

/*----------------------------------------------------------------------------*/

#include <glib.h>
#include <gtk/gtk.h>

#include <libekolab/kolab-data-folder-permissions.h>
#include <libekolab/kolab-data-imap-account.h>

#include <libekolabutil/kolab-util-folder.h>

/*----------------------------------------------------------------------------*/

typedef struct _KolabFolderPermUIWidgets KolabFolderPermUIWidgets;
struct _KolabFolderPermUIWidgets {
	GtkWidget *container;
	/* sub-widgets of container */
	GtkWidget *treeview;
	GtkWidget *btn_add;
	GtkWidget *btn_edit;
	GtkWidget *btn_remove;
	/* add/edit dialog */
	GtkWidget *edit_dialog;
	/* sub-widgets of add/edit dialog */
	GtkWidget *edit_entry_box;
	GtkWidget *edit_btn_retrieve;
	GSList *radio_group;
	GtkWidget *radio_btn_perm_none;
	GtkWidget *radio_btn_perm_read;
	GtkWidget *radio_btn_perm_append;
	GtkWidget *radio_btn_perm_write;
	GtkWidget *radio_btn_perm_all;
};

typedef struct _KolabFolderPermUIData KolabFolderPermUIData;
struct _KolabFolderPermUIData {
	KolabFolderPermUIWidgets *widgets;
	KolabDataFolderPermissions *permissions;
};

/*----------------------------------------------------------------------------*/

KolabFolderPermUIData*
e_kolab_folder_permissions_ui_new (void);

void
e_kolab_folder_permissions_ui_free (KolabFolderPermUIData *uidata);

KolabDataFolderPermissions*
e_kolab_folder_permissions_read_data_from_folder (const KolabDataImapAccount *account,
                                                  const gchar *foldername,
                                                  KolabFolderTypeID foldertype,
                                                  GError **err);
gboolean
e_kolab_folder_permissions_write_data_to_folder (const KolabDataImapAccount *account,
                                                 const gchar *foldername,
                                                 KolabFolderTypeID foldertype,
                                                 const KolabDataFolderPermissions *data,
                                                 GError **err);

/*----------------------------------------------------------------------------*/

#endif /* _E_KOLAB_FOLDER_PERMISSIONS_H_ */

/*----------------------------------------------------------------------------*/
