~ubuntu-branches/ubuntu/vivid/sflphone/vivid

« back to all changes in this revision

Viewing changes to kde/src/lib/sflphone_const.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-06-30 11:40:56 UTC
  • mfrom: (4.1.18 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130630114056-0np50jkyqo6vnmii
Tags: 1.2.3-2
* changeset_r92d62cfc54732bbbcfff2b1d36c096b120b981a5.diff 
  - fixes automatic endian detection 
* Update Vcs: fixes vcs-field-not-canonical

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
 *   Copyright (C) 2009-2013 by Savoir-Faire Linux                          *
 
3
 *   Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com>          *
 
4
 *            Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
 
5
 *                                                                          *
 
6
 *   This library is free software; you can redistribute it and/or          *
 
7
 *   modify it under the terms of the GNU Lesser General Public             *
 
8
 *   License as published by the Free Software Foundation; either           *
 
9
 *   version 2.1 of the License, or (at your option) any later version.     *
 
10
 *                                                                          *
 
11
 *   This library is distributed in the hope that it will be useful,        *
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      *
 
14
 *   Lesser General Public License for more details.                        *
 
15
 *                                                                          *
 
16
 *   You should have received a copy of the GNU General Public License      *
 
17
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
 
18
 ***************************************************************************/
 
19
 
 
20
#ifndef SFLPHONE_CONST_H
 
21
#define SFLPHONE_CONST_H
 
22
 
 
23
#include <QtCore/QString>
 
24
 
 
25
/* @file sflphone_const.h
 
26
 * @brief Contains the global variables for the client code
 
27
 */
 
28
 
 
29
#define APP_NAME                          "SFLphone KDE Client"
 
30
 
 
31
#define SIP                               0
 
32
#define IAX                               1
 
33
 
 
34
#define TOOLBAR_SIZE                      22
 
35
 
 
36
#define CONTACT_ITEM_HEIGHT               40
 
37
 
 
38
#define CONFIG_FILE_PATH                  "/.sflphone/sflphonedrc"
 
39
 
 
40
#define ACTION_LABEL_CALL                 i18n("New call")
 
41
#define ACTION_LABEL_HANG_UP              i18n("Hang up")
 
42
#define ACTION_LABEL_HOLD                 i18n("Hold on")
 
43
#define ACTION_LABEL_TRANSFER             i18n("Transfer")
 
44
#define ACTION_LABEL_RECORD               i18n("Record")
 
45
#define ACTION_LABEL_ACCEPT               i18n("Pick up")
 
46
#define ACTION_LABEL_REFUSE               i18n("Hang up")
 
47
#define ACTION_LABEL_UNHOLD               i18n("Hold off")
 
48
#define ACTION_LABEL_GIVE_UP_TRANSF       i18n("Give up transfer")
 
49
#define ACTION_LABEL_CALL_BACK            i18n("Call back")
 
50
#define ACTION_LABEL_MAILBOX              i18n("Voicemail")
 
51
 
 
52
#define SCREEN_MAIN                       0
 
53
#define SCREEN_HISTORY                    1
 
54
#define SCREEN_ADDRESS                    2
 
55
 
 
56
#define ICON_INCOMING                     ":/images/icons/ring.svg"
 
57
#define ICON_RINGING                      ":/images/icons/ring.svg"
 
58
#define ICON_CURRENT                      ":/images/icons/current.svg"
 
59
#define ICON_CURRENT_REC                  ":/images/icons/rec_call.svg"
 
60
#define ICON_DIALING                      ":/images/icons/dial.svg"
 
61
#define ICON_HOLD                         ":/images/icons/hold.svg"
 
62
#define ICON_FAILURE                      ":/images/icons/fail.svg"
 
63
#define ICON_BUSY                         ":/images/icons/busy.svg"
 
64
#define ICON_TRANSFER                     ":/images/icons/transfert.svg"
 
65
#define ICON_TRANSF_HOLD                  ":/images/icons/transfert.svg"
 
66
#define ICON_CONFERENCE                   ":/images/icons/user-group-properties.svg"
 
67
#define ICON_CALL                         ":/images/icons/call.svg"
 
68
#define ICON_HANGUP                       ":/images/icons/hang_up.svg"
 
69
#define ICON_UNHOLD                       ":/images/icons/unhold.svg"
 
70
#define ICON_ACCEPT                       ":/images/icons/accept.svg"
 
71
#define ICON_REFUSE                       ":/images/icons/refuse.svg"
 
72
#define ICON_EXEC_TRANSF                  ":/images/icons/call.svg"
 
73
#define ICON_REC_DEL_OFF                  ":/images/icons/record_disabled.svg"
 
74
#define ICON_REC_DEL_ON                   ":/images/icons/record.svg"
 
75
#define ICON_MAILBOX                      ":/images/icons/mailbox.svg"
 
76
#define ICON_REC_VOL_0                    ":/images/icons/mic.svg"
 
77
#define ICON_REC_VOL_1                    ":/images/icons/mic_25.svg"
 
78
#define ICON_REC_VOL_2                    ":/images/icons/mic_50.svg"
 
79
#define ICON_REC_VOL_3                    ":/images/icons/mic_75.svg"
 
80
#define ICON_SND_VOL_0                    ":/images/icons/speaker.svg"
 
81
#define ICON_SND_VOL_1                    ":/images/icons/speaker_25.svg"
 
82
#define ICON_SND_VOL_2                    ":/images/icons/speaker_50.svg"
 
83
#define ICON_SND_VOL_3                    ":/images/icons/speaker_75.svg"
 
84
#define ICON_SCREEN_MAIN                  ":/images/icons/sflphone.svg"
 
85
#define ICON_SCREEN_HISTORY               ":/images/icons/history2.svg"
 
86
#define ICON_SCREEN_ADDRESS               ":/images/icons/x-office-address-book.png"
 
87
#define ICON_DISPLAY_VOLUME_CONSTROLS     ":/images/icons/icon_volume_off.svg"
 
88
#define ICON_DISPLAY_DIALPAD              ":/images/icons/icon_dialpad.svg"
 
89
#define ICON_HISTORY_INCOMING             ":/images/icons/incoming.svg"
 
90
#define ICON_HISTORY_OUTGOING             ":/images/icons/outgoing.svg"
 
91
#define ICON_HISTORY_MISSED               ":/images/icons/missed.svg"
 
92
#define ICON_ACCOUNT_LED_RED              ":/images/icons/led-red.svg"
 
93
#define ICON_ACCOUNT_LED_GREEN            ":/images/icons/led-green.svg"
 
94
#define ICON_ACCOUNT_LED_GRAY             ":/images/icons/led-gray.svg"
 
95
#define ICON_QUIT                         ":/images/icons/application-exit.png"
 
96
#define ICON_SFLPHONE                     ":/images/icons/sflphone.svg"
 
97
#define ICON_TRAY_NOTIF                   ":/images/icons/sflphone_notif.svg"
 
98
 
 
99
#define RECORD_DEVICE                     "mic"
 
100
#define SOUND_DEVICE                      "speaker"
 
101
 
 
102
 
 
103
/** Account details */
 
104
 
 
105
/** TLS */
 
106
 
 
107
#define IP2IP_PROFILE                      "IP2IP"
 
108
 
 
109
#define ACCOUNT_ID                         "Account.id"
 
110
#define ACCOUNT_TYPE                       "Account.type"
 
111
#define ACCOUNT_ALIAS                      "Account.alias"
 
112
#define ACCOUNT_ENABLED                    "Account.enable"
 
113
#define ACCOUNT_MAILBOX                    "Account.mailbox"
 
114
#define ACCOUNT_USERAGENT                  "Account.useragent"
 
115
#define ACCOUNT_REGISTRATION_EXPIRE        "Account.registrationExpire"
 
116
#define ACCOUNT_REGISTRATION_STATUS        "Account.registrationStatus"
 
117
#define ACCOUNT_REGISTRATION_STATE_CODE    "Account.registrationCode"
 
118
#define ACCOUNT_REGISTRATION_STATE_DESC    "Account.registrationDescription"
 
119
 
 
120
#define ACCOUNT_SIP_STUN_SERVER            "STUN.server"
 
121
#define ACCOUNT_SIP_STUN_ENABLED           "STUN.enable"
 
122
#define ACCOUNT_DTMF_TYPE                  "Account.dtmfType"
 
123
#define ACCOUNT_AUTOANSWER                 "Account.autoAnswer"
 
124
#define ACCOUNT_HOSTNAME                   "Account.hostname"
 
125
#define ACCOUNT_USERNAME                   "Account.username"
 
126
#define ACCOUNT_ROUTE                      "Account.routeset"
 
127
#define ACCOUNT_PASSWORD                   "Account.password"
 
128
#define ACCOUNT_REALM                      "Account.realm"
 
129
#define ACCOUNT_KEY_EXCHANGE               "SRTP.keyExchange"
 
130
#define ACCOUNT_SRTP_ENABLED               "SRTP.enable"
 
131
#define ACCOUNT_SRTP_RTP_FALLBACK          "SRTP.rtpFallback"
 
132
#define ACCOUNT_ZRTP_DISPLAY_SAS           "ZRTP.displaySAS"
 
133
#define ACCOUNT_ZRTP_NOT_SUPP_WARNING      "ZRTP.notSuppWarning"
 
134
#define ACCOUNT_ZRTP_HELLO_HASH            "ZRTP.helloHashEnable"
 
135
#define ACCOUNT_DISPLAY_SAS_ONCE           "ZRTP.displaySasOnce"
 
136
#define KEY_EXCHANGE_NONE                  "none"
 
137
#define ZRTP                               "zrtp"
 
138
#define SDES                               "sdes"
 
139
 
 
140
#define CONFIG_RINGTONE_PATH               "Account.ringtonePath"
 
141
#define CONFIG_RINGTONE_ENABLED            "Account.ringtoneEnabled"
 
142
 
 
143
 
 
144
/**Security */
 
145
#define TLS_LISTENER_PORT                  "TLS.listenerPort"
 
146
#define TLS_ENABLE                         "TLS.enable"
 
147
#define TLS_PORT                           "TLS.port"
 
148
#define TLS_CA_LIST_FILE                   "TLS.certificateListFile"
 
149
#define TLS_CERTIFICATE_FILE               "TLS.certificateFile"
 
150
#define TLS_PRIVATE_KEY_FILE               "TLS.privateKeyFile"
 
151
#define TLS_PASSWORD                       "TLS.password"
 
152
#define TLS_METHOD                         "TLS.method"
 
153
#define TLS_CIPHERS                        "TLS.ciphers"
 
154
#define TLS_SERVER_NAME                    "TLS.serverName"
 
155
#define TLS_VERIFY_SERVER                  "TLS.verifyServer"
 
156
#define TLS_VERIFY_CLIENT                  "TLS.verifyClient"
 
157
#define TLS_REQUIRE_CLIENT_CERTIFICATE     "TLS.requireClientCertificate"
 
158
#define TLS_NEGOTIATION_TIMEOUT_SEC        "TLS.negotiationTimeoutSec"
 
159
#define TLS_NEGOTIATION_TIMEOUT_MSEC       "TLS.negotiationTimemoutMsec"
 
160
 
 
161
/**Shortcut*/
 
162
#define SHORTCUT_PICKUP                    "pickUp"
 
163
#define SHORTCUT_HANGUP                    "hangUp"
 
164
#define SHORTCUT_POPUP                     "popupWindow"
 
165
#define SHORTCUT_TOGGLEPICKUPHANGUP        "togglePickupHangup"
 
166
#define SHORTCUT_TOGGLEHOLD                "toggleHold"
 
167
 
 
168
 
 
169
#define CONFIG_ACCOUNT_HOSTNAME            "Account.hostname"
 
170
#define CONFIG_ACCOUNT_USERNAME            "Account.username"
 
171
#define CONFIG_ACCOUNT_ROUTESET            "Account.routeset"
 
172
#define CONFIG_ACCOUNT_PASSWORD            "Account.password"
 
173
#define CONFIG_ACCOUNT_REALM               "Account.realm"
 
174
#define CONFIG_ACCOUNT_DEFAULT_REALM       "*"
 
175
#define CONFIG_ACCOUNT_USERAGENT           "Account.useragent"
 
176
 
 
177
#define LOCAL_INTERFACE                    "Account.localInterface"
 
178
#define PUBLISHED_SAMEAS_LOCAL             "Account.publishedSameAsLocal"
 
179
#define LOCAL_PORT                         "Account.localPort"
 
180
#define PUBLISHED_PORT                     "Account.publishedPort"
 
181
#define PUBLISHED_ADDRESS                  "Account.publishedAddress"
 
182
 
 
183
 
 
184
/** Maybe to remove **/
 
185
#define REGISTRATION_EXPIRE_DEFAULT       600
 
186
static const QString REGISTRATION_ENABLED_TRUE("true");
 
187
static const QString REGISTRATION_ENABLED_FALSE("false");
 
188
#define ACCOUNT_TYPE_SIP                  "SIP"
 
189
#define ACCOUNT_TYPE_IAX                  "IAX"
 
190
#define ACCOUNT_TYPES_TAB                 {QString(ACCOUNT_TYPE_SIP), QString(ACCOUNT_TYPE_IAX)}
 
191
/*********************/
 
192
 
 
193
/** Constant variables */
 
194
#define ACCOUNT_MAILBOX_DEFAULT_VALUE     "888"
 
195
 
 
196
/** Account States */
 
197
#define ACCOUNT_STATE_REGISTERED          "REGISTERED"
 
198
#define ACCOUNT_STATE_READY               "READY"
 
199
#define ACCOUNT_STATE_UNREGISTERED        "UNREGISTERED"
 
200
#define ACCOUNT_STATE_TRYING              "TRYING"
 
201
#define ACCOUNT_STATE_ERROR               "ERROR"
 
202
#define ACCOUNT_STATE_ERROR_AUTH          "ERROR_AUTH"
 
203
#define ACCOUNT_STATE_ERROR_NETWORK       "ERROR_NETWORK"
 
204
#define ACCOUNT_STATE_ERROR_HOST          "ERROR_HOST"
 
205
#define ACCOUNT_STATE_ERROR_CONF_STUN     "ERROR_CONF_STUN"
 
206
#define ACCOUNT_STATE_ERROR_EXIST_STUN    "ERROR_EXIST_STUN"
 
207
 
 
208
/** Calls details */
 
209
#define CALL_PEER_NAME                    "DISPLAY_NAME"
 
210
//#define CALL_PEER_NAME                    "PEER_NAME"
 
211
#define CALL_PEER_NUMBER                  "PEER_NUMBER"
 
212
#define CALL_ACCOUNTID                    "ACCOUNTID"
 
213
#define CALL_STATE                        "CALL_STATE"
 
214
#define CALL_TYPE                         "CALL_TYPE"
 
215
#define CALL_TIMESTAMP_START              "TIMESTAMP_START"
 
216
 
 
217
/** Call States */
 
218
#define CALL_STATE_CHANGE_HUNG_UP         "HUNGUP"
 
219
#define CALL_STATE_CHANGE_RINGING         "RINGING"
 
220
#define CALL_STATE_CHANGE_CURRENT         "CURRENT"
 
221
#define CALL_STATE_CHANGE_HOLD            "HOLD"
 
222
#define CALL_STATE_CHANGE_BUSY            "BUSY"
 
223
#define CALL_STATE_CHANGE_FAILURE         "FAILURE"
 
224
#define CALL_STATE_CHANGE_UNHOLD_CURRENT  "UNHOLD"
 
225
#define CALL_STATE_CHANGE_UNKNOWN         "UNKNOWN"
 
226
 
 
227
#define CONF_STATE_CHANGE_HOLD            "HOLD"
 
228
#define CONF_STATE_CHANGE_ACTIVE          "ACTIVE_ATTACHED"
 
229
 
 
230
#define DAEMON_CALL_STATE_INIT_CURRENT    "CURRENT"
 
231
#define DAEMON_CALL_STATE_INIT_HOLD       "HOLD"
 
232
#define DAEMON_CALL_STATE_INIT_BUSY       "BUSY"
 
233
#define DAEMON_CALL_STATE_INIT_INCOMING   "INCOMING"
 
234
#define DAEMON_CALL_STATE_INIT_RINGING    "RINGING"
 
235
#define DAEMON_CALL_STATE_INIT_INACTIVE   "INACTIVE"
 
236
 
 
237
#define DAEMON_CALL_TYPE_INCOMING         "0"
 
238
#define DAEMON_CALL_TYPE_OUTGOING         "1"
 
239
 
 
240
#define DAEMON_HISTORY_TYPE_MISSED        "0"
 
241
#define DAEMON_HISTORY_TYPE_OUTGOING      "1"
 
242
#define DAEMON_HISTORY_TYPE_INCOMING      "2"
 
243
 
 
244
/** Address Book Settings */
 
245
#define ADDRESSBOOK_MAX_RESULTS           "ADDRESSBOOK_MAX_RESULTS"
 
246
#define ADDRESSBOOK_DISPLAY_CONTACT_PHOTO "ADDRESSBOOK_DISPLAY_CONTACT_PHOTO"
 
247
#define ADDRESSBOOK_DISPLAY_BUSINESS      "ADDRESSBOOK_DISPLAY_PHONE_BUSINESS"
 
248
#define ADDRESSBOOK_DISPLAY_HOME          "ADDRESSBOOK_DISPLAY_PHONE_HOME"
 
249
#define ADDRESSBOOK_DISPLAY_MOBILE        "ADDRESSBOOK_DISPLAY_PHONE_MOBILE"
 
250
#define ADDRESSBOOK_ENABLE                "ADDRESSBOOK_ENABLE"
 
251
 
 
252
/** Hooks settings */
 
253
#define HOOKS_ADD_PREFIX                  "PHONE_NUMBER_HOOK_ADD_PREFIX"
 
254
#define HOOKS_ENABLED                     "PHONE_NUMBER_HOOK_ENABLED"
 
255
#define HOOKS_COMMAND                     "URLHOOK_COMMAND"
 
256
#define HOOKS_IAX2_ENABLED                "URLHOOK_IAX2_ENABLED"
 
257
#define HOOKS_SIP_ENABLED                 "URLHOOK_SIP_ENABLED"
 
258
#define HOOKS_SIP_FIELD                   "URLHOOK_SIP_FIELD"
 
259
 
 
260
/** Constant variables */
 
261
#define MAX_HISTORY_CAPACITY              60
 
262
 
 
263
/** Codecs details */
 
264
#define CODEC_NAME                        0
 
265
#define CODEC_SAMPLE_RATE                 1
 
266
#define CODEC_BIT_RATE                    2
 
267
#define CODEC_BANDWIDTH                   3
 
268
 
 
269
/** Audio Managers */
 
270
#define CONST_ALSA                        0
 
271
#define CONST_PULSEAUDIO                  1
 
272
 
 
273
typedef enum
 
274
{
 
275
   
 
276
   CALL_STATE_INCOMING        = 0, /** Ringing incoming call */
 
277
   CALL_STATE_RINGING         = 1, /** Ringing outgoing call */
 
278
   CALL_STATE_CURRENT         = 2, /** Call to which the user can speak and hear */
 
279
   CALL_STATE_DIALING         = 3, /** Call which numbers are being added by the user */
 
280
   CALL_STATE_HOLD            = 4, /** Call is on hold */
 
281
   CALL_STATE_FAILURE         = 5, /** Call has failed */
 
282
   CALL_STATE_BUSY            = 6, /** Call is busy */
 
283
   CALL_STATE_TRANSFERRED     = 7, /** Call is being transferred.  During this state, the user can enter the new number. */
 
284
   CALL_STATE_TRANSF_HOLD     = 8, /** Call is on hold for transfer */
 
285
   CALL_STATE_OVER            = 9, /** Call is over and should not be used */
 
286
   CALL_STATE_ERROR           = 10,/** This state should never be reached */
 
287
   CALL_STATE_CONFERENCE      = 11,/** This call is the current conference*/
 
288
   CALL_STATE_CONFERENCE_HOLD = 12,/** This call is a conference on hold*/
 
289
} call_state;
 
290
 
 
291
static const QString empty("");
 
292
#define EMPTY_STRING empty
 
293
 
 
294
/** MIME API */
 
295
#define MIME_CALLID           "text/sflphone.call.id"
 
296
#define MIME_CONTACT          "text/sflphone.contact"
 
297
#define MIME_HISTORYID        "text/sflphone.history.id"
 
298
#define MIME_PHONENUMBER      "text/sflphone.phone.number"
 
299
#define MIME_CONTACT_PHONE    "text/sflphone.contact.phone"
 
300
#define MIME_PLAIN_TEXT       "text/plain"
 
301
#endif
 
302
 
 
303
/** HISTORY SERIALIZATION */
 
304
#define ACCOUNT_ID_KEY        "accountid"
 
305
#define CALLID_KEY            "callid"
 
306
#define CONFID_KEY            "confid"
 
307
#define DISPLAY_NAME_KEY      "display_name"
 
308
#define PEER_NUMBER_KEY       "peer_number"
 
309
#define RECORDING_PATH_KEY    "recordfile"
 
310
#define STATE_KEY             "state"
 
311
#define TIMESTAMP_START_KEY   "timestamp_start"
 
312
#define TIMESTAMP_STOP_KEY    "timestamp_stop"
 
313
#define MISSED_STRING         "missed"
 
314
#define INCOMING_STRING       "incoming"
 
315
#define OUTGOING_STRING       "outgoing"