~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

Viewing changes to daemon/src/client/configurationmanager.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2004-2013 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
 *  This program is free software; you can redistribute it and/or modify
 
9
 *  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
 *  This program is distributed in the hope that it will be useful,
 
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
 *  GNU General Public License for more details.
 
17
 *
 
18
 *  You should have received a copy of the GNU General Public License
 
19
 *  along with this program; if not, write to the Free Software
 
20
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
 
21
 *
 
22
 *  Additional permission under GNU GPL version 3 section 7:
 
23
 *
 
24
 *  If you modify this program, or any covered work, by linking or
 
25
 *  combining it with the OpenSSL project's OpenSSL library (or a
 
26
 *  modified version of that library), containing parts covered by the
 
27
 *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
 
28
 *  grants you additional permission to convey the resulting work.
 
29
 *  Corresponding Source for a non-source form of such a combination
 
30
 *  shall include the source code for the parts of OpenSSL used as well
 
31
 *  as that of the covered work.
 
32
 */
 
33
 
 
34
#ifndef CONFIGURATIONMANAGER_H
 
35
#define CONFIGURATIONMANAGER_H
 
36
 
 
37
#ifdef HAVE_CONFIG_H
 
38
#include "config.h"
 
39
#endif
 
40
 
 
41
#if HAVE_DBUS
 
42
 
 
43
#include "dbus/dbus_cpp.h"
 
44
 
 
45
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
 
46
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 
47
#endif
 
48
 
 
49
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
 
50
#pragma GCC diagnostic ignored "-Wunused-parameter"
 
51
#pragma GCC diagnostic ignored "-Weffc++"
 
52
#include "dbus/configurationmanager-glue.h"
 
53
#pragma GCC diagnostic warning "-Wignored-qualifiers"
 
54
#pragma GCC diagnostic warning "-Wunused-parameter"
 
55
#pragma GCC diagnostic warning "-Weffc++"
 
56
 
 
57
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
 
58
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
 
59
#endif
 
60
 
 
61
#else
 
62
// these includes normally come with DBus C++
 
63
#include <vector>
 
64
#include <map>
 
65
#include <string>
 
66
#endif // HAVE_DBUS
 
67
 
 
68
class ConfigurationManager
 
69
#if HAVE_DBUS
 
70
    : public org::sflphone::SFLphone::ConfigurationManager_adaptor,
 
71
    public DBus::IntrospectableAdaptor,
 
72
    public DBus::ObjectAdaptor
 
73
#endif
 
74
{
 
75
    public:
 
76
#if HAVE_DBUS
 
77
        ConfigurationManager(DBus::Connection& connection);
 
78
#else
 
79
        ConfigurationManager();
 
80
#endif
 
81
        std::map< std::string, std::string > getAccountDetails(const std::string& accountID);
 
82
        void setAccountDetails(const std::string& accountID, const std::map< std::string, std::string >& details);
 
83
        std::map<std::string, std::string> getAccountTemplate();
 
84
        std::string addAccount(const std::map< std::string, std::string >& details);
 
85
        void removeAccount(const std::string& accoundID);
 
86
        std::vector< std::string > getAccountList();
 
87
        void sendRegister(const std::string& accoundID, const bool& enable);
 
88
        void registerAllAccounts(void);
 
89
 
 
90
        std::map< std::string, std::string > getTlsSettingsDefault();
 
91
 
 
92
        std::vector< int32_t > getAudioCodecList();
 
93
        std::vector< std::string > getSupportedTlsMethod();
 
94
        std::vector< std::string > getAudioCodecDetails(const int32_t& payload);
 
95
        std::vector< int32_t > getActiveAudioCodecList(const std::string& accountID);
 
96
 
 
97
        void setActiveAudioCodecList(const std::vector< std::string >& list, const std::string& accountID);
 
98
 
 
99
        std::vector< std::string > getAudioPluginList();
 
100
        void setAudioPlugin(const std::string& audioPlugin);
 
101
        std::vector< std::string > getAudioOutputDeviceList();
 
102
        void setAudioOutputDevice(const int32_t& index);
 
103
        void setAudioInputDevice(const int32_t& index);
 
104
        void setAudioRingtoneDevice(const int32_t& index);
 
105
        std::vector< std::string > getAudioInputDeviceList();
 
106
        std::vector< std::string > getCurrentAudioDevicesIndex();
 
107
        int32_t getAudioDeviceIndex(const std::string& name);
 
108
        std::string getCurrentAudioOutputPlugin();
 
109
        bool getNoiseSuppressState();
 
110
        void setNoiseSuppressState(const bool& state);
 
111
 
 
112
        bool isAgcEnabled();
 
113
        void setAgcState(const bool& enabled);
 
114
 
 
115
        void muteDtmf(const bool& mute);
 
116
        bool isDtmfMuted();
 
117
 
 
118
        bool isCaptureMuted();
 
119
        void muteCapture(const bool& mute);
 
120
        bool isPlaybackMuted();
 
121
        void mutePlayback(const bool& mute);
 
122
 
 
123
        std::map<std::string, std::string> getRingtoneList();
 
124
 
 
125
        std::string getAudioManager();
 
126
        void setAudioManager(const std::string& api);
 
127
 
 
128
        int32_t isIax2Enabled();
 
129
        std::string getRecordPath();
 
130
        void setRecordPath(const std::string& recPath);
 
131
        bool getIsAlwaysRecording();
 
132
        void setIsAlwaysRecording(const bool& rec);
 
133
 
 
134
        void setHistoryLimit(const int32_t& days);
 
135
        int32_t getHistoryLimit();
 
136
        void clearHistory();
 
137
 
 
138
        void setAccountsOrder(const std::string& order);
 
139
 
 
140
        std::map<std::string, std::string> getHookSettings();
 
141
        void setHookSettings(const std::map<std::string, std::string>& settings);
 
142
 
 
143
        std::vector<std::map<std::string, std::string> > getHistory();
 
144
 
 
145
        std::map<std::string, std::string> getTlsSettings();
 
146
        void setTlsSettings(const std::map< std::string, std::string >& details);
 
147
        std::map< std::string, std::string > getIp2IpDetails();
 
148
 
 
149
        std::vector< std::map< std::string, std::string > > getCredentials(const std::string& accountID);
 
150
        void setCredentials(const std::string& accountID, const std::vector< std::map< std::string, std::string > >& details);
 
151
 
 
152
        std::string getAddrFromInterfaceName(const std::string& interface);
 
153
 
 
154
        std::vector<std::string> getAllIpInterface();
 
155
        std::vector<std::string> getAllIpInterfaceByName();
 
156
 
 
157
        std::map<std::string, std::string> getShortcuts();
 
158
        void setShortcuts(const std::map<std::string, std::string> &shortcutsMap);
 
159
 
 
160
        void setVolume(const std::string& device, const double& value);
 
161
        double getVolume(const std::string& device);
 
162
 
 
163
#ifdef __ANDROID__
 
164
        void volumeChanged(const std::string& device, const int& value);
 
165
 
 
166
        // signals must be implemented manually for Android
 
167
        void accountsChanged();
 
168
 
 
169
        void historyChanged();
 
170
 
 
171
        void stunStatusFailure(const std::string& accoundID);
 
172
 
 
173
        void registrationStateChanged(const std::string& accoundID, int const& state);
 
174
        void sipRegistrationStateChanged(const std::string&, const std::string&, const int32_t&);
 
175
        void errorAlert(const int& alert);
 
176
#endif  // __ANDROID__
 
177
};
 
178
 
 
179
#endif //CONFIGURATIONMANAGER_H