diff --git a/sflphone-client-gnome/src/Makefile.am b/sflphone-client-gnome/src/Makefile.am index b32b86fac2ee9c4e00f0dcbaf2cb3d9b4f25dd63..fe954bd7e5bc9d0e0dd21e72b0acc6a6282b3c92 100644 --- a/sflphone-client-gnome/src/Makefile.am +++ b/sflphone-client-gnome/src/Makefile.am @@ -19,6 +19,7 @@ sflphone_client_gnome_SOURCES = \ menus.c \ toolbar.c \ callable_obj.c \ + conference_obj.c \ actions.c \ accountlist.c \ sliders.c \ @@ -28,7 +29,7 @@ sflphone_client_gnome_SOURCES = \ noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.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) diff --git a/sflphone-client-gnome/src/conference_obj.c b/sflphone-client-gnome/src/conference_obj.c new file mode 100644 index 0000000000000000000000000000000000000000..677e025517cef403e4026e06e38dbddb30cd2149 --- /dev/null +++ b/sflphone-client-gnome/src/conference_obj.c @@ -0,0 +1,83 @@ +/* + * 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); +} diff --git a/sflphone-client-gnome/src/conference_obj.h b/sflphone-client-gnome/src/conference_obj.h new file mode 100644 index 0000000000000000000000000000000000000000..bd22d34046aadbc15cf824777ca0c23e145973e6 --- /dev/null +++ b/sflphone-client-gnome/src/conference_obj.h @@ -0,0 +1,58 @@ +/* + * 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 diff --git a/sflphone-client-gnome/src/dbus/dbus.h b/sflphone-client-gnome/src/dbus/dbus.h index fb5da35a88464f0c1a94f95bee7c3350265b07f4..9a7c0b8d213421fe0b6e4295047955210848faa0 100644 --- a/sflphone-client-gnome/src/dbus/dbus.h +++ b/sflphone-client-gnome/src/dbus/dbus.h @@ -28,6 +28,7 @@ #include <accountlist.h> #include <calllist.h> #include <conferencelist.h> +#include <conference_obj.h> #include <sflnotify.h> /** @file dbus.h