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

« back to all changes in this revision

Viewing changes to daemon/src/client/android/configurationmanager.i

  • 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: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
 
4
 *  This program is free software; you can redistribute it and/or modify
 
5
 *  it under the terms of the GNU General Public License as published by
 
6
 *  the Free Software Foundation; either version 3 of the License, or
 
7
 *  (at your option) any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *  GNU General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU General Public License
 
15
 *  along with this program; if not, write to the Free Software
 
16
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
17
 *
 
18
 *  Additional permission under GNU GPL version 3 section 7:
 
19
 *
 
20
 *  If you modify this program, or any covered work, by linking or
 
21
 *  combining it with the OpenSSL project's OpenSSL library (or a
 
22
 *  modified version of that library), containing parts covered by the
 
23
 *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
 
24
 *  grants you additional permission to convey the resulting work.
 
25
 *  Corresponding Source for a non-source form of such a combination
 
26
 *  shall include the source code for the parts of OpenSSL used as well
 
27
 *  as that of the covered work.
 
28
 */
 
29
 
 
30
%header %{
 
31
#include "client/configurationmanager.h"
 
32
 
 
33
typedef struct configurationmanager_callback
 
34
{
 
35
    void (*on_accounts_changed)(void);
 
36
    void (*on_account_state_changed)(const std::string& accountID, const int32_t& state);
 
37
    void (*on_account_state_changed_with_code)(const std::string& accountID, const std::string& state, const int32_t& code);
 
38
} configurationmanager_callback_t;
 
39
 
 
40
 
 
41
class ConfigurationCallback {
 
42
public:
 
43
    virtual ~ConfigurationCallback() {}
 
44
    virtual void on_accounts_changed(void) {}
 
45
    virtual void on_account_state_changed(const std::string& accountID, const int32_t& state) {}
 
46
    virtual void on_account_state_changed_with_code(const std::string& accountID, const std::string& state, const int32_t& code) {}
 
47
};
 
48
 
 
49
static ConfigurationCallback *registeredConfigurationCallbackObject = NULL;
 
50
 
 
51
void on_accounts_changed_wrapper (void) {
 
52
    registeredConfigurationCallbackObject->on_accounts_changed();
 
53
}
 
54
 
 
55
void on_account_state_changed_wrapper (const std::string& accountID, const int32_t& state) {
 
56
    registeredConfigurationCallbackObject->on_account_state_changed(accountID, state);
 
57
}
 
58
 
 
59
void on_account_state_changed_with_code_wrapper (const std::string& accountID, const std::string& state, const int32_t& code) {
 
60
    registeredConfigurationCallbackObject->on_account_state_changed_with_code(accountID, state, code);
 
61
}
 
62
 
 
63
static struct configurationmanager_callback wrapper_configurationcallback_struct = {
 
64
    &on_accounts_changed_wrapper,
 
65
    &on_account_state_changed_wrapper,
 
66
    &on_account_state_changed_with_code_wrapper
 
67
};
 
68
 
 
69
void setConfigurationCallbackObject(ConfigurationCallback *callback) {
 
70
    registeredConfigurationCallbackObject = callback;
 
71
}
 
72
 
 
73
%}
 
74
 
 
75
%feature("director") ConfigurationCallback;
 
76
 
 
77
class ConfigurationManager {
 
78
public:
 
79
    std::map< std::string, std::string > getAccountDetails(const std::string& accountID);
 
80
    void setAccountDetails(const std::string& accountID, const std::map< std::string, std::string >& details);
 
81
    std::map<std::string, std::string> getAccountTemplate();
 
82
    std::string addAccount(const std::map< std::string, std::string >& details);
 
83
    void removeAccount(const std::string& accountID);
 
84
    std::vector< std::string > getAccountList();
 
85
    void sendRegister(const std::string& accountID, const bool& enable);
 
86
    void registerAllAccounts(void);
 
87
 
 
88
    std::map< std::string, std::string > getTlsSettingsDefault();
 
89
 
 
90
    std::vector< int32_t > getAudioCodecList();
 
91
    std::vector< std::string > getSupportedTlsMethod();
 
92
    std::vector< std::string > getAudioCodecDetails(const int32_t& payload);
 
93
    std::vector< int32_t > getActiveAudioCodecList(const std::string& accountID);
 
94
 
 
95
    void setActiveAudioCodecList(const std::vector< std::string >& list, const std::string& accountID);
 
96
 
 
97
    std::vector< std::string > getAudioPluginList();
 
98
    void setAudioPlugin(const std::string& audioPlugin);
 
99
    std::vector< std::string > getAudioOutputDeviceList();
 
100
    void setAudioOutputDevice(const int32_t& index);
 
101
    void setAudioInputDevice(const int32_t& index);
 
102
    void setAudioRingtoneDevice(const int32_t& index);
 
103
    std::vector< std::string > getAudioInputDeviceList();
 
104
    std::vector< std::string > getCurrentAudioDevicesIndex();
 
105
    int32_t getAudioDeviceIndex(const std::string& name);
 
106
    std::string getCurrentAudioOutputPlugin();
 
107
    bool getNoiseSuppressState();
 
108
    void setNoiseSuppressState(const bool& state);
 
109
    bool isAgcEnabled();
 
110
    void setAgcState(const bool& state);
 
111
    bool isDtmfMuted();
 
112
    void muteDtmf(const bool& mute);
 
113
    bool isCaptureMuted();
 
114
    void muteCapture(const bool& mute);
 
115
    bool isPlaybackMuted();
 
116
    void mutePlayback(const bool& mute);
 
117
    void setVolume(const std::string& device, const double& value);
 
118
    double getVolume(const std::string& device);
 
119
 
 
120
    std::map<std::string, std::string> getRingtoneList();
 
121
 
 
122
    std::string getAudioManager();
 
123
    void setAudioManager(const std::string& api);
 
124
 
 
125
    int32_t isIax2Enabled();
 
126
    std::string getRecordPath();
 
127
    void setRecordPath(const std::string& recPath);
 
128
    bool getIsAlwaysRecording();
 
129
    void setIsAlwaysRecording(const bool& rec);
 
130
 
 
131
    void setHistoryLimit(const int32_t& days);
 
132
    int32_t getHistoryLimit();
 
133
    void clearHistory();
 
134
 
 
135
    void setAccountsOrder(const std::string& order);
 
136
 
 
137
    std::map<std::string, std::string> getHookSettings();
 
138
    void setHookSettings(const std::map<std::string, std::string>& settings);
 
139
 
 
140
    std::vector<std::map<std::string, std::string> > getHistory();
 
141
 
 
142
    std::map<std::string, std::string> getTlsSettings();
 
143
    void setTlsSettings(const std::map< std::string, std::string >& details);
 
144
    std::map< std::string, std::string > getIp2IpDetails();
 
145
 
 
146
    std::vector< std::map< std::string, std::string > > getCredentials(const std::string& accountID);
 
147
    void setCredentials(const std::string& accountID, const std::vector< std::map< std::string, std::string > >& details);
 
148
 
 
149
    std::string getAddrFromInterfaceName(const std::string& interface);
 
150
 
 
151
    std::vector<std::string> getAllIpInterface();
 
152
    std::vector<std::string> getAllIpInterfaceByName();
 
153
 
 
154
    std::map<std::string, std::string> getShortcuts();
 
155
    void setShortcuts(const std::map<std::string, std::string> &shortcutsMap);
 
156
};
 
157
 
 
158
class ConfigurationCallback {
 
159
public:
 
160
    virtual ~ConfigurationCallback();
 
161
    virtual void on_accounts_changed(void);
 
162
    virtual void on_account_state_changed(const std::string& accountID, const int32_t& state);
 
163
    virtual void on_account_state_changed_with_code(const std::string& accountID, const std::string& state, const int32_t& code);
 
164
};
 
165
 
 
166
static ConfigurationCallback *registeredConfigurationCallbackObject = NULL;
 
167
 
 
168
void setConfigurationCallbackObject(ConfigurationCallback *callback) {
 
169
    registeredConfigurationCallbackObject = callback;
 
170
}