diff options
author | Alberto Mardegan <mardy@users.sourceforge.net> | 2008-03-07 15:06:39 +0000 |
---|---|---|
committer | Alberto Mardegan <mardy@users.sourceforge.net> | 2008-03-07 15:06:39 +0000 |
commit | 44512f518acc272e72ed4350922a44a429fb60c8 (patch) | |
tree | 5e765dee4ae2f8d9b04eb4a1c7672b62c7e417b6 | |
parent | aaa0f8f16e771b9c8977664b920ba093b24c25c5 (diff) |
Stub implementation of McdAccount and McdAccountManager.
Reorganize the xml tree.
git-svn-id: https://mission-control.svn.sourceforge.net/svnroot/mission-control/trunk@302 d91c8aed-3f2b-0410-a83d-924a1c20a0ba
-rw-r--r-- | src/Makefile.am | 7 | ||||
-rw-r--r-- | src/mcd-account-manager.c | 100 | ||||
-rw-r--r-- | src/mcd-account-priv.h | 49 | ||||
-rw-r--r-- | src/mcd-account.c | 101 | ||||
-rw-r--r-- | xml/Makefile.am | 1 | ||||
-rw-r--r-- | xml/all.xml | 3 | ||||
-rw-r--r-- | xml/nmc5.xml | 10 |
7 files changed, 267 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index df854c8c..9d9808ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,7 +32,7 @@ nodist_geninclude_HEADERS = \ _gen/svc-Account.h \ _gen/svc-Account_Manager.h -nodist_mission_control_server_la_SOURCES = \ +nodist_libmissioncontrol_server_la_SOURCES = \ _gen/gtypes-body.h \ _gen/interfaces-body.h \ _gen/register-dbus-glib-marshallers-body.h \ @@ -45,6 +45,7 @@ nodist_mission_control_server_la_SOURCES = \ mission_control_include_HEADERS = \ $(mission_control_include) \ + mcd-account-priv.h \ mcd-enum-types.h BUILT_SOURCES = \ @@ -55,7 +56,7 @@ BUILT_SOURCES = \ mcd-enum-types.c \ mcd-enum-types.h \ stamp-mcd-enum-types.h \ - $(nodist_mission_control_server_la_SOURCES) \ + $(nodist_libmissioncontrol_server_la_SOURCES) \ $(nodist_geninclude_HEADERS) CLEANFILES = $(BUILT_SOURCES) @@ -70,6 +71,8 @@ libmissioncontrol_server_la_LDFLAGS = -export-dynamic \ -version-info 3:10:2 libmissioncontrol_server_la_SOURCES = \ + mcd-account.c \ + mcd-account-manager.c \ mcd-debug.c \ mcd-enum-types.c \ mcd-signals-marshal.c \ diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c new file mode 100644 index 00000000..aff7261d --- /dev/null +++ b/src/mcd-account-manager.c @@ -0,0 +1,100 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 8 -*- */ +/* + * This file is part of mission-control + * + * Copyright (C) 2007 Nokia Corporation. + * + * Contact: Naba Kumar <naba.kumar@nokia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + +#include <glib/gi18n.h> +#include <config.h> + +#include "mcd-account-manager.h" +#include "mcd-account.h" +#include "mcd-account-priv.h" + +#define MCD_ACCOUNT_MANAGER_PRIV(account_manager) \ + (MCD_ACCOUNT_MANAGER (account_manager)->priv) + +static void account_manager_iface_init (McSvcAccountManagerClass *iface, + gpointer iface_data); + +G_DEFINE_TYPE_WITH_CODE (McdAccountManager, mcd_account_manager, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (MC_TYPE_SVC_ACCOUNT_MANAGER, + account_manager_iface_init); + ) + +struct _McdAccountManagerPrivate +{ +}; + +enum +{ + PROP_0, +}; + + +static void +account_manager_iface_init (McSvcAccountManagerClass *iface, + gpointer iface_data) +{ +} + +static void +_mcd_account_manager_finalize (GObject *object) +{ + G_OBJECT_CLASS (mcd_account_manager_parent_class)->finalize (object); +} + +static void +_mcd_account_manager_dispose (GObject *object) +{ + G_OBJECT_CLASS (mcd_account_manager_parent_class)->dispose (object); +} + +static void +mcd_account_manager_class_init (McdAccountManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + g_type_class_add_private (object_class, sizeof (McdAccountManagerPrivate)); + + object_class->dispose = _mcd_account_manager_dispose; + object_class->finalize = _mcd_account_manager_finalize; +} + +static void +mcd_account_manager_init (McdAccountManager *account_manager) +{ + McdAccountManagerPrivate *priv; + + priv = G_TYPE_INSTANCE_GET_PRIVATE ((account_manager), + MCD_TYPE_ACCOUNT_MANAGER, + McdAccountManagerPrivate); + account_manager->priv = priv; +} + +McdAccountManager * +mcd_account_manager_new (void) +{ + gpointer *obj; + + obj = g_object_new (MCD_TYPE_ACCOUNT_MANAGER, NULL); + return MCD_ACCOUNT_MANAGER (obj); +} + diff --git a/src/mcd-account-priv.h b/src/mcd-account-priv.h new file mode 100644 index 00000000..ca479fa7 --- /dev/null +++ b/src/mcd-account-priv.h @@ -0,0 +1,49 @@ +/* + * This file is part of mission-control + * + * Copyright (C) 2007 Nokia Corporation. + * + * Contact: Naba Kumar <naba.kumar@nokia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + +#ifndef __MCD_ACCOUNT_PRIV_H__ +#define __MCD_ACCOUNT_PRIV_H__ + +#define MC_ACCOUNTS_KEY_MANAGER "manager" +#define MC_ACCOUNTS_KEY_PROTOCOL "protocol" +#define MC_ACCOUNTS_KEY_PRESETS "presets" +#define MC_ACCOUNTS_KEY_GROUPS "groups" +#define MC_ACCOUNTS_KEY_DISPLAY_NAME "display_name" +#define MC_ACCOUNTS_KEY_ICON_NAME "icon_name" +#define MC_ACCOUNTS_KEY_NORMALIZED_NAME "normalized_name" +#define MC_ACCOUNTS_KEY_ENABLED "enabled" +#define MC_ACCOUNTS_KEY_DELETED "deleted" +#define MC_ACCOUNTS_KEY_PROFILE "profile" +#define MC_ACCOUNTS_KEY_PARAM_ACCOUNT "account" +#define MC_ACCOUNTS_KEY_AVATAR_TOKEN "avatar_token" +#define MC_ACCOUNTS_KEY_AVATAR_MIME "avatar_mime" +#define MC_ACCOUNTS_KEY_AVATAR_ID "avatar_id" +#define MC_ACCOUNTS_KEY_DATA_DIR "data_dir" +#define MC_ACCOUNTS_KEY_ALIAS "alias" +#define MC_ACCOUNTS_KEY_SECONDARY_VCARD_FIELDS "secondary_vcard_fields" + +#define PRESETS_GROUP "Presets" +#define PRESETS_GROUP_DEFAULTS "Defaults" + +#endif /* __MCD_ACCOUNT_PRIV_H__ */ + diff --git a/src/mcd-account.c b/src/mcd-account.c new file mode 100644 index 00000000..f4c324fb --- /dev/null +++ b/src/mcd-account.c @@ -0,0 +1,101 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 8 -*- */ +/* + * This file is part of mission-control + * + * Copyright (C) 2008 Nokia Corporation. + * + * Contact: Alberto Mardegan <alberto.mardegan@nokia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + +#include <stdio.h> +#include <glib/gi18n.h> +#include <config.h> + +#include "mcd-account.h" +#include "mcd-account-priv.h" +#include "mcd-account-manager.h" + +#define MCD_ACCOUNT_PRIV(account) (MCD_ACCOUNT (account)->priv) + +static void account_iface_init (McSvcAccountClass *iface, + gpointer iface_data); + +G_DEFINE_TYPE_WITH_CODE (McdAccount, mcd_account, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (MC_TYPE_SVC_ACCOUNT, + account_iface_init); + ) + +struct _McdAccountPrivate +{ +}; + +enum +{ + PROP_0, +}; + + +static void +account_iface_init (McSvcAccountClass *iface, gpointer iface_data) +{ +} + +static void +_mcd_account_finalize (GObject *object) +{ + G_OBJECT_CLASS (mcd_account_parent_class)->finalize (object); +} + +static void +_mcd_account_dispose (GObject *object) +{ + G_OBJECT_CLASS (mcd_account_parent_class)->dispose (object); +} + +static void +mcd_account_class_init (McdAccountClass * klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + g_type_class_add_private (object_class, sizeof (McdAccountPrivate)); + + object_class->dispose = _mcd_account_dispose; + object_class->finalize = _mcd_account_finalize; +} + +static void +mcd_account_init (McdAccount *account) +{ + McdAccountPrivate *priv; + + priv = G_TYPE_INSTANCE_GET_PRIVATE ((account), + MCD_TYPE_ACCOUNT, + McdAccountPrivate); + account->priv = priv; +} + +McdAccount * +mcd_account_new (GKeyFile *keyfile, const gchar *name) +{ + gpointer *obj; + obj = g_object_new (MCD_TYPE_ACCOUNT, + "keyfile", keyfile, + "name", name, + NULL); + return MCD_ACCOUNT (obj); +} + diff --git a/xml/Makefile.am b/xml/Makefile.am index a53f7c14..005b4ce8 100644 --- a/xml/Makefile.am +++ b/xml/Makefile.am @@ -21,4 +21,5 @@ clean-local: EXTRA_DIST = \ all.xml \ nmc4.xml \ + nmc5.xml \ $(SPECS) diff --git a/xml/all.xml b/xml/all.xml index 6ecdf36f..6d9c6374 100644 --- a/xml/all.xml +++ b/xml/all.xml @@ -5,8 +5,7 @@ <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright> <xi:include href="nmc4.xml"/> -<xi:include href="Account.xml"/> -<xi:include href="Account_Manager.xml"/> +<xi:include href="nmc5.xml"/> <tp:generic-types> <tp:external-type name="Connection_Presence_Type" type="u" diff --git a/xml/nmc5.xml b/xml/nmc5.xml new file mode 100644 index 00000000..062535f2 --- /dev/null +++ b/xml/nmc5.xml @@ -0,0 +1,10 @@ +<tp:spec + xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" + xmlns:xi="http://www.w3.org/2001/XInclude"> + +<tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright> + +<xi:include href="Account.xml"/> +<xi:include href="Account_Manager.xml"/> + +</tp:spec> |