GtkAuthDialog Class Reference

#include <GtkAuthDialog.h>

Collaboration diagram for GtkAuthDialog:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GtkAuthDialog (void)
 ~GtkAuthDialog (void)
gboolean popupAuthDialog (CPDFView *)
char * getPassword ()

Static Public Member Functions

static gboolean exposeCbk (GtkPincodeScreen *dialog, GdkEventExpose *event, gpointer user_data)
static gboolean destroyCbk (GtkPincodeScreen *dialog, GdkEvent *event, gpointer user_data)
static gboolean focusInCbk (GtkWidget *widget, GdkEventFocus *event, gpointer data)
static gboolean focusOutCbk (GtkWidget *widget, GdkEventFocus *event, gpointer data)
static gboolean focusCbk (GtkWidget *widget, GtkDirectionType arg1, gpointer data)
static void changedCbk (GtkEditable *widget, gpointer data)
static void moveCursorCbk (GtkEntry *widget, GtkMovementStep arg1, gint arg2, gboolean arg3, gpointer data)
static void buttonClickedCbk (GtkToggleButton *button, gpointer user_data)
static void buttonStateChangedCbk (GtkWidget *button, GtkStateType state, gpointer user_data)

Private Member Functions

void initPincodeDialog ()

Private Attributes

GtkPincodeScreendialog
CPDFViewview
char password [MAX_PASSWORD_LENGTH]
gboolean bOk
gboolean bUpdate


Detailed Description

Definition at line 63 of file GtkAuthDialog.h.


Constructor & Destructor Documentation

GtkAuthDialog::GtkAuthDialog ( void   ) 

Definition at line 263 of file GtkAuthDialog.cpp.

00264 : dialog(NULL)
00265 , view(NULL)
00266 , bOk(gFalse)
00267 , bUpdate(gFalse)
00268 {
00269 }

GtkAuthDialog::~GtkAuthDialog ( void   ) 

Definition at line 271 of file GtkAuthDialog.cpp.

00272 {
00273 }


Member Function Documentation

void GtkAuthDialog::initPincodeDialog (  )  [private]

Definition at line 275 of file GtkAuthDialog.cpp.

00276 {
00277     dialog = (GtkPincodeScreen *)g_object_new(GTK_PINCODE_SCREEN_TYPE, NULL);
00278     gtk_container_add(GTK_CONTAINER(view->getWindow()), GTK_WIDGET(dialog));
00279     gtk_widget_show_all(GTK_WIDGET(view->getWindow()));
00280     dialog->authDialog = this;
00281 }

Here is the call graph for this function:

gboolean GtkAuthDialog::exposeCbk ( GtkPincodeScreen dialog,
GdkEventExpose *  event,
gpointer  user_data 
) [static]

Definition at line 300 of file GtkAuthDialog.cpp.

00302 {
00303     // grab focus, do not refresh screen now. 
00304     // focusInCbk will be invoked
00305     dialog->authDialog->bUpdate = gFalse;
00306     gtk_widget_grab_focus(dialog->inputWidget);
00307 
00308     // popup keyboard
00309     if (count <= 0)
00310     {
00311         dialog->authDialog->view->ctrl->channels.popupKeyboard();
00312     }
00313     else
00314     {
00315         gtk_idle_add(updateScreen, dialog->authDialog->view);
00316         
00317     }        
00318     dialog->authDialog->view->ctrl->channels.busy_off();
00319     return FALSE;
00320 }

Here is the call graph for this function:

gboolean GtkAuthDialog::destroyCbk ( GtkPincodeScreen dialog,
GdkEvent *  event,
gpointer  user_data 
) [static]

Definition at line 424 of file GtkAuthDialog.cpp.

00426 {
00427     return FALSE;
00428 }

gboolean GtkAuthDialog::focusInCbk ( GtkWidget *  widget,
GdkEventFocus *  event,
gpointer  data 
) [static]

Definition at line 322 of file GtkAuthDialog.cpp.

00324 {
00325     GtkPincodeScreen * screen = (GtkPincodeScreen *)data;
00326     if (!screen->authDialog->bUpdate)
00327     {
00328         screen->authDialog->bUpdate = gTrue;
00329         return FALSE;
00330     }
00331     screen->authDialog->view->refreshDeviceScreen(dmQTyping);
00332     return FALSE;
00333 }

Here is the call graph for this function:

gboolean GtkAuthDialog::focusOutCbk ( GtkWidget *  widget,
GdkEventFocus *  event,
gpointer  data 
) [static]

Definition at line 335 of file GtkAuthDialog.cpp.

00337 {
00338     GtkPincodeScreen * screen = (GtkPincodeScreen *)data;
00339     if (!screen->authDialog->bUpdate)
00340     {
00341         return FALSE;
00342     }        
00343     screen->authDialog->view->refreshDeviceScreen(dmQTyping);
00344     return FALSE;
00345 }        

Here is the call graph for this function:

gboolean GtkAuthDialog::focusCbk ( GtkWidget *  widget,
GtkDirectionType  arg1,
gpointer  data 
) [static]

Definition at line 347 of file GtkAuthDialog.cpp.

00349 {
00350     GtkPincodeScreen * screen = (GtkPincodeScreen *)data;
00351     screen->authDialog->view->refreshDeviceScreen(dmQTyping);
00352     return FALSE;
00353 }

Here is the call graph for this function:

void GtkAuthDialog::changedCbk ( GtkEditable *  widget,
gpointer  data 
) [static]

Definition at line 355 of file GtkAuthDialog.cpp.

00357 {
00358     GtkPincodeScreen * screen = (GtkPincodeScreen *)data;
00359     screen->authDialog->view->refreshDeviceScreen(dmQTyping);
00360     return;
00361 }

Here is the call graph for this function:

void GtkAuthDialog::moveCursorCbk ( GtkEntry *  widget,
GtkMovementStep  arg1,
gint  arg2,
gboolean  arg3,
gpointer  data 
) [static]

Definition at line 363 of file GtkAuthDialog.cpp.

00365 {
00366     GtkPincodeScreen * screen = (GtkPincodeScreen *)data;
00367     screen->authDialog->view->refreshDeviceScreen(dmQTyping);
00368     return;
00369 }

Here is the call graph for this function:

void GtkAuthDialog::buttonClickedCbk ( GtkToggleButton *  button,
gpointer  user_data 
) [static]

Definition at line 372 of file GtkAuthDialog.cpp.

00374 {
00375     GtkPincodeScreen * screen = (GtkPincodeScreen *)user_data;
00376     screen->authDialog->view->ctrl->channels.busy_blink();
00377     screen->authDialog->bOk = gFalse;
00378     screen->authDialog->bUpdate = gFalse;
00379     if (GTK_BUTTON(button) == screen->okButton)
00380     {
00381         screen->authDialog->bOk = gTrue;
00382         memset(screen->authDialog->password, 0, MAX_PASSWORD_LENGTH);
00383         strncpy(screen->authDialog->password, gtk_entry_get_text(GTK_ENTRY(screen->inputWidget)), MAX_PASSWORD_LENGTH);
00384     }
00385     gtk_container_remove(GTK_CONTAINER(screen->authDialog->view->getWindow()), GTK_WIDGET(screen));
00386     gtk_main_quit();
00387     return;
00388 }        

Here is the call graph for this function:

void GtkAuthDialog::buttonStateChangedCbk ( GtkWidget *  button,
GtkStateType  state,
gpointer  user_data 
) [static]

Definition at line 390 of file GtkAuthDialog.cpp.

00392 {
00393    
00394     GtkStateType betterstate = GTK_STATE_NORMAL;
00395     GtkStyle *style = NULL;
00396     GtkWidget *button_label = NULL;
00397 
00398     g_return_if_fail(GTK_IS_TOGGLE_BUTTON(button));
00399 
00400     button_label = gtk_bin_get_child(GTK_BIN(button));
00401     style = gtk_widget_get_style(button_label);
00402 
00403     if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)) || (state == GTK_STATE_ACTIVE))
00404     {
00405         betterstate = GTK_STATE_ACTIVE;
00406     }
00407     else
00408     {
00409         betterstate = GTK_STATE_NORMAL;
00410     }
00411 
00412     if (style->fg[GTK_STATE_PRELIGHT].red != style->fg[betterstate].red
00413         || style->fg[GTK_STATE_PRELIGHT].green != style->fg[betterstate].green
00414         || style->fg[GTK_STATE_PRELIGHT].blue != style->fg[betterstate].blue)
00415     {
00416         gtk_widget_modify_fg(button_label, GTK_STATE_PRELIGHT, &(style->fg[betterstate]));
00417     }
00418     
00419     GtkPincodeScreen * screen = (GtkPincodeScreen *)data;    
00420     screen->authDialog->view->refreshDeviceScreen(dmQTyping);
00421     return;
00422 }

Here is the call graph for this function:

int GtkAuthDialog::popupAuthDialog ( CPDFView p  ) 

Definition at line 283 of file GtkAuthDialog.cpp.

00284 {
00285     ++count;
00286     view = p;
00287     initPincodeDialog();
00288     gtk_main();
00289     return bOk;
00290 }

Here is the call graph for this function:

char* GtkAuthDialog::getPassword (  )  [inline]

Definition at line 114 of file GtkAuthDialog.h.

00114 { return password; }


Member Data Documentation

Definition at line 66 of file GtkAuthDialog.h.

Definition at line 67 of file GtkAuthDialog.h.

char GtkAuthDialog::password[MAX_PASSWORD_LENGTH] [private]

Definition at line 68 of file GtkAuthDialog.h.

gboolean GtkAuthDialog::bOk [private]

Definition at line 69 of file GtkAuthDialog.h.

gboolean GtkAuthDialog::bUpdate [private]

Definition at line 70 of file GtkAuthDialog.h.


The documentation for this class was generated from the following files:

Generated on Wed Feb 4 18:26:35 2009 by  doxygen 1.5.6