configurationmanager.h 6.35 KB
Newer Older
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
1
/*
2
 *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 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
 *
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
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
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
11
 *  (at your option) any later version.
12
 *
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
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
 *
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
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.
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
32
 */
33

Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
34
35
36
#ifndef CONFIGURATIONMANAGER_H
#define CONFIGURATIONMANAGER_H

37
38
39
40
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif

Julien Bonjean's avatar
Julien Bonjean committed
41
42
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
43
#include "configurationmanager-glue.h"
44
45
#pragma GCC diagnostic warning "-Wignored-qualifiers"
#pragma GCC diagnostic warning "-Wunused-parameter"
Julien Bonjean's avatar
Julien Bonjean committed
46

Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
47
48
49
#include <dbus-c++/dbus.h>

class ConfigurationManager
50
51
52
: public org::sflphone::SFLphone::ConfigurationManager_adaptor,
    public DBus::IntrospectableAdaptor,
    public DBus::ObjectAdaptor
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
53
{
Julien Bonjean's avatar
Julien Bonjean committed
54
55
56
57
58
    private:
        std::vector<std::string> shortcutsKeys;

    public:

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

Julien Bonjean's avatar
Julien Bonjean committed
62
63
64
65
66
67
68
69
70
71
        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);
        std::string addAccount (const std::map< std::string, std::string >& details);
        void removeAccount (const std::string& accoundID);
        void deleteAllCredential (const std::string& accountID);
        std::vector< std::string > getAccountList();
        void sendRegister (const std::string& accoundID , const int32_t& expire);

        std::map< std::string, std::string > getTlsSettingsDefault (void);

72
        std::vector< int32_t > getAudioCodecList (void);
Julien Bonjean's avatar
Julien Bonjean committed
73
        std::vector< std::string > getSupportedTlsMethod (void);
74
75
76
        std::vector< std::string > getAudioCodecDetails (const int32_t& payload);
        std::vector< std::string > getActiveAudioCodecList (const std::string& accountID);
        void setActiveAudioCodecList (const std::vector< std::string >& list, const std::string& accountID);
Julien Bonjean's avatar
Julien Bonjean committed
77
78

        std::vector< std::string > getAudioPluginList();
79
        void setAudioPlugin (const std::string& audioPlugin);
Julien Bonjean's avatar
Julien Bonjean committed
80
81
82
83
84
85
86
87
88
89
        std::vector< std::string > getAudioOutputDeviceList();
        void setAudioOutputDevice (const int32_t& index);
        void setAudioInputDevice (const int32_t& index);
        void setAudioRingtoneDevice (const int32_t& index);
        std::vector< std::string > getAudioInputDeviceList();
        std::vector< std::string > getCurrentAudioDevicesIndex();
        int32_t getAudioDeviceIndex (const std::string& name);
        std::string getCurrentAudioOutputPlugin (void);
        std::string getNoiseSuppressState (void);
        void setNoiseSuppressState (const std::string& state);
90
91
92
93
94
95
        std::string getEchoCancelState(void);
        void setEchoCancelState(const std::string& state);
        void setEchoCancelTailLength(const int32_t& length);
        int getEchoCancelTailLength(void);
        void setEchoCancelDelay(const int32_t& length);
        int getEchoCancelDelay(void);
Julien Bonjean's avatar
Julien Bonjean committed
96

97
98
        std::string getAudioManager (void);
        void setAudioManager (const std::string& api);
Julien Bonjean's avatar
Julien Bonjean committed
99
100
101
102

        int32_t isIax2Enabled (void);
        std::string getRecordPath (void);
        void setRecordPath (const std::string& recPath);
103
104
        bool getIsAlwaysRecording(void);
        void setIsAlwaysRecording(const bool& rec);
Julien Bonjean's avatar
Julien Bonjean committed
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122

        void setHistoryLimit (const int32_t& days);
        int32_t getHistoryLimit (void);

        int32_t getMailNotify (void);
        void setMailNotify (void);


        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);

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

        std::map<std::string, std::string> getHookSettings (void);
        void setHookSettings (const std::map<std::string, std::string>& settings);

123
        std::vector<std::string> getHistory(void);
124
        void setHistory (const std::vector<std::string> &entries);
Julien Bonjean's avatar
Julien Bonjean committed
125
126
127

        std::map<std::string, std::string> getTlsSettings (void);
        void setTlsSettings (const std::map< std::string, std::string >& details);
128
129
130
131
        std::map< std::string, std::string > getIp2IpDetails (void);

        std::vector< std::map< std::string, std::string > > getCredentials (const std::string& accountID);
        void setCredentials (const std::string& accountID, const std::vector< std::map< std::string, std::string > >& details);
Julien Bonjean's avatar
Julien Bonjean committed
132
133
134
135
136
137
138
139

        std::string getAddrFromInterfaceName (const std::string& interface);

        std::vector<std::string> getAllIpInterface (void);
        std::vector<std::string> getAllIpInterfaceByName (void);

        std::map< std::string, std::string > getShortcuts ();
        void setShortcuts (const std::map< std::string, std::string >& shortcutsMap);
Pierre-Luc Beaudoin's avatar
Pierre-Luc Beaudoin committed
140
141
142
143
};


#endif//CONFIGURATIONMANAGER_H