Commit 45f2b6a0 authored by Alexandre Savard's avatar Alexandre Savard

[#2402] Code indent

parent 784d42f4
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Savoir-faire Linux Inc # Savoir-faire Linux Inc
# http://www.sflphone.org # http://www.sflphone.org
style=kr # Kernighan & Ritchie style formatting/indenting uses linux bracket style=k&r # Kernighan & Ritchie style formatting/indenting uses linux bracket
indent=spaces=4 # Use spaces instead of tabs for indentation indent=spaces=4 # Use spaces instead of tabs for indentation
indent-classes # Indent 'class' and 'struct' blocks so that the blocks 'public:', 'protected:' and 'private:' are indented indent-classes # Indent 'class' and 'struct' blocks so that the blocks 'public:', 'protected:' and 'private:' are indented
indent-switches # Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block indent-switches # Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block
......
This diff is collapsed.
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc. * Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
* Author: Pierre-Luc Beaudoin <pierre-luc@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@savoirfairelinux.com>
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* shall include the source code for the parts of OpenSSL used as well * shall include the source code for the parts of OpenSSL used as well
* as that of the covered work. * as that of the covered work.
*/ */
#ifndef __ACCOUNTLIST_H__ #ifndef __ACCOUNTLIST_H__
#define __ACCOUNTLIST_H__ #define __ACCOUNTLIST_H__
...@@ -37,170 +37,169 @@ ...@@ -37,170 +37,169 @@
* @brief A list to hold accounts. * @brief A list to hold accounts.
*/ */
/** @enum account_state_t /** @enum account_state_t
* This enum have all the states an account can take. * This enum have all the states an account can take.
*/ */
typedef enum typedef enum {
{ /** Invalid state */
/** Invalid state */ ACCOUNT_STATE_INVALID = 0,
ACCOUNT_STATE_INVALID = 0, /** The account is registered */
/** The account is registered */ ACCOUNT_STATE_REGISTERED,
ACCOUNT_STATE_REGISTERED, /** The account is not registered */
/** The account is not registered */ ACCOUNT_STATE_UNREGISTERED,
ACCOUNT_STATE_UNREGISTERED, /** The account is trying to register */
/** The account is trying to register */ ACCOUNT_STATE_TRYING,
ACCOUNT_STATE_TRYING, /** Error state. The account is not registered */
/** Error state. The account is not registered */ ACCOUNT_STATE_ERROR,
ACCOUNT_STATE_ERROR, /** An authentification error occured. Wrong password or wrong username. The account is not registered */
/** An authentification error occured. Wrong password or wrong username. The account is not registered */ ACCOUNT_STATE_ERROR_AUTH,
ACCOUNT_STATE_ERROR_AUTH, /** The network is unreachable. The account is not registered */
/** The network is unreachable. The account is not registered */ ACCOUNT_STATE_ERROR_NETWORK,
ACCOUNT_STATE_ERROR_NETWORK, /** Host is unreachable. The account is not registered */
/** Host is unreachable. The account is not registered */ ACCOUNT_STATE_ERROR_HOST,
ACCOUNT_STATE_ERROR_HOST, /** Stun server configuration error. The account is not registered */
/** Stun server configuration error. The account is not registered */ ACCOUNT_STATE_ERROR_CONF_STUN,
ACCOUNT_STATE_ERROR_CONF_STUN, /** Stun server is not existing. The account is not registered */
/** Stun server is not existing. The account is not registered */ ACCOUNT_STATE_ERROR_EXIST_STUN,
ACCOUNT_STATE_ERROR_EXIST_STUN, /** IP profile status **/
/** IP profile status **/ IP2IP_PROFILE_STATUS
IP2IP_PROFILE_STATUS
} account_state_t; } account_state_t;
/** @struct account_t /** @struct account_t
* @brief Account information. * @brief Account information.
* This struct holds information about an account. All values are stored in the * This struct holds information about an account. All values are stored in the
* properties GHashTable except the accountID and state. This match how 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. * 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). * 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;
gchar * protocol_state_description; gchar * protocol_state_description;
guint protocol_state_code; guint protocol_state_code;
GHashTable * properties; GHashTable * properties;
GPtrArray * credential_information; GPtrArray * credential_information;
/* The codec list */ /* The codec list */
GQueue *codecs; GQueue *codecs;
guint _messages_number; guint _messages_number;
} account_t; } account_t;
/** /**
* This function initialize the account list. * This function initialize the account list.
*/ */
void account_list_init (); void account_list_init ();
/** /**
* This function empty and free the account list. * This function empty and free the account list.
*/ */
void account_list_clean (); void account_list_clean ();
/** /**
* This function append an account to list. * This function append an account to list.
* @param a The account you want to add * @param a The account you want to add
*/ */
void account_list_add (account_t * a); void account_list_add (account_t * a);
/** /**
* This function append an account to list at a given position. * This function append an account to list at a given position.
* @param a The account you want to add * @param a The account you want to add
* @param pos THe position in the list to insert the account * @param pos THe position in the list to insert the account
*/ */
void account_list_add_at_nth (account_t * a, guint pos); void account_list_add_at_nth (account_t * a, guint pos);
/** /**
* This function remove an account from list. * This function remove an account from list.
* @param accountID The accountID of the account you want to remove * @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 state The state * @param state The state
* @return account_t* An account or NULL * @return account_t* 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 guint The number of registered accounts in the list * @return guint The number of registered accounts in the list
*/ */
guint account_list_get_registered_accounts( ); guint account_list_get_registered_accounts();
/** /**
* Return the number of accounts in the list * Return the number of accounts in the list
* @return guint The number of accounts in the list * @return guint 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 * Return the account at the nth position in the list
* @param n The position of the account you want * @param n The position of the account you want
* @return An account or NULL * @return An account or NULL
*/ */
account_t * account_list_get_nth ( guint n ); account_t * account_list_get_nth (guint n);
/** /**
* Return the current account struct * Return the current account struct
* @return The current account struct * @return The current account struct
*/ */
account_t * account_list_get_current( ); account_t * account_list_get_current();
/** /**
* This function sets an account as the current one * This function sets an account as the current one
* @param current the account you want to set as current * @param current the account you want to set as current
*/ */
void account_list_set_current (account_t *current); void account_list_set_current (account_t *current);
/** /**
* This function maps account_state_t enums to a description. * This function maps account_state_t enums to a description.
* @param s The state * @param s The state
* @return The full text description of 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);
/** /**
* This function clear the list * This function clear the list
*/ */
void account_list_clear ( ); void account_list_clear ();
/** /**
* Return the account associated with an ID * Return the account associated with an ID
* @param accountID The ID of the account * @param accountID The ID of the account
* @return An account or NULL * @return An account or NULL
*/ */
account_t * account_list_get_by_id(gchar * accountID); account_t * account_list_get_by_id (gchar * accountID);
/** /**
* Move the account from an unit up in the account_list * Move the account from an unit up in the account_list
* @param index The current index in the list * @param index The current index in the list
*/ */
void account_list_move_up( guint index ); void account_list_move_up (guint index);
/** /**
* Move the account from an unit down in the account_list * Move the account from an unit down in the account_list
* @param index The current index in the list * @param index The current index in the list
*/ */
void account_list_move_down( guint index ); void account_list_move_down (guint index);
/** /**
* Return the ID of the current default account * Return the ID of the current default account
* @return gchar* The id * @return gchar* The id
*/ */
gchar* account_list_get_current_id( void ); gchar* account_list_get_current_id (void);
/** /**
* Returns the number of SIP accounts that have been configured * Returns the number of SIP accounts that have been configured
*/ */
int account_list_get_sip_account_number( void ); int account_list_get_sip_account_number (void);
/** /**
* Returns the number of IAX accounts that have been configured * Returns the number of IAX accounts that have been configured
*/ */
int account_list_get_iax_account_number( void ); int account_list_get_iax_account_number (void);
gchar * account_list_get_ordered_list (void); gchar * account_list_get_ordered_list (void);
...@@ -214,4 +213,4 @@ void current_account_set_message_number (guint nb); ...@@ -214,4 +213,4 @@ void current_account_set_message_number (guint nb);
gboolean current_account_has_new_message (void); gboolean current_account_has_new_message (void);
#endif #endif
This diff is collapsed.
...@@ -54,13 +54,13 @@ ...@@ -54,13 +54,13 @@
* Initialize lists and configurations * Initialize lists and configurations
* @return TRUE if succeeded, FALSE otherwise * @return TRUE if succeeded, FALSE otherwise
*/ */
gboolean sflphone_init ( ) ; gboolean sflphone_init () ;
/** /**
* Steps when closing the application. Will ask for confirmation if a call is in progress. * Steps when closing the application. Will ask for confirmation if a call is in progress.
* @return TRUE if the user wants to quit, FALSE otherwise. * @return TRUE if the user wants to quit, FALSE otherwise.
*/ */
gboolean sflphone_quit ( ) ; gboolean sflphone_quit () ;
/** /**
* Hang up / refuse the current call * Hang up / refuse the current call
...@@ -88,7 +88,7 @@ callable_obj_t * sflphone_new_call(); ...@@ -88,7 +88,7 @@ callable_obj_t * sflphone_new_call();
* @param accountID The account the voice mails are for * @param accountID The account the voice mails are for
* @param count The number of voice mails * @param count The number of voice mails
*/ */
void sflphone_notify_voice_mail ( const gchar* accountID , guint count ); void sflphone_notify_voice_mail (const gchar* accountID , guint count);
/** /**
* Prepare SFLphone to transfer a call and wait for the user to dial the number to transfer to * Prepare SFLphone to transfer a call and wait for the user to dial the number to transfer to
...@@ -110,43 +110,43 @@ void sflphone_pick_up (); ...@@ -110,43 +110,43 @@ void sflphone_pick_up ();
* Put the call on hold state * Put the call on hold state
* @param c The current call * @param c The current call
*/ */
void sflphone_hold ( callable_obj_t * c); void sflphone_hold (callable_obj_t * c);
/** /**
* Put the call in Ringing state * Put the call in Ringing state
* @param c* The current call * @param c* The current call
*/ */
void sflphone_ringing(callable_obj_t * c ); void sflphone_ringing (callable_obj_t * c);
/** /**
* Put the call in Busy state * Put the call in Busy state
* @param c* The current call * @param c* The current call
*/ */
void sflphone_busy( callable_obj_t * c ); void sflphone_busy (callable_obj_t * c);
/** /**
* Put the call in Failure state * Put the call in Failure state
* @param c* The current call * @param c* The current call
*/ */
void sflphone_fail( callable_obj_t * c ); void sflphone_fail (callable_obj_t * c);
/** /**
* Put the call in Current state * Put the call in Current state
* @param c The current call * @param c The current call
*/ */
void sflphone_current ( callable_obj_t * c); void sflphone_current (callable_obj_t * c);
/** /**
* The callee has hung up * The callee has hung up
* @param c The current call * @param c The current call
*/ */
void sflphone_hung_up( callable_obj_t * c); void sflphone_hung_up (callable_obj_t * c);
/** /**
* Incoming call * Incoming call
* @param c The incoming call * @param c The incoming call
*/ */
void sflphone_incoming_call ( callable_obj_t * c); void sflphone_incoming_call (callable_obj_t * c);
/** /**
* Dial the number * Dial the number
...@@ -154,26 +154,26 @@ void sflphone_incoming_call ( callable_obj_t * c); ...@@ -154,26 +154,26 @@ void sflphone_incoming_call ( callable_obj_t * c);
* @param keyval The unique int representing the key * @param keyval The unique int representing the key
* @param key The char value of the key * @param key The char value of the key
*/ */
void sflphone_keypad ( guint keyval, gchar * key); void sflphone_keypad (guint keyval, gchar * key);
/** /**
* Place a call with a filled callable_obj_t.to * Place a call with a filled callable_obj_t.to
* @param c A call in CALL_STATE_DIALING state * @param c A call in CALL_STATE_DIALING state
*/ */
void sflphone_place_call ( callable_obj_t * c ); void sflphone_place_call (callable_obj_t * c);
/** /**
* Fetch the ip2ip profile through dbus and fill * Fetch the ip2ip profile through dbus and fill
* the internal hash table. * the internal hash table.
*/ */
void sflphone_fill_ip2ip_profile(void); void sflphone_fill_ip2ip_profile (void);
/** /**
* @return The internal hash table representing * @return The internal hash table representing
* the settings for the ip2ip profile. * the settings for the ip2ip profile.
*/ */
void sflphone_get_ip2ip_properties (GHashTable **properties); void sflphone_get_ip2ip_properties (GHashTable **properties);
/** /**
* Initialize the accounts data structure * Initialize the accounts data structure
*/ */
...@@ -210,95 +210,95 @@ void sflphone_save_history (void); ...@@ -210,95 +210,95 @@ void sflphone_save_history (void);
/** /**
* Action called when two single call are dragged on together to create a new conference * Action called when two single call are dragged on together to create a new conference
*/ */
void sflphone_join_participant(const gchar* sel_callID, const gchar* drag_callID); void sflphone_join_participant (const gchar* sel_callID, const gchar* drag_callID);
/** /**
* Action called when a new participant is dragged in * Action called when a new participant is dragged in
*/ */
void sflphone_add_participant(const gchar* callID, const gchar* confID); void sflphone_add_participant (const gchar* callID, const gchar* confID);
/** /**
* Action called when a conference participant is draged out * Action called when a conference participant is draged out
*/ */
void sflphone_detach_participant(const gchar* callID); void sflphone_detach_participant (const gchar* callID);
/** /**
* Action called when two conference are merged together * Action called when two conference are merged together
*/ */
void sflphone_join_conference(const gchar* sel_confID, const gchar* drag_confID); void sflphone_join_conference (const gchar* sel_confID, const gchar* drag_confID);
/** /**
* Nofity that the communication is * Nofity that the communication is
* now secured using SRTP/SDES. * now secured using SRTP/SDES.
* @param c* The current call * @param c* The current call
*/ */
void sflphone_srtp_sdes_on(callable_obj_t * c); void sflphone_srtp_sdes_on (callable_obj_t * c);
/** /**
* Notify that the SRTP/SDES session * Notify that the SRTP/SDES session
* is not secured * is not secured
*/ */
/** /**
* Nofity that the communication is * Nofity that the communication is
* now secured using ZRTP. * now secured using ZRTP.
* @param c* The current call * @param c* The current call
*/ */
void sflphone_srtp_zrtp_on( callable_obj_t * c); void sflphone_srtp_zrtp_on (callable_obj_t * c);
/** /**
* Called when the ZRTP session goes * Called when the ZRTP session goes
* unsecured. * unsecured.
* @param c* The current call * @param c* The current call
*/ */
void sflphone_srtp_zrtp_off( callable_obj_t * c ); void sflphone_srtp_zrtp_off (callable_obj_t * c);
/** /**
* Called when the sas has been computed * Called when the sas has been computed
* and is ready to be displayed. * and is ready to be displayed.
* @param c* The current call * @param c* The current call
* @param sas* The Short Authentication String * @param sas* The Short Authentication String
* @param verified* Weather the SAS was confirmed or not. * @param verified* Weather the SAS was confirmed or not.
*/ */
void sflphone_srtp_zrtp_show_sas( callable_obj_t * c, const gchar* sas, const gboolean verified); void sflphone_srtp_zrtp_show_sas (callable_obj_t * c, const gchar* sas, const gboolean verified);
/** /**
* Called when the remote peer does not support ZRTP * Called when the remote peer does not support ZRTP
* @param c* The current call * @param c* The current call
*/ */
void sflphone_srtp_zrtp_not_supported( callable_obj_t * c ); void sflphone_srtp_zrtp_not_supported (callable_obj_t * c);
/** /**
* Called when user wants to confirm go clear request. * Called when user wants to confirm go clear request.
* @param c* The call to confirm the go clear request. * @param c* The call to confirm the go clear request.
*/ */
void sflphone_set_confirm_go_clear( callable_obj_t * c ); void sflphone_set_confirm_go_clear (callable_obj_t * c);
/** /**
* Called when user wants to confirm go clear request. * Called when user wants to confirm go clear request.
* @param c* The call to confirm the go clear request. * @param c* The call to confirm the go clear request.
*/ */
void sflphone_confirm_go_clear( callable_obj_t * c ); void sflphone_confirm_go_clear (callable_obj_t * c);
/** /**