2
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
3
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
* Additional permission under GNU GPL version 3 section 7:
21
* If you modify this program, or any covered work, by linking or
22
* combining it with the OpenSSL project's OpenSSL library (or a
23
* modified version of that library), containing parts covered by the
24
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
25
* grants you additional permission to convey the resulting work.
26
* Corresponding Source for a non-source form of such a combination
27
* shall include the source code for the parts of OpenSSL used as well
28
* as that of the covered work.
31
#ifndef __PREFERENCE_H__
32
#define __PREFERENCE_H__
34
#include "config/serializable.h"
36
// general preferences
37
const Conf::Key orderKey ("order"); // : 1234/2345/
38
const Conf::Key audioApiKey ("audioApi"); // : 0
39
const Conf::Key historyLimitKey ("historyLimit"); // : 30
40
const Conf::Key historyMaxCallsKey ("historyMaxCalls"); // : 20
41
const Conf::Key notifyMailsKey ("notifyMails"); // : false
42
const Conf::Key zoneToneChoiceKey ("zoneToneChoice"); // : North America
43
const Conf::Key registrationExpireKey ("registrationExpire");// : 180
44
const Conf::Key portNumKey ("portNum"); // : 5060
45
const Conf::Key searchBarDisplayKey ("searchBarDisplay"); // : true
46
const Conf::Key zeroConfenableKey ("zeroConfenable"); // : false
47
const Conf::Key md5HashKey ("md5Hash"); // : false
50
const Conf::Key playDtmfKey ("playDtmf"); // true true
51
const Conf::Key playTonesKey ("playTones"); // true
52
const Conf::Key pulseLengthKey ("pulseLength"); //=250
53
const Conf::Key symmetricRtpKey ("symmetric");// =true
54
const Conf::Key zidFileKey ("zidFile");// =sfl.zid
56
// addressbook preferences
57
const Conf::Key photoKey ("photo");// false
58
const Conf::Key enabledKey ("enabled");// true
59
const Conf::Key listKey ("list");// 1243608768.30329.0@emilou-desktop/1243456917.15690.23@emilou-desktop/
60
const Conf::Key maxResultsKey ("maxResults");// 25
61
const Conf::Key businessKey ("business");// true
62
const Conf::Key homeKey ("home");// false
63
const Conf::Key mobileKey ("mobile");// false
66
const Conf::Key iax2EnabledKey ("iax2Enabled");// : false
67
const Conf::Key numberAddPrefixKey ("numberAddPrefix");//: false
68
const Conf::Key numberEnabledKey ("numberEnabled"); //: false
69
const Conf::Key sipEnabledKey ("sipEnabled"); //: false
70
const Conf::Key urlCommandKey ("urlCommand"); //: x-www-browser
71
const Conf::Key urlSipFieldKey ("urlSipField"); //: X-sflphone-url
74
const Conf::Key alsamapKey ("alsa");
75
const Conf::Key pulsemapKey ("pulse");
76
const Conf::Key cardinKey ("cardIn");// : 0
77
const Conf::Key cardoutKey ("cardOut");// 0
78
const Conf::Key cardringKey ("cardRing");// : 0
79
const Conf::Key framesizeKey ("frameSize");// : 20
80
const Conf::Key pluginKey ("plugin"); //: default
81
const Conf::Key smplrateKey ("smplRate");//: 44100
82
const Conf::Key devicePlaybackKey ("devicePlayback");//:
83
const Conf::Key deviceRecordKey ("deviceRecord");// :
84
const Conf::Key deviceRingtoneKey ("deviceRingtone");// :
85
const Conf::Key recordpathKey ("recordPath");//: /home/msavard/Bureau
86
const Conf::Key volumemicKey ("volumeMic");//: 100
87
const Conf::Key volumespkrKey ("volumeSpkr");//: 100
88
const Conf::Key noiseReduceKey ("noiseReduce");
90
// shortcut preferences
91
const Conf::Key hangupShortKey ("hangUp");
92
const Conf::Key pickupShortKey ("pickUp");
93
const Conf::Key popupShortKey ("popupWindow");
94
const Conf::Key toggleHoldShortKey ("toggleHold");
95
const Conf::Key togglePickupHangupShortKey ("togglePickupHangup");
98
class Preferences : public Serializable
107
virtual void serialize (Conf::YamlEmitter *emitter);
109
virtual void unserialize (Conf::MappingNode *map);
112
std::string getAccountOrder (void) {
113
return _accountOrder;
115
void setAccountOrder (std::string ord) {
119
int getAudioApi (void) {
122
void setAudioApi (int api) {
126
int getHistoryLimit (void) {
127
return _historyLimit;
129
void setHistoryLimit (int lim) {
133
int getHistoryMaxCalls (void) {
134
return _historyMaxCalls;
136
void setHistoryMaxCalls (int max) {
137
_historyMaxCalls = max;
140
bool getNotifyMails (void) {
143
void setNotifyMails (bool mails) {
144
_notifyMails = mails;
147
std::string getZoneToneChoice (void) {
148
return _zoneToneChoice;
150
void setZoneToneChoice (std::string str) {
151
_zoneToneChoice = str;
154
int getRegistrationExpire (void) {
155
return _registrationExpire;
157
void setRegistrationExpire (int exp) {
158
_registrationExpire = exp;
161
int getPortNum (void) {
164
void setPortNum (int port) {
168
bool getSearchBarDisplay (void) {
169
return _searchBarDisplay;
171
void setSearchBarDisplay (bool search) {
172
_searchBarDisplay = search;
175
bool getZeroConfenable (void) {
176
return _zeroConfenable;
178
void setZeroConfenable (bool enable) {
179
_zeroConfenable = enable;
182
bool getMd5Hash (void) {
185
void setMd5Hash (bool md5) {
192
std::string _accountOrder;
196
int _historyMaxCalls;
198
std::string _zoneToneChoice;
199
int _registrationExpire;
201
bool _searchBarDisplay;
202
bool _zeroConfenable;
208
class VoipPreference : public Serializable
217
virtual void serialize (Conf::YamlEmitter *emitter);
219
virtual void unserialize (Conf::MappingNode *map);
221
bool getPlayDtmf (void) {
224
void setPlayDtmf (bool dtmf) {
228
bool getPlayTones (void) {
231
void setPlayTones (bool tone) {
235
int getPulseLength (void) {
238
void setPulseLength (int length) {
239
_pulseLength = length;
242
bool getSymmetricRtp (void) {
243
return _symmetricRtp;
245
void setSymmetricRtp (bool sym) {
249
std::string getZidFile (void) {
252
void setZidFile (std::string file) {
262
std::string _zidFile;
266
class AddressbookPreference : public Serializable
271
AddressbookPreference();
273
~AddressbookPreference();
275
virtual void serialize (Conf::YamlEmitter *emitter);
277
virtual void unserialize (Conf::MappingNode *map);
279
bool getPhoto (void) {
282
void setPhoto (bool p) {
286
bool getEnabled (void) {
289
void setEnabled (bool e) {
293
std::string getList (void) {
296
void setList (std::string l) {
300
int getMaxResults (void) {
303
void setMaxResults (int r) {
307
bool getBusiness (void) {
310
void setBusiness (bool b) {
314
bool getHome (void) {
317
void setHone (bool h) {
321
bool getMobile (void) {
324
void setMobile (bool m) {
341
class HookPreference : public Serializable
350
virtual void serialize (Conf::YamlEmitter *emitter);
352
virtual void unserialize (Conf::MappingNode *map);
354
bool getIax2Enabled (void) {
357
void setIax2Enabled (bool i) {
361
std::string getNumberAddPrefix (void) {
362
return _numberAddPrefix;
364
void setNumberAddPrefix (std::string n) {
365
_numberAddPrefix = n;
368
bool getNumberEnabled (void) {
369
return _numberEnabled;
371
void setNumberEnabled (bool n) {
375
bool getSipEnabled (void) {
378
void setSipEnabled (bool s) {
382
std::string getUrlCommand (void) {
385
void setUrlCommand (std::string u) {
389
std::string getUrlSipField (void) {
392
void setUrlSipField (std::string u) {
398
bool _iax2Enabled;// : false
399
std::string _numberAddPrefix;//: false
400
bool _numberEnabled; //: false
401
bool _sipEnabled; //: false
402
std::string _urlCommand; //: x-www-browser
403
std::string _urlSipField; //: X-sflphone-url
408
class AudioPreference : public Serializable
417
virtual void serialize (Conf::YamlEmitter *emitter);
419
virtual void unserialize (Conf::MappingNode *map);
422
int getCardin (void) {
425
void setCardin (int c) {
429
int getCardout (void) {
432
void setCardout (int c) {
436
int getCardring (void) {
439
void setCardring (int c) {
443
int getFramesize (void) {
446
void setFramesize (int f) {
450
std::string getPlugin (void) {
453
void setPlugin (std::string p) {
457
int getSmplrate (void) {
460
void setSmplrate (int r) {
464
//pulseaudio preference
465
std::string getDevicePlayback (void) {
466
return _devicePlayback;
468
void setDevicePlayback (std::string p) {
472
std::string getDeviceRecord (void) {
473
return _deviceRecord;
475
void setDeviceRecord (std::string r) {
479
std::string getDeviceRingtone (void) {
480
return _deviceRingtone;
482
void setDeviceRingtone (std::string r) {
486
// general preference
487
std::string getRecordpath (void) {
490
void setRecordpath (std::string r) {
494
int getVolumemic (void) {
497
void setVolumemic (int m) {
501
int getVolumespkr (void) {
504
void setVolumespkr (int s) {
508
bool getNoiseReduce (void) {
512
void setNoiseReduce (bool noise) {
513
_noisereduce = noise;
522
int _framesize; // 20
523
std::string _plugin; // default
524
int _smplrate;// 44100
526
//pulseaudio preference
527
std::string _devicePlayback;//:
528
std::string _deviceRecord; //:
529
std::string _deviceRingtone; //:
531
// general preference
532
std::string _recordpath; //: /home/msavard/Bureau
533
int _volumemic; //: 100
534
int _volumespkr; //: 100
540
class ShortcutPreferences : public Serializable
545
ShortcutPreferences();
547
~ShortcutPreferences();
549
virtual void serialize (Conf::YamlEmitter *emitter);
551
virtual void unserialize (Conf::MappingNode *map);
553
void setShortcuts (std::map<std::string, std::string> shortcut);
554
std::map<std::string, std::string> getShortcuts (void);
556
std::string getHangup (void) {
559
void setHangup (std::string hangup) {
563
std::string getPickup (void) {
566
void setPickup (std::string pickup) {
570
std::string getPopup (void) {
573
void setPopup (std::string popup) {
577
std::string getToggleHold (void) {
580
void setToggleHold (std::string hold) {
584
std::string getTogglePickupHangup (void) {
585
return _togglePickupHangup;
587
void setTogglePickupHangup (std::string toggle) {
588
_togglePickupHangup = toggle;
596
std::string _toggleHold;
597
std::string _togglePickupHangup;