Commit d4a07fc0 authored by Julien Bonjean's avatar Julien Bonjean
Browse files

Implemented addressbook list server side

parent 7078337d
......@@ -81,6 +81,8 @@ public:
register_method(ConfigurationManager_adaptor, isStunEnabled, _isStunEnabled_stub);
register_method(ConfigurationManager_adaptor, getAddressbookSettings, _getAddressbookSettings_stub);
register_method(ConfigurationManager_adaptor, setAddressbookSettings, _setAddressbookSettings_stub);
register_method(ConfigurationManager_adaptor, getAddressbookList, _getAddressbookList_stub);
register_method(ConfigurationManager_adaptor, setAddressbookList, _setAddressbookList_stub);
register_method(ConfigurationManager_adaptor, getHookSettings, _getHookSettings_stub);
register_method(ConfigurationManager_adaptor, setHookSettings, _setHookSettings_stub);
}
......@@ -387,6 +389,16 @@ public:
{ "settings", "a{si}", true },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument getAddressbookList_args[] =
{
{ "settings", "as", false },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument setAddressbookList_args[] =
{
{ "settings", "as", true },
{ 0, 0, 0 }
};
static ::DBus::IntrospectedArgument getHookSettings_args[] =
{
{ "settings", "a{ss}", false },
......@@ -474,6 +486,8 @@ public:
{ "isStunEnabled", isStunEnabled_args },
{ "getAddressbookSettings", getAddressbookSettings_args },
{ "setAddressbookSettings", setAddressbookSettings_args },
{ "getAddressbookList", getAddressbookList_args },
{ "setAddressbookList", setAddressbookList_args },
{ "getHookSettings", getHookSettings_args },
{ "setHookSettings", setHookSettings_args },
{ 0, 0 }
......@@ -571,6 +585,8 @@ public:
virtual int32_t isStunEnabled() = 0;
virtual std::map< std::string, int32_t > getAddressbookSettings() = 0;
virtual void setAddressbookSettings(const std::map< std::string, int32_t >& settings) = 0;
virtual std::vector< std::string > getAddressbookList() = 0;
virtual void setAddressbookList(const std::vector< std::string >& settings) = 0;
virtual std::map< std::string, std::string > getHookSettings() = 0;
virtual void setHookSettings(const std::map< std::string, std::string >& settings) = 0;
......@@ -1181,6 +1197,25 @@ private:
::DBus::ReturnMessage reply(call);
return reply;
}
::DBus::Message _getAddressbookList_stub(const ::DBus::CallMessage &call)
{
::DBus::MessageIter ri = call.reader();
std::vector< std::string > argout1 = getAddressbookList();
::DBus::ReturnMessage reply(call);
::DBus::MessageIter wi = reply.writer();
wi << argout1;
return reply;
}
::DBus::Message _setAddressbookList_stub(const ::DBus::CallMessage &call)
{
::DBus::MessageIter ri = call.reader();
std::vector< std::string > argin1; ri >> argin1;
setAddressbookList(argin1);
::DBus::ReturnMessage reply(call);
return reply;
}
::DBus::Message _getHookSettings_stub(const ::DBus::CallMessage &call)
{
::DBus::MessageIter ri = call.reader();
......
......@@ -251,6 +251,15 @@
<arg type="a{si}" name="settings" direction="in"/>
</method>
<!-- Addressbook list -->
<method name="getAddressbookList">
<arg type="as" name="settings" direction="out"/>
</method>
<method name="setAddressbookList">
<arg type="as" name="settings" direction="in"/>
</method>
<!-- Hook configuration -->
<method name="getHookSettings">
<arg type="a{ss}" name="settings" direction="out"/>
......
......@@ -3,17 +3,17 @@
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@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.
......@@ -33,27 +33,27 @@ const char* ConfigurationManager::SERVER_PATH = "/org/sflphone/SFLphone/Configur
{
}
std::map< std::string, std::string >
std::map< std::string, std::string >
ConfigurationManager::getAccountDetails( const std::string& accountID )
{
return Manager::instance().getAccountDetails(accountID);
}
void
ConfigurationManager::setAccountDetails( const std::string& accountID,
void
ConfigurationManager::setAccountDetails( const std::string& accountID,
const std::map< std::string, std::string >& details )
{
_debug("ConfigurationManager::setAccountDetails received\n");
Manager::instance().setAccountDetails(accountID, details);
}
void
void
ConfigurationManager::sendRegister( const std::string& accountID, const int32_t& expire )
{
Manager::instance().sendRegister(accountID, expire);
}
void
void
ConfigurationManager::addAccount( const std::map< std::string, std::string >& details )
{
_debug("ConfigurationManager::addAccount received\n");
......@@ -61,14 +61,14 @@ ConfigurationManager::addAccount( const std::map< std::string, std::string >& de
}
void
void
ConfigurationManager::removeAccount( const std::string& accoundID )
{
_debug("ConfigurationManager::removeAccount received\n");
return Manager::instance().removeAccount(accoundID);
}
std::vector< std::string >
std::vector< std::string >
ConfigurationManager::getAccountList( )
{
_debug("ConfigurationManager::getAccountList received\n");
......@@ -76,7 +76,7 @@ ConfigurationManager::getAccountList( )
}
std::vector< std::string >
std::vector< std::string >
ConfigurationManager::getToneLocaleList( )
{
std::vector< std::string > ret;
......@@ -86,7 +86,7 @@ ConfigurationManager::getToneLocaleList( )
std::string
std::string
ConfigurationManager::getVersion( )
{
std::string ret("");
......@@ -96,7 +96,7 @@ ConfigurationManager::getVersion( )
}
std::vector< std::string >
std::vector< std::string >
ConfigurationManager::getRingtoneList( )
{
std::vector< std::string > ret;
......@@ -106,28 +106,28 @@ ConfigurationManager::getRingtoneList( )
std::vector< std::string >
std::vector< std::string >
ConfigurationManager::getCodecList( )
{
_debug("ConfigurationManager::getCodecList received\n");
return Manager::instance().getCodecList();
}
std::vector< std::string >
std::vector< std::string >
ConfigurationManager::getCodecDetails( const int32_t& payload )
{
_debug("ConfigurationManager::getCodecList received\n");
return Manager::instance().getCodecDetails( payload );
}
std::vector< std::string >
std::vector< std::string >
ConfigurationManager::getActiveCodecList( )
{
_debug("ConfigurationManager::getActiveCodecList received\n");
return Manager::instance().getActiveCodecList();
}
void
void
ConfigurationManager::setActiveCodecList( const std::vector< std::string >& list )
{
_debug("ConfigurationManager::setActiveCodecList received\n");
......@@ -200,7 +200,7 @@ ConfigurationManager::getAudioDeviceIndex(const std::string& name)
return Manager::instance().getAudioDeviceIndex(name);
}
std::string
std::string
ConfigurationManager::getCurrentAudioOutputPlugin( void )
{
_debug("ConfigurationManager::getCurrentAudioOutputPlugin received\n");
......@@ -208,7 +208,7 @@ ConfigurationManager::getCurrentAudioOutputPlugin( void )
}
std::vector< std::string >
std::vector< std::string >
ConfigurationManager::getPlaybackDeviceList( )
{
std::vector< std::string > ret;
......@@ -216,7 +216,7 @@ ConfigurationManager::getPlaybackDeviceList( )
return ret;
}
std::vector< std::string >
std::vector< std::string >
ConfigurationManager::getRecordDeviceList( )
{
std::vector< std::string > ret;
......@@ -228,31 +228,31 @@ ConfigurationManager::getRecordDeviceList( )
int32_t
ConfigurationManager::isIax2Enabled( void )
{
return Manager::instance().isIax2Enabled( );
return Manager::instance().isIax2Enabled( );
}
void
ConfigurationManager::ringtoneEnabled( void )
{
Manager::instance().ringtoneEnabled( );
Manager::instance().ringtoneEnabled( );
}
int32_t
ConfigurationManager::isRingtoneEnabled( void )
{
return Manager::instance().isRingtoneEnabled( );
return Manager::instance().isRingtoneEnabled( );
}
std::string
ConfigurationManager::getRingtoneChoice( void )
{
return Manager::instance().getRingtoneChoice( );
return Manager::instance().getRingtoneChoice( );
}
void
ConfigurationManager::setRingtoneChoice( const std::string& tone )
{
Manager::instance().setRingtoneChoice( tone );
Manager::instance().setRingtoneChoice( tone );
}
std::string
......@@ -270,136 +270,136 @@ ConfigurationManager::setRecordPath( const std::string& recPath)
int32_t
ConfigurationManager::getDialpad( void )
{
return Manager::instance().getDialpad( );
return Manager::instance().getDialpad( );
}
void
ConfigurationManager::setDialpad( void )
{
Manager::instance().setDialpad( );
Manager::instance().setDialpad( );
}
int32_t
ConfigurationManager::getSearchbar( void )
{
return Manager::instance().getSearchbar( );
return Manager::instance().getSearchbar( );
}
void
ConfigurationManager::setSearchbar( void )
{
Manager::instance().setSearchbar( );
Manager::instance().setSearchbar( );
}
int32_t
ConfigurationManager::getVolumeControls( void )
{
return Manager::instance().getVolumeControls( );
return Manager::instance().getVolumeControls( );
}
void
ConfigurationManager::setVolumeControls( void )
{
Manager::instance().setVolumeControls( );
Manager::instance().setVolumeControls( );
}
int32_t
ConfigurationManager::getMaxCalls( void )
{
return Manager::instance().getMaxCalls( );
return Manager::instance().getMaxCalls( );
}
void
ConfigurationManager::setMaxCalls( const int32_t& calls )
{
Manager::instance().setMaxCalls( calls );
Manager::instance().setMaxCalls( calls );
}
void
ConfigurationManager::startHidden( void )
{
Manager::instance().startHidden( );
Manager::instance().startHidden( );
}
int32_t
ConfigurationManager::isStartHidden( void )
{
return Manager::instance().isStartHidden( );
return Manager::instance().isStartHidden( );
}
void
ConfigurationManager::switchPopupMode( void )
{
Manager::instance().switchPopupMode( );
Manager::instance().switchPopupMode( );
}
int32_t
ConfigurationManager::popupMode( void )
{
return Manager::instance().popupMode( );
return Manager::instance().popupMode( );
}
void
ConfigurationManager::setNotify( void )
{
_debug("Manager received setNotify\n");
Manager::instance().setNotify( );
Manager::instance().setNotify( );
}
int32_t
ConfigurationManager::getNotify( void )
{
_debug("Manager received getNotify\n");
return Manager::instance().getNotify( );
return Manager::instance().getNotify( );
}
void
ConfigurationManager::setAudioManager( const int32_t& api )
{
_debug("Manager received setAudioManager\n");
Manager::instance().setAudioManager( api );
Manager::instance().setAudioManager( api );
}
int32_t
ConfigurationManager::getAudioManager( void )
{
_debug("Manager received getAudioManager\n");
return Manager::instance().getAudioManager( );
return Manager::instance().getAudioManager( );
}
void
ConfigurationManager::setMailNotify( void )
{
_debug("Manager received setMailNotify\n");
Manager::instance().setMailNotify( );
Manager::instance().setMailNotify( );
}
int32_t
ConfigurationManager::getMailNotify( void )
{
_debug("Manager received getMailNotify\n");
return Manager::instance().getMailNotify( );
return Manager::instance().getMailNotify( );
}
int32_t
int32_t
ConfigurationManager::getPulseAppVolumeControl( void )
{
return Manager::instance().getPulseAppVolumeControl();
}
void
void
ConfigurationManager::setPulseAppVolumeControl( void )
{
Manager::instance().setPulseAppVolumeControl();
}
int32_t
int32_t
ConfigurationManager::getSipPort( void )
{
return Manager::instance().getSipPort();
}
void
void
ConfigurationManager::setSipPort( const int32_t& portNum )
{
_debug("Manager received setSipPort: %d\n", portNum);
......@@ -410,7 +410,7 @@ std::string ConfigurationManager::getStunServer( void )
{
return Manager::instance().getStunServer();
}
void ConfigurationManager::setStunServer( const std::string& server )
{
Manager::instance().setStunServer( server );
......@@ -434,6 +434,14 @@ void ConfigurationManager::setAddressbookSettings (const std::map<std::string, i
Manager::instance().setAddressbookSettings (settings);
}
std::vector< std::string > ConfigurationManager::getAddressbookList ( void ) {
return Manager::instance().getAddressbookList();
}
void ConfigurationManager::setAddressbookList( const std::vector< std::string >& list ) {
Manager::instance().setAddressbookList(list);
}
std::map<std::string,std::string> ConfigurationManager::getHookSettings (void) {
return Manager::instance().getHookSettings ();
}
......
......@@ -4,29 +4,29 @@
* Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@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 CONFIGURATIONMANAGER_H
#define CONFIGURATIONMANAGER_H
#include "configurationmanager-glue.h"
#include <dbus-c++/dbus.h>
class ConfigurationManager
: public org::sflphone::SFLphone::ConfigurationManager_adaptor,
public DBus::IntrospectableAdaptor,
......@@ -45,12 +45,12 @@ public:
void removeAccount( const std::string& accoundID );
std::vector< std::string > getAccountList( );
void sendRegister( const std::string& accoundID , const int32_t& expire );
std::vector< std::string > getCodecList( );
std::vector< std::string > getCodecDetails( const int32_t& payload );
std::vector< std::string > getActiveCodecList( );
void setActiveCodecList( const std::vector< std::string >& list );
std::vector< std::string > getInputAudioPluginList();
std::vector< std::string > getOutputAudioPluginList();
void setInputAudioPlugin(const std::string& audioPlugin);
......@@ -63,14 +63,14 @@ public:
int32_t getAudioDeviceIndex(const std::string& name);
std::string getCurrentAudioOutputPlugin( void );
std::vector< std::string > getToneLocaleList( );
std::vector< std::string > getPlaybackDeviceList( );
std::vector< std::string > getRecordDeviceList( );
std::string getVersion( );
std::vector< std::string > getRingtoneList( );
int32_t getAudioManager( void );
void setAudioManager( const int32_t& api );
void setAudioManager( const int32_t& api );
int32_t isIax2Enabled( void );
int32_t isRingtoneEnabled( void );
......@@ -106,6 +106,8 @@ public:
std::map<std::string, int32_t> getAddressbookSettings (void);
void setAddressbookSettings (const std::map<std::string, int32_t>& settings);
std::vector< std::string > getAddressbookList ( void );
void setAddressbookList( const std::vector< std::string >& list );
std::map<std::string, std::string> getHookSettings (void);
void setHookSettings (const std::map<std::string, std::string>& settings);
......
This diff is collapsed.
......@@ -163,8 +163,8 @@ class ManagerImpl {
*/
bool refuseCall(const CallID& id);
/**
* Save config to file
/**
* Save config to file
* @return true on success
* false otherwise
*/
......@@ -204,7 +204,7 @@ class ManagerImpl {
bool playTone ();
/**
* Play a special ringtone ( BUSY ) if there's at least one message on the voice mail
* Play a special ringtone ( BUSY ) if there's at least one message on the voice mail
* @return bool True on success
* false otherwise
*/
......@@ -259,14 +259,14 @@ class ManagerImpl {
*/
void startVoiceMessageNotification(const AccountID& accountId, int nb_msg);
/**
* Notify the client through DBus that registration state has been updated
/**
* Notify the client through DBus that registration state has been updated
*/
void connectionStatusNotification(void);
/**
* ConfigurationManager - Send registration request
* @param accountId The account to register/unregister
* @param accountId The account to register/unregister
* @param expire The flag for the type of registration
* 0 for unregistration request
* 1 for registration request
......@@ -275,8 +275,8 @@ class ManagerImpl {
bool getCallStatus(const std::string& sequenceId);
/**
* Get account list
/**
* Get account list
* @return std::vector<std::string> A list of accoundIDs
*/
std::vector< std::string > getAccountList();
......@@ -295,7 +295,7 @@ class ManagerImpl {
* @param accountID The account identifier
* @param details The account parameters
*/
void setAccountDetails( const ::std::string& accountID,
void setAccountDetails( const ::std::string& accountID,
const std::map< ::std::string, ::std::string >& details );
/**
......@@ -314,7 +314,7 @@ class ManagerImpl {
/**
* Get the list of codecs we supports, not ordered
* @return The list of the codecs
*/
*/
std::vector< ::std::string > getCodecList( void );
/**
......@@ -345,13 +345,13 @@ class ManagerImpl {
std::vector< std::string> getOutputAudioPluginList(void);
/**
* Set input audio plugin
* Set input audio plugin
* @param audioPlugin The audio plugin
*/
void setInputAudioPlugin(const std::string& audioPlugin);
/**
* Set output audio plugin
* Set output audio plugin
* @param audioPlugin The audio plugin
*/
void setOutputAudioPlugin(const std::string& audioPlugin);
......@@ -397,7 +397,7 @@ class ManagerImpl {
* Get current alsa plugin
* @return std::string The Alsa plugin
*/
std::string getCurrentAudioOutputPlugin( void );
std::string getCurrentAudioOutputPlugin( void );
/**
* Convert a list of payload in a special format, readable by the server.
......@@ -406,29 +406,31 @@ class ManagerImpl {
*/