configurationmanager.h 6.57 KB
Newer Older
1
/*
2
 *  Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
3
 *  Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
4
 *  Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
5
 *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
6
 *  Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com>
7
 *
8 9
 *  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
10
 *  the Free Software Foundation; either version 3 of the License, or
11
 *  (at your option) any later version.
12
 *
13 14 15 16
 *  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.
17
 *
18 19 20
 *  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.
21 22 23 24 25 26 27 28 29 30 31
 *
 *  Additional permission under GNU GPL version 3 section 7:
 *
 *  If you modify this program, or any covered work, by linking or
 *  combining it with the OpenSSL project's OpenSSL library (or a
 *  modified version of that library), containing parts covered by the
 *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
 *  grants you additional permission to convey the resulting work.
 *  Corresponding Source for a non-source form of such a combination
 *  shall include the source code for the parts of OpenSSL used as well
 *  as that of the covered work.
32
 */
33

34 35 36
#ifndef CONFIGURATIONMANAGER_H
#define CONFIGURATIONMANAGER_H

Julien Bonjean's avatar
Julien Bonjean committed
37 38
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
39
#include "configurationmanager-glue.h"
Julien Bonjean's avatar
Julien Bonjean committed
40 41 42
#pragma GCC diagnostic error "-Wignored-qualifiers"
#pragma GCC diagnostic error "-Wunused-parameter"

43 44
#include <dbus-c++/dbus.h>

45

46
class ConfigurationManager
47
: public org::sflphone::SFLphone::ConfigurationManager_adaptor,
48 49 50 51 52 53 54 55
  public DBus::IntrospectableAdaptor,
  public DBus::ObjectAdaptor
{
public:

    ConfigurationManager(DBus::Connection& connection);
    static const char* SERVER_PATH;

56 57 58
private:
    std::vector<std::string> shortcutsKeys;

59 60
public:

61 62
    std::map< std::string, std::string > getAccountDetails( const std::string& accountID );
    void setAccountDetails( const std::string& accountID, const std::map< std::string, std::string >& details );
63
    std::string addAccount( const std::map< std::string, std::string >& details );
64
    void removeAccount( const std::string& accoundID );
65
    void deleteAllCredential (const std::string& accountID);
66 67
    std::vector< std::string > getAccountList(  );
    void sendRegister(  const std::string& accoundID , const int32_t& expire );
68

69
    std::map< std::string, std::string > getTlsSettingsDefault (void);
70 71
    void setIp2IpDetails(const std::map< std::string, std::string >& details);
    std::map< std::string, std::string > getIp2IpDetails(void);
72 73 74 75
    std::map< std::string, std::string > getCredential (const std::string& accountID, const int32_t& index);
    int32_t getNumberOfCredential (const std::string& accountID);
    void setCredential (const std::string& accountID, const int32_t& index, const std::map< std::string, std::string >& details);

76 77
    std::vector< std::string > getCodecList(void);
    std::vector< std::string > getSupportedTlsMethod(void);
78
    std::vector< std::string > getCodecDetails( const int32_t& payload );
79
    std::vector< std::string > getActiveCodecList (const std::string& accountID);
80
    void setActiveCodecList (const std::vector< std::string >& list, const std::string& accountID);
81

82
    std::vector< std::string > getAudioPluginList();
83 84 85 86 87
    void setInputAudioPlugin(const std::string& audioPlugin);
    void setOutputAudioPlugin(const std::string& audioPlugin);
    std::vector< std::string > getAudioOutputDeviceList();
    void setAudioOutputDevice(const int32_t& index);
    void setAudioInputDevice(const int32_t& index);
88 89
    void setAudioRingtoneDevice(const int32_t& index);
    std::vector< std::string > getAudioInputDeviceList();
90 91 92
    std::vector< std::string > getCurrentAudioDevicesIndex();
    int32_t getAudioDeviceIndex(const std::string& name);
    std::string getCurrentAudioOutputPlugin( void );
93 94 95 96
    std::string getEchoCancelState(void);
    void setEchoCancelState(const std::string& state);
    std::string getNoiseSuppressState(void);
    void setNoiseSuppressState(const std::string& state);
97

98

99 100 101 102 103 104
    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 );
105
    void setAudioManager( const int32_t& api );
106

107 108
    bool isMd5CredentialHashing (void);
    void setMd5CredentialHashing (const bool& enabled);
109
    int32_t isIax2Enabled( void );
110 111 112 113
    int32_t isRingtoneEnabled( const std::string& accountID );
    void ringtoneEnabled( const std::string& accountID );
    std::string getRingtoneChoice( const std::string& accountID );
    void setRingtoneChoice( const std::string& accountID, const std::string& tone );
114 115
    std::string getRecordPath( void );
    void setRecordPath(const std::string& recPath );
116

117 118 119 120
    
    void setHistoryLimit( const int32_t& days);
    int32_t getHistoryLimit (void);
    
121
    int32_t getMailNotify( void );
122
    void setMailNotify( void );
123

124

125 126
    std::map<std::string, int32_t> getAddressbookSettings (void);
    void setAddressbookSettings (const std::map<std::string, int32_t>& settings);
127 128
    std::vector< std::string > getAddressbookList ( void );
    void setAddressbookList( const std::vector< std::string >& list );
129

130
    void setAccountsOrder (const std::string& order);
131

132 133
    std::map<std::string, std::string> getHookSettings (void);
    void setHookSettings (const std::map<std::string, std::string>& settings);
134 135 136
    
    std::map <std::string, std::string> getHistory (void);
    void setHistory (const std::map <std::string, std::string>& entries);
137

Julien Bonjean's avatar
Julien Bonjean committed
138 139
    std::map<std::string, std::string> getTlsSettings(void);
    void setTlsSettings(const std::map< std::string, std::string >& details);
140 141

    std::string getAddrFromInterfaceName(const std::string& interface);
142 143
    
    std::vector<std::string> getAllIpInterface(void);
144
    std::vector<std::string> getAllIpInterfaceByName(void);
145

146 147
    std::map< std::string, std::string > getShortcuts ();
    void setShortcuts (const std::map< std::string, std::string >& shortcutsMap);
148 149 150 151
};


#endif//CONFIGURATIONMANAGER_H