Skip to content
Snippets Groups Projects
Commit 4daeb9ce authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2006] Add conference_obj structure

parent 94ee9916
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,7 @@ sflphone_client_gnome_SOURCES = \ ...@@ -19,6 +19,7 @@ sflphone_client_gnome_SOURCES = \
menus.c \ menus.c \
toolbar.c \ toolbar.c \
callable_obj.c \ callable_obj.c \
conference_obj.c \
actions.c \ actions.c \
accountlist.c \ accountlist.c \
sliders.c \ sliders.c \
...@@ -28,7 +29,7 @@ sflphone_client_gnome_SOURCES = \ ...@@ -28,7 +29,7 @@ sflphone_client_gnome_SOURCES = \
noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \ noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \
assistant.h reqaccount.h errors.h sflphone_const.h \ assistant.h reqaccount.h errors.h sflphone_const.h \
menus.h accountlist.h sliders.h statusicon.h callable_obj.h toolbar.h menus.h accountlist.h sliders.h statusicon.h callable_obj.h conference_obj.h toolbar.h
sflphone_client_gnome_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(LIBSEXY_LIBS) $(LOG4C) sflphone_client_gnome_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(LIBSEXY_LIBS) $(LOG4C)
......
/*
* Copyright (C) 2009 Savoir-Faire Linux inc.
* Author: Alexandre Savard <alexandre.savard@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.
*/
#include <callable_obj.h>
#include <sflphone_const.h>
#include <time.h>
void create_new_conference (conference_state_t state, gchar* confID, conference_obj_t ** new_conf)
{
conference_obj_t *obj;
gchar *conf_id;
// Allocate memory
obj = g_new0 (conference_obj_t, 1);
// Set state field
obj->_state = state;
// Set the ID field
conf_id = confID;
obj->_confID = g_strdup (conf_id);
*new_conf = obj;
}
void create_new_conference_from_details (const gchar *conf_id, GHashTable *details, conference_obj_t **conf)
{
/*
gchar *peer_name, *peer_number, *accountID, *state_str;
callable_obj_t *new_call;
call_state_t state;
accountID = g_hash_table_lookup (details, "ACCOUNTID");
peer_number = g_hash_table_lookup (details, "PEER_NUMBER");
peer_name = g_strdup ("");
state_str = g_hash_table_lookup (details, "CALL_STATE");
if (g_strcasecmp (state_str, "CURRENT") == 0)
state = CALL_STATE_CURRENT;
else if (g_strcasecmp (state_str, "RINGING") == 0)
state = CALL_STATE_RINGING;
else if (g_strcasecmp (state_str, "INCOMING") == 0)
state = CALL_STATE_INCOMING;
else if (g_strcasecmp (state_str, "HOLD") == 0)
state = CALL_STATE_HOLD;
else if (g_strcasecmp (state_str, "BUSY") == 0)
state = CALL_STATE_BUSY;
else
state = CALL_STATE_FAILURE;
create_new_call (CALL, state, (gchar*)call_id, accountID, peer_name, peer_number, &new_call);
*call = new_call;
*/
}
void free_conference_obj_t (conference_obj_t *c)
{
g_free (c->_confID);
g_free (c);
}
/*
* Copyright (C) 2009 Savoir-Faire Linux inc.
* Author: Alexandre Savard <alexandre.savard@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.
*/
#ifndef __CONFERENCE_OBJ_H__
#define __CONFERENCE_OBJ_H__
#include <gtk/gtk.h>
#include <glib/gprintf.h>
#include <stdlib.h>
#include <time.h>
/** @enum conference_state_t
* This enum have all the states a conference can take.
*/
typedef enum
{
CONFERENCE_STATE_ACTIVE = 0,
CONFERENCE_STATE_HOLD
} conference_state_t;
/** @struct conference_obj_t
* @brief Conference information.
* This struct holds information about a conference.
*/
typedef struct {
conference_state_t _state; // The state of the call
gchar* _confID; // The call ID
} conference_obj_t;
void create_new_conference (conference_state_t, gchar*, conference_obj_t **);
void create_new_conference_from_details (const gchar *, GHashTable *, conference_obj_t **);
void free_conference_obj_t (conference_obj_t *c);
#endif
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <accountlist.h> #include <accountlist.h>
#include <calllist.h> #include <calllist.h>
#include <conferencelist.h> #include <conferencelist.h>
#include <conference_obj.h>
#include <sflnotify.h> #include <sflnotify.h>
/** @file dbus.h /** @file dbus.h
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment