Handle the EINTR error when doing a waitpid() in wvmagicloopback.
[wvapps.git] / evolution / acldialog.h
blob4bc574677a91c34709748b8c7fd2c793449c830f
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * Author : Peter Colijn <pcolijn@nit.ca>
4 * Hubert Figuiere <hub@nit.ca>
6 * Copyright 2003-2004, Net Integration Technologies, Inc.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 * USA
23 #ifndef __ACL_DIALOG_H
24 #define __ACL_DIALOG_H
26 #include <gtk/gtk.h>
27 #include <gdk/gdk.h>
28 #include "wvstring.h"
29 #include "uniconf.h"
30 #include "wvlog.h"
32 #define DIALOG_WIDTH 390
33 #define DIALOG_HEIGHT 400
34 #define BORDER_WIDTH 12
35 #define PADDING 6
36 #define USERNAME_COL_WIDTH 215
37 #define ACCESS_COL_WIDTH 50
39 enum
41 USERNAME = 0,
42 READ_ACCESS,
43 WRITE_ACCESS,
44 ADMIN_ACCESS,
45 N_COLUMNS
48 void dialog_closed(GtkWidget *widget, gpointer data);
50 gint bool_compare(GtkTreeModel *model,
51 GtkTreeIter *a,
52 GtkTreeIter *b,
53 gpointer userdata);
55 class AclDialog
57 public:
58 AclDialog(const WvStringParm _eit_path,
59 const WvStringParm _folder_name,
60 const UniConf &_state,
61 bool active);
62 ~AclDialog();
64 const UniConf get_state() const { return state; }
65 const WvString get_folder_name() const { return folder_name; }
66 const WvString get_eit_path() const { return eit_path; }
67 GtkWidget *get_dialog() { return dialog; }
68 GtkTreeModel *get_model() { return model; }
69 GtkEntry *get_find_entry() { return find_entry; }
71 void update_model(GtkListStore *store);
73 private:
74 void toggle_permissions(gchar *path_str, int which_acl);
75 void toggle_permissions_for_selection(int which_acl);
77 /* gtk callbacks */
78 static void find_entry_activate_cb(GtkWidget *widget, gpointer data);
79 static void find_clear_clicked_cb(GtkWidget *widget, gpointer data);
80 static void find_clicked_cb(GtkWidget *widget, gpointer data);
81 /* gtk tree view callbacks */
82 static void read_toggled(GtkCellRendererToggle *cell,
83 gchar *path_str,
84 gpointer data);
86 static void write_toggled(GtkCellRendererToggle *cell,
87 gchar *path_str,
88 gpointer data);
90 static void admin_toggled(GtkCellRendererToggle *cell,
91 gchar *path_str,
92 gpointer data);
93 static void selection_read_toggled(GtkWidget *widget, gpointer data);
94 static void selection_write_toggled(GtkWidget *widget, gpointer data);
95 static void selection_admin_toggled(GtkWidget *widget, gpointer data);
97 GtkTreeModel *create_model();
98 void add_columns(GtkTreeView *treeview);
99 GtkWidget *create_dialog(bool active);
101 GtkWidget *dialog;
102 GtkTreeView *permlist;
103 GtkTreeModel *model;
104 GtkEntry *find_entry;
105 GtkWidget *find_button;
107 WvString eit_path;
108 WvString folder_name;
109 const UniConf state;
112 #endif // __ACL_DIALOG_H