Commit f39a3010 authored by Pierre-Luc Beaudoin's avatar Pierre-Luc Beaudoin

Doxygen doc

parent ead2f4ba
...@@ -15,8 +15,8 @@ Makefile.in ...@@ -15,8 +15,8 @@ Makefile.in
# Ignore rendered docs # Ignore rendered docs
doc/doxygen/html-everything doc/doxygen/html-everything
doc/doxygen/html-sflphoned doc/doxygen/html-sflphoned
doc/doxygen/html-gui-qt
doc/*.html doc/*.html
sflphone-gtk/doc/html/*
# Ignore buildsys stuff # Ignore buildsys stuff
/autom4te.cache /autom4te.cache
...@@ -101,4 +101,4 @@ tools/portaudio ...@@ -101,4 +101,4 @@ tools/portaudio
# Les foutus .svn # Les foutus .svn
*.svn* *.svn*
\ No newline at end of file
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
#define __ACCOUNTLIST_H__ #define __ACCOUNTLIST_H__
#include <gtk/gtk.h> #include <gtk/gtk.h>
/** @file accountlist.h
* @brief A list to hold accounts.
*/
#define ACCOUNT_TYPE "Account.type" #define ACCOUNT_TYPE "Account.type"
#define ACCOUNT_ALIAS "Account.alias" #define ACCOUNT_ALIAS "Account.alias"
...@@ -39,6 +42,9 @@ ...@@ -39,6 +42,9 @@
#define ACCOUNT_IAX_USER "IAX.user" #define ACCOUNT_IAX_USER "IAX.user"
#define ACCOUNT_IAX_PASS "IAX.pass" #define ACCOUNT_IAX_PASS "IAX.pass"
/** @enum account_state_t
* This enum have all the states an account can take.
*/
typedef enum typedef enum
{ {
ACCOUNT_STATE_INVALID = 0, ACCOUNT_STATE_INVALID = 0,
...@@ -46,27 +52,50 @@ typedef enum ...@@ -46,27 +52,50 @@ typedef enum
ACCOUNT_STATE_UNREGISTERED ACCOUNT_STATE_UNREGISTERED
} account_state_t; } account_state_t;
/** @struct account_t
* @brief Account information.
* This struct holds information about an account. All values are stored in the
* properties GHashTable except the accountID and state. This match how the
* server internally works and the dbus API to save and retrieve the accounts details.
*
* To retrieve the Alias for example, use g_hash_table_lookup(a->properties, ACCOUNT_ALIAS).
*/
typedef struct { typedef struct {
gchar * accountID; gchar * accountID;
account_state_t state; account_state_t state; GHashTable * properties;
GHashTable * properties;
} account_t; } account_t;
/** This function initialize the account list. */
void account_list_init (); void account_list_init ();
/** This function empty and free the account list. */
void account_list_clean (); void account_list_clean ();
/** This function append an account to list.
* @param a The account you want to add */
void account_list_add (account_t * a); void account_list_add (account_t * a);
/** This function remove an account from list.
* @param accountID The accountID of the account you want to remove
*/
void account_list_remove (const gchar * accountID); void account_list_remove (const gchar * accountID);
/** Return the first account that corresponds to the state */ /** Return the first account that corresponds to the state
* @param s The state
* @return An account or NULL */
account_t * account_list_get_by_state ( account_state_t state); account_t * account_list_get_by_state ( account_state_t state);
/** Return the number of accounts in the list
* @return The number of accounts in the list */
guint account_list_get_size ( ); guint account_list_get_size ( );
/** Return the account at the nth position in the list
* @param n The position of the account you want
* @return An account or NULL */
account_t * account_list_get_nth ( guint n ); account_t * account_list_get_nth ( guint n );
/** This function maps account_state_t enums to a description.
* @param s The state
* @return The full text description of the state */
const gchar * account_state_name(account_state_t s); const gchar * account_state_name(account_state_t s);
#endif #endif
...@@ -19,8 +19,10 @@ ...@@ -19,8 +19,10 @@
#ifndef __ACCOUNTWINDOW_H__ #ifndef __ACCOUNTWINDOW_H__
#define __ACCOUNTWINDOW_H__ #define __ACCOUNTWINDOW_H__
/** @file accountwindow.h
* @brief The window to edit account details.
*/
void show_account_window ( account_t * a ); void show_account_window ( account_t * a );
#endif #endif
...@@ -29,9 +29,7 @@ ...@@ -29,9 +29,7 @@
#include <dbus.h> #include <dbus.h>
#include <accountlist.h> #include <accountlist.h>
/**
* Terminate the gtk program
*/
gboolean gboolean
sflphone_quit () sflphone_quit ()
{ {
...@@ -53,9 +51,7 @@ sflphone_quit () ...@@ -53,9 +51,7 @@ sflphone_quit ()
return quit; return quit;
} }
/**
* Put the line on hold
*/
void void
sflphone_hold(call_t * c ) sflphone_hold(call_t * c )
{ {
...@@ -64,9 +60,6 @@ sflphone_hold(call_t * c ) ...@@ -64,9 +60,6 @@ sflphone_hold(call_t * c )
screen_clear(); screen_clear();
} }
/**
* Put the call in Ringing state
*/
void void
sflphone_ringing(call_t * c ) sflphone_ringing(call_t * c )
{ {
...@@ -75,7 +68,7 @@ sflphone_ringing(call_t * c ) ...@@ -75,7 +68,7 @@ sflphone_ringing(call_t * c )
} }
/* Fill account list */ /** Internal to actions: Fill account list */
void void
sflphone_fill_account_list() sflphone_fill_account_list()
{ {
...@@ -131,20 +124,6 @@ sflphone_init() ...@@ -131,20 +124,6 @@ sflphone_init()
} }
} }
/**
* Put the line on hold
*/
void
sflphone_unhold(call_t * c )
{
c->state = CALL_STATE_CURRENT;
update_call_tree(c);
screen_set_call(c);
}
/**
* Hang up the line
*/
void void
sflphone_hang_up( call_t * c ) sflphone_hang_up( call_t * c )
{ {
...@@ -153,9 +132,6 @@ sflphone_hang_up( call_t * c ) ...@@ -153,9 +132,6 @@ sflphone_hang_up( call_t * c )
screen_clear(); screen_clear();
} }
/**
* Incoming call
*/
void void
sflphone_current( call_t * c ) sflphone_current( call_t * c )
{ {
...@@ -164,9 +140,6 @@ sflphone_current( call_t * c ) ...@@ -164,9 +140,6 @@ sflphone_current( call_t * c )
screen_set_call(c); screen_set_call(c);
} }
/**
* Transfert the line
*/
void void
sflphone_transfert( call_t * c, gchar * to ) sflphone_transfert( call_t * c, gchar * to )
{ {
...@@ -174,18 +147,13 @@ sflphone_transfert( call_t * c, gchar * to ) ...@@ -174,18 +147,13 @@ sflphone_transfert( call_t * c, gchar * to )
update_call_tree_remove(c); update_call_tree_remove(c);
} }
/**
* Signal Incoming Call
*/
void void
sflphone_incoming_call (call_t * c) sflphone_incoming_call (call_t * c)
{ {
call_list_add ( c ); call_list_add ( c );
update_call_tree_add(c); update_call_tree_add(c);
} }
/**
* Signal Hung up
*/
void void
sflphone_hung_up (call_t * c ) sflphone_hung_up (call_t * c )
{ {
...@@ -317,10 +285,4 @@ sflphone_place_call ( call_t * c ) ...@@ -317,10 +285,4 @@ sflphone_place_call ( call_t * c )
} }
} }
void
sflphone_remove_account ( account_t * a )
{
dbus_remove_account (a->accountID);
}
...@@ -23,6 +23,13 @@ ...@@ -23,6 +23,13 @@
#include <calllist.h> #include <calllist.h>
#include <accountlist.h> #include <accountlist.h>
/** @file actions.h
* @brief General functions that change the state of the application.
* All of these functions are called when dbus signals are triggered. Exceptions
* are sflphone_init() sflphone_quit(), sflphone_keypad() and sflphone_place_call().
*/
/** /**
* Initialize lists and configurations * Initialize lists and configurations
* @return TRUE if succeeded, FALSE otherwise * @return TRUE if succeeded, FALSE otherwise
...@@ -35,36 +42,52 @@ gboolean sflphone_init ( ) ; ...@@ -35,36 +42,52 @@ gboolean sflphone_init ( ) ;
*/ */
gboolean sflphone_quit ( ) ; gboolean sflphone_quit ( ) ;
/**
* Hang up the call
*/
void sflphone_hang_up ( call_t * c); void sflphone_hang_up ( call_t * c);
/**
* Transfert the call
*/
void sflphone_transfert ( call_t * c, gchar * to ); void sflphone_transfert ( call_t * c, gchar * to );
/**
* Put the call on hold
*/
void sflphone_hold ( call_t * c); void sflphone_hold ( call_t * c);
/**
* Put the call in Ringing state
*/
void sflphone_ringing(call_t * c ); void sflphone_ringing(call_t * c );
/**
* Put the call in Current state
*/
void sflphone_current ( call_t * c); void sflphone_current ( call_t * c);
void sflphone_remove_account ( account_t * a ); /**
* The callee has hung up
void sflphone_unhold ( call_t * c); */
/* signals */
void sflphone_hung_up( call_t * c); void sflphone_hung_up( call_t * c);
/* void sflphone_ring */ /**
* Incoming call
*/
void sflphone_incoming_call ( call_t * c); void sflphone_incoming_call ( call_t * c);
/** /**
* Dial the number * Dial the number
* If the call is in DIALING state, the char will be append to the number * If the call is in DIALING state, the char will be append to the number
* TODO If the call is in CURRENT state, the char will be also sent to the server * @TODO If the call is in CURRENT state, the char will be also sent to the server
* @param c A call in CALL_STATE_DIALING state * @param keyval The unique int representing the key
* @param keyval The char value of the key
*/ */
void sflphone_keypad ( guint keyval, gchar * key); void sflphone_keypad ( guint keyval, gchar * key);
/** /**
* Place a call * Place a call with a filled call_t.to
* @param c A call in CALL_STATE_DIALING state * @param c A call in CALL_STATE_DIALING state
*/ */
void sflphone_place_call ( call_t * c ); void sflphone_place_call ( call_t * c );
......
...@@ -21,42 +21,90 @@ ...@@ -21,42 +21,90 @@
#define __CALLLIST_H__ #define __CALLLIST_H__
#include <gtk/gtk.h> #include <gtk/gtk.h>
/** @file calllist.h
* @brief A list to hold calls.
*/
/** @enum call_state_t
* This enum have all the states a call can take.
*/
typedef enum typedef enum
{ { /** Invalid state */
CALL_STATE_INVALID = 0, CALL_STATE_INVALID = 0,
CALL_STATE_INCOMING, /* Ringing incoming call */ /** Ringing incoming call */
CALL_STATE_RINGING, /* Ringing outgoing call */ CALL_STATE_INCOMING,
CALL_STATE_CURRENT, /** Ringing outgoing call */
CALL_STATE_DIALING, CALL_STATE_RINGING,
CALL_STATE_HOLD /** Call to which the user can speak and hear */
CALL_STATE_CURRENT,
/** Call which numbers are being added by the user */
CALL_STATE_DIALING,
/** Call is on hold */
CALL_STATE_HOLD
} call_state_t; } call_state_t;
/** @struct call_t
* @brief Call information.
* This struct holds information about a call.
*/
typedef struct { typedef struct {
/** Unique identifier of the call */
gchar * callID; gchar * callID;
/** The account used to place/receive the call */
gchar * accountID; gchar * accountID;
/** The information about the calling person. See call_get_name() and call_get_number()
* on how to get the name and number separately. */
gchar * from; gchar * from;
/** The number we are calling. Only used when dialing out */
gchar * to; gchar * to;
/* The current state of the call */
call_state_t state; call_state_t state;
} call_t; } call_t;
/** This function initialize the call list. */
void call_list_init (); void call_list_init ();
/** This function empty and free the call list. */
void call_list_clean (); void call_list_clean ();
/** This function append a call to list.
* @param c The call you want to add */
void call_list_add (call_t * c); void call_list_add (call_t * c);
/** This function remove a call from list.
* @param callID The callID of the call you want to remove
*/
void call_list_remove (const gchar * callID); void call_list_remove (const gchar * callID);
/** Return the first call that corresponds to the state.
* This is usefull for unique states as DIALING and CURRENT.
* @param state The state
* @return A call or NULL */
call_t * call_list_get_by_state ( call_state_t state); call_t * call_list_get_by_state ( call_state_t state);
/** Return the number of calls in the list
* @return The number of calls in the list */
guint call_list_get_size ( ); guint call_list_get_size ( );
/** Return the call at the nth position in the list
* @param n The position of the call you want
* @return A call or NULL */
call_t * call_list_get_nth ( guint n ); call_t * call_list_get_nth ( guint n );
/** Return the call corresponding to the callID
* @param n The callID of the call you want
* @return A call or NULL */
call_t * call_list_get ( const gchar * callID ); call_t * call_list_get ( const gchar * callID );
/** This function parse the call_t.from field to return the name
* @param c The call
* @return The full name of the caller or an empty string */
gchar * call_get_name (const call_t * c); gchar * call_get_name (const call_t * c);
/** This function parse the call_t.from field to return the number
* @param c The call
* @return The number of the caller */
gchar * call_get_number (const call_t * c); gchar * call_get_number (const call_t * c);
#endif #endif
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <calllist.h> #include <calllist.h>
/** @file calltree.h
* @brief The GtkTreeView that list calls in the main window.
*/
GtkWidget * create_call_tree(); GtkWidget * create_call_tree();
void update_call_tree_add (call_t * c); void update_call_tree_add (call_t * c);
......
...@@ -17,11 +17,12 @@ ...@@ -17,11 +17,12 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <config.h>
#include <mainwindow.h>
#include <accountlist.h> #include <accountlist.h>
#include <accountwindow.h> #include <accountwindow.h>
#include <actions.h> #include <actions.h>
#include <config.h>
#include <dbus.h>
#include <mainwindow.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
...@@ -49,14 +50,13 @@ fill_account_list () ...@@ -49,14 +50,13 @@ fill_account_list ()
gtk_list_store_append (account_store, &iter); gtk_list_store_append (account_store, &iter);
gtk_list_store_set(account_store, &iter, gtk_list_store_set(account_store, &iter,
0, g_hash_table_lookup(a->properties, ACCOUNT_ALIAS), // Name 0, g_hash_table_lookup(a->properties, ACCOUNT_ALIAS), // Name
1, g_hash_table_lookup(a->properties, ACCOUNT_TYPE), // Protocol 1, g_hash_table_lookup(a->properties, ACCOUNT_TYPE), // Protocol
2, account_state_name(a->state), // Status 2, account_state_name(a->state), // Status
3, a, // Pointer 3, a, // Pointer
-1); -1);
} }
} }
gtk_widget_set_sensitive( GTK_WIDGET(editButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(editButton), FALSE);
...@@ -70,7 +70,7 @@ delete_account( GtkWidget *widget, gpointer data ) ...@@ -70,7 +70,7 @@ delete_account( GtkWidget *widget, gpointer data )
{ {
if(selectedAccount) if(selectedAccount)
{ {
sflphone_remove_account(selectedAccount); dbus_remove_account(selectedAccount->accountID);
fill_account_list (); fill_account_list ();
} }
} }
...@@ -146,7 +146,7 @@ create_accounts_tab() ...@@ -146,7 +146,7 @@ create_accounts_tab()
gtk_widget_show(label); gtk_widget_show(label);
sw = gtk_scrolled_window_new(NULL,NULL); sw = gtk_scrolled_window_new(NULL,NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0);
......
...@@ -22,7 +22,9 @@ ...@@ -22,7 +22,9 @@
#include <calllist.h> #include <calllist.h>
/** @file configwindow.h
* @brief The Preferences window.
*/
void show_config_window ( ); void show_config_window ( );
......
...@@ -100,10 +100,6 @@ call_state_cb (DBusGProxy *proxy, ...@@ -100,10 +100,6 @@ call_state_cb (DBusGProxy *proxy,
{ {
sflphone_hold (c); sflphone_hold (c);
} }
else if ( strcmp(state, "UNHOLD") == 0 )
{
sflphone_unhold (c);