00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00030 #ifndef _PROFILE_GROUP_H_
00031 #define _PROFILE_GROUP_H_
00032
00033 #include <gtk/gtk.h>
00034 #include <gdk/gdkkeysyms.h>
00035 #include <glib.h>
00036 #include "gtkProfileEntry.h"
00037
00038 #define PROFILE_GROUP_WIDTH 666
00039 #define PROFILE_GROUP_HEIGHT 547
00040
00041 #define PROFILE_GROUP_SPACING 27
00042
00043 #define PROFILE_GROUP_PADDING_TOP 10
00044 #define PROFILE_GROUP_PADDING_BOTTOM 10
00045 #define PROFILE_GROUP_PADDING_LEFT 13
00046 #define PROFILE_GROUP_PADDING_RIGHT 13
00047
00048 #define PROFILE_GROUP_DIALUP_LABEL_WIDTH 666
00049 #define PROFILE_GROUP_DIALUP_LABEL_HEIGHT 27
00050
00051 #define PROFILE_GROUP_DIALUP_SPACING 12
00052 #define PROFILE_GROUP_DIALUP_SIGIMG_WIDTH 37
00053 #define PROFILE_GROUP_DIALUP_SIGIMG_HEIGHT 27
00054
00055 #define PROFILE_GROUP_INFO_WIDTH 640
00056 #define PROFILE_GROUP_INFO_HEIGHT 27
00057
00058 #define PROFILE_GROUP_ENTRY_SPACING 12
00059
00060 #define GTK_PROFILE_GROUP_TYPE (gtk_profile_group_get_type ())
00061 #define GTK_PROFILE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
00062 GTK_PROFILE_GROUP_TYPE, GtkProfileGroup))
00063 #define GTK_PROFILE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
00064 GTK_PROFILE_GROUP_TYPE, \
00065 GtkProfileGroupClass))
00066 #define IS_GTK_PROFILE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
00067 GTK_PROFILE_GROUP_TYPE))
00068 #define IS_GTK_PROFILE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
00069 GTK_PROFILE_GROUP_TYPE))
00070
00071 typedef enum
00072 {
00073 editMode_e = 0,
00074 connectMode_e,
00075 deleteMode_e,
00076 modeUndef_e
00077 }profileGroupMode_t;
00078
00079 typedef struct _GtkProfileGroup GtkProfileGroup;
00080 typedef struct _GtkProfileGroupClass GtkProfileGroupClass;
00081
00082 typedef void on_profile_group_selection_update_t(GtkProfileGroup* profileGroup,
00083 guint profileIndex);
00084 typedef gboolean on_profile_group_button_press_t(GtkProfileGroup* profileGroup,
00085 guint profileIndex,
00086 gboolean active);
00087
00088 struct _GtkProfileGroup
00089 {
00090 GtkEventBox eventbox;
00091 GtkWidget* item;
00092 GtkWidget* background;
00093 GtkWidget* dialup;
00094
00095 GtkWidget* dialupLabel;
00096 GtkWidget* dialupSigHbox;
00097 GtkWidget* dialupSigImage[5];
00098 GtkWidget* infoLabel;
00099 GtkWidget* selection;
00100
00101 profileGroupMode_t mode;
00102 guint nProfiles;
00103 guint nDisplayed;
00104 GtkProfileEntry** profileEntries;
00105
00106 on_profile_group_selection_update_t* callback_on_name;
00107 on_profile_group_selection_update_t* callback_on_edit;
00108 on_profile_group_button_press_t* callback_on_name_press;
00109 on_profile_group_button_press_t* callback_on_edit_press;
00110 };
00111
00112 struct _GtkProfileGroupClass
00113 {
00114 GtkEventBoxClass parent_class;
00115 };
00116
00117 #ifdef __cplusplus
00118 extern "C" {
00119 #endif
00120
00121
00122 GtkWidget* gtk_profile_group_new(int nProfiles,
00123 profileGroupMode_t mode);
00124
00125
00126 void gtk_profile_group_set_mode(GtkProfileGroup* profileGroup,
00127 profileGroupMode_t mode);
00128 profileGroupMode_t gtk_profile_group_get_mode(GtkProfileGroup* profileGroup);
00129
00130
00131 void gtk_profile_group_set_header_text(GtkProfileGroup *profileGroup,
00132 gchar* headerText);
00133
00134
00135 void gtk_profile_group_set_dialup_text(GtkProfileGroup *profileGroup,
00136 gchar* text);
00137
00138
00139 void gtk_profile_group_set_info_text(GtkProfileGroup *profileGroup,
00140 gchar* infoText);
00141
00142
00143 void gtk_profile_group_set_editbuttons_text(GtkProfileGroup *profileGroup,
00144 gchar* editText);
00145
00146 void gtk_profile_group_set_status_text(GtkProfileGroup* profileGroup,
00147 int profileIndex,
00148 gchar* text,
00149 gboolean flashing);
00150
00151
00152 void gtk_profile_group_display_settings(GtkProfileGroup* profileGroup,
00153 int profileIndex,
00154 const networkProfile_t* settings,
00155 gboolean resetStatus);
00156
00157
00158 gint gtk_profile_group_get_selected_profile_index(GtkProfileGroup *profileGroup);
00159
00160
00161 void gtk_profile_group_show_dialup(GtkProfileGroup *profileGroup,
00162 gboolean show);
00163
00164
00165 void gtk_profile_group_set_dialup_signal_image(GtkProfileGroup *profileGroup,
00166 guint quality);
00167
00168
00169 void gtk_profile_group_show_profile_entries(GtkProfileGroup *profileGroup,
00170 guint nDisplayed);
00171
00172
00173 void gtk_profile_group_callback_on_buttons_clicked( GtkProfileGroup *profileGroup,
00174 on_profile_group_selection_update_t* on_name,
00175 on_profile_group_selection_update_t* on_edit);
00176
00177 void gtk_profile_group_callback_on_buttons_press( GtkProfileGroup *profileGroup,
00178 on_profile_group_button_press_t* on_name_press,
00179 on_profile_group_button_press_t* on_edit_press);
00180
00181 guint on_profile_group_keypress (GtkProfileGroup* profileGroup, GdkEventKey * event);
00182
00183 void gtk_profile_group_select_first_profile (GtkProfileGroup* profileGroup);
00184 void gtk_profile_group_select_last_profile (GtkProfileGroup* profileGroup);
00185 gboolean gtk_profile_group_select_next_profile (GtkProfileGroup* profileGroup);
00186 gboolean gtk_profile_group_select_previous_profile (GtkProfileGroup* profileGroup);
00187
00188 void gtk_profile_group_select_profile (GtkProfileGroup* profileGroup,
00189 guint profileIndex);
00190 void gtk_profile_group_unselect_profile (GtkProfileGroup* profileGroup,
00191 guint profileIndex);
00192
00193
00194 GType gtk_profile_group_get_type (void);
00195
00196 #ifdef __cplusplus
00197 }
00198 #endif
00199
00200 #endif //_PROFILE_GROUP_H_
00201