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

[#2402] Code indent

parent 784d42f4
......@@ -5,7 +5,7 @@
# Savoir-faire Linux Inc
# 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-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
......
This diff is collapsed.
......@@ -2,17 +2,17 @@
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
* Author: Pierre-Luc Beaudoin <pierre-luc@savoirfairelinux.com>
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
*
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
......@@ -28,7 +28,7 @@
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef __ACCOUNTLIST_H__
#define __ACCOUNTLIST_H__
......@@ -37,170 +37,169 @@
* @brief A list to hold accounts.
*/
/** @enum account_state_t
/** @enum account_state_t
* This enum have all the states an account can take.
*/
typedef enum
{
/** Invalid state */
ACCOUNT_STATE_INVALID = 0,
/** The account is registered */
ACCOUNT_STATE_REGISTERED,
/** The account is not registered */
ACCOUNT_STATE_UNREGISTERED,
/** The account is trying to register */
ACCOUNT_STATE_TRYING,
/** Error state. The account is not registered */
ACCOUNT_STATE_ERROR,
/** An authentification error occured. Wrong password or wrong username. The account is not registered */
ACCOUNT_STATE_ERROR_AUTH,
/** The network is unreachable. The account is not registered */
ACCOUNT_STATE_ERROR_NETWORK,
/** Host is unreachable. The account is not registered */
ACCOUNT_STATE_ERROR_HOST,
/** Stun server configuration error. The account is not registered */
ACCOUNT_STATE_ERROR_CONF_STUN,
/** Stun server is not existing. The account is not registered */
ACCOUNT_STATE_ERROR_EXIST_STUN,
/** IP profile status **/
IP2IP_PROFILE_STATUS
typedef enum {
/** Invalid state */
ACCOUNT_STATE_INVALID = 0,
/** The account is registered */
ACCOUNT_STATE_REGISTERED,
/** The account is not registered */
ACCOUNT_STATE_UNREGISTERED,
/** The account is trying to register */
ACCOUNT_STATE_TRYING,
/** Error state. The account is not registered */
ACCOUNT_STATE_ERROR,
/** An authentification error occured. Wrong password or wrong username. The account is not registered */
ACCOUNT_STATE_ERROR_AUTH,
/** The network is unreachable. The account is not registered */
ACCOUNT_STATE_ERROR_NETWORK,
/** Host is unreachable. The account is not registered */
ACCOUNT_STATE_ERROR_HOST,
/** Stun server configuration error. The account is not registered */
ACCOUNT_STATE_ERROR_CONF_STUN,
/** Stun server is not existing. The account is not registered */
ACCOUNT_STATE_ERROR_EXIST_STUN,
/** IP profile status **/
IP2IP_PROFILE_STATUS
} 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
* 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).
*
* To retrieve the Alias for example, use g_hash_table_lookup(a->properties, ACCOUNT_ALIAS).
*/
typedef struct {
gchar * accountID;
account_state_t state;
gchar * protocol_state_description;
guint protocol_state_code;
GHashTable * properties;
GPtrArray * credential_information;
/* The codec list */
GQueue *codecs;
guint _messages_number;
gchar * accountID;
account_state_t state;
gchar * protocol_state_description;
guint protocol_state_code;
GHashTable * properties;
GPtrArray * credential_information;
/* The codec list */
GQueue *codecs;
guint _messages_number;
} account_t;
/**
* This function initialize the account list.
/**
* This function initialize the account list.
*/
void account_list_init ();
/**
* This function empty and free the account list.
/**
* This function empty and free the account list.
*/
void account_list_clean ();
/**
* This function append an account to list.
* @param a The account you want to add
/**
* This function append an account to list.
* @param a The account you want to add
*/
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 pos THe position in the list to insert the account
*/
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
*/
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
* @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
*/
guint account_list_get_registered_accounts( );
guint account_list_get_registered_accounts();
/**
/**
* 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
* @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
*/
account_t * account_list_get_current( );
account_t * account_list_get_current();
/**
/**
* This function sets an account as the current one
* @param current the account you want to set as current
*/
void account_list_set_current (account_t *current);
/**
/**
* This function maps account_state_t enums to a description.
* @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
*/
void account_list_clear ( );
void account_list_clear ();
/**
/**
* Return the account associated with an ID
* @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
* @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
* @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 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
*/
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
*/
int account_list_get_iax_account_number( void );
int account_list_get_iax_account_number (void);
gchar * account_list_get_ordered_list (void);
......@@ -214,4 +213,4 @@ void current_account_set_message_number (guint nb);
gboolean current_account_has_new_message (void);
#endif
#endif
This diff is collapsed.
......@@ -54,13 +54,13 @@
* Initialize lists and configurations
* @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.
* @return TRUE if the user wants to quit, FALSE otherwise.
*/
gboolean sflphone_quit ( ) ;
gboolean sflphone_quit () ;
/**
* Hang up / refuse the current call
......@@ -88,7 +88,7 @@ callable_obj_t * sflphone_new_call();
* @param accountID The account the voice mails are for
* @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
......@@ -110,43 +110,43 @@ void sflphone_pick_up ();
* Put the call on hold state
* @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
* @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
* @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
* @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
* @param c The current call
*/
void sflphone_current ( callable_obj_t * c);
void sflphone_current (callable_obj_t * c);
/**
* The callee has hung up
* @param c The current call
*/
void sflphone_hung_up( callable_obj_t * c);
void sflphone_hung_up (callable_obj_t * c);
/**
* 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
......@@ -154,26 +154,26 @@ void sflphone_incoming_call ( callable_obj_t * c);
* @param keyval The unique int representing 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
* @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
* 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
* the settings for the ip2ip profile.
* the settings for the ip2ip profile.
*/
void sflphone_get_ip2ip_properties (GHashTable **properties);
/**
* Initialize the accounts data structure
*/
......@@ -210,95 +210,95 @@ void sflphone_save_history (void);
/**
* 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
*/
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
*/
void sflphone_detach_participant(const gchar* callID);
void sflphone_detach_participant (const gchar* callID);
/**
* 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.
* @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
* is not secured
*/
/**
* Nofity that the communication is
/**
* Nofity that the communication is
* now secured using ZRTP.
* @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
* unsecured.
* @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
* and is ready to be displayed.
* @param c* The current call
* @param sas* The Short Authentication String
* @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
* @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.
* @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.
* @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);
/**
* Called when user wants to clear.
* @param c* The call on which to go clear
*/
void sflphone_request_go_clear(void);
void sflphone_request_go_clear (void);
/**
* Called when the UI needs to be refreshed to
/**
* Called when the UI needs to be refreshed to
* better inform the user about the current
* state of the call.
* state of the call.
* @param c A pointer to the call that needs to be updated
* @param description A textual description of the code
* @param code The status code as in SIP or IAX
*/
void sflphone_call_state_changed(callable_obj_t * c, const gchar * description, const guint code);
void sflphone_call_state_changed (callable_obj_t * c, const gchar * description, const guint code);
/**
* Resolve an interface address given its name
*/
void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr, int size);
void sflphone_get_interface_addr_from_name (char *iface_name, char **iface_addr, int size);
#endif
This diff is collapsed.
......@@ -40,33 +40,30 @@
* @enum history_state
* This enum have all the state a call can take in the history
*/
typedef enum
{
MISSED,
INCOMING,
OUTGOING
typedef enum {
MISSED,
INCOMING,
OUTGOING
} history_state_t;
/**
* @enum contact_type
* This enum have all types of contacts: HOME phone, cell phone, etc...
*/
typedef enum
{
CONTACT_PHONE_HOME,
CONTACT_PHONE_BUSINESS,
CONTACT_PHONE_MOBILE
typedef enum {
CONTACT_PHONE_HOME,
CONTACT_PHONE_BUSINESS,
CONTACT_PHONE_MOBILE
} contact_type_t;
/**
* @enum callable_obj_type
* This enum have all types of items
*/
typedef enum
{
CALL,
HISTORY_ENTRY,
CONTACT
typedef enum {
CALL,
HISTORY_ENTRY,
CONTACT
} callable_type_t;
......@@ -74,16 +71,16 @@ typedef enum
* This enum have all the states a call can take.
*/
typedef enum {
CALL_STATE_INVALID = 0,
CALL_STATE_INCOMING,
CALL_STATE_RINGING,
CALL_STATE_CURRENT,
CALL_STATE_DIALING,
CALL_STATE_HOLD,
CALL_STATE_FAILURE,
CALL_STATE_BUSY,
CALL_STATE_TRANSFERT,
CALL_STATE_RECORD,
CALL_STATE_INVALID = 0,
CALL_STATE_INCOMING,
CALL_STATE_RINGING,
CALL_STATE_CURRENT,
CALL_STATE_DIALING,
CALL_STATE_HOLD,
CALL_STATE_FAILURE,
CALL_STATE_BUSY,
CALL_STATE_TRANSFERT,
CALL_STATE_RECORD,
} call_state_t;
typedef enum {
......@@ -104,19 +101,19 @@ typedef struct {
callable_type_t _type; // CALL - HISTORY ENTRY - CONTACT
call_state_t _state; // The state of the call
int _state_code; // The numeric state code as defined in SIP or IAX
gchar* _state_code_description; // A textual description of _state_code
gchar* _state_code_description; // A textual description of _state_code
gchar* _callID; // The call ID
gchar* _confID; // The conference ID (NULL if don't participate to a conference)
gchar* _accountID; // The account the call is made with
time_t _time_start; // The timestamp the call was initiating
time_t _time_stop; // The timestamp the call was over
history_state_t _history_state; // The history state if necessary
srtp_state_t _srtp_state; // The state of security on the call
srtp_state_t _srtp_state; // The state of security on the call
gchar* _srtp_cipher; // Cipher used for the srtp session
gchar* _sas; // The Short Authentication String that should be displayed
gboolean _zrtp_confirmed; // Override real state. Used for hold/unhold
// since rtp session is killed each time and
// libzrtpcpp does not remember state (yet?)
gboolean _zrtp_confirmed; // Override real state. Used for hold/unhold
// since rtp session is killed each time and
// libzrtpcpp does not remember state (yet?)
/**
* The information about the person we are talking
*/
......@@ -137,8 +134,8 @@ typedef struct {
* The thumbnail, if callable_obj_type=CONTACT
*/
GdkPixbuf *_contact_thumbnail;
/**
/**
* Maintains a list of error dialogs
* associated with that call so that
* they could be destroyed at the right
......@@ -160,26 +157,26 @@ void create_new_call_from_details (const gchar *, GHashTable *, callable_obj_t *
void create_history_entry_from_serialized_form (gchar *, gchar *, callable_obj_t **);
void call_add_error(callable_obj_t * call, gpointer dialog);
void call_add_error (callable_obj_t * call, gpointer dialog);
void call_remove_error(callable_obj_t * call, gpointer dialog);
void call_remove_error (callable_obj_t * call, gpointer dialog);
void call_remove_all_errors(callable_obj_t * call);
void call_remove_all_errors (callable_obj_t * call);
/*
* GCompareFunc to compare a callID (gchar* and a callable_obj_t)
/*
* GCompareFunc to compare a callID (gchar* and a callable_obj_t)
*/
gint is_callID_callstruct ( gconstpointer, gconstpointer);
gint is_callID_callstruct (gconstpointer, gconstpointer);
/*
* GCompareFunc to get current call (gchar* and a callable_obj_t)
/*
* GCompareFunc to get current call (gchar* and a callable_obj_t)
*/
gint get_state_callstruct ( gconstpointer, gconstpointer);
gint get_state_callstruct (gconstpointer, gconstpointer);
/**