preferences.h 18 KB
Newer Older
1
/*
2
 *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 *  Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
 *
 *  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
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  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.
 *
 *  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.
 *
 *  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.
 */

#ifndef __PREFERENCE_H__
#define __PREFERENCE_H__

#include "config/serializable.h"
35
#include "video/video_v4l2_list.h"
36
37
#include "video/video_v4l2.h"
using namespace sfl_video;
38

39
// general preferences
40
41
42
43
44
45
46
47
48
49
50
static const char * const orderKey = "order";
static const char * const audioApiKey = "audioApi";
static const char * const historyLimitKey = "historyLimit";
static const char * const historyMaxCallsKey = "historyMaxCalls";
static const char * const  notifyMailsKey = "notifyMails";
static const char * const zoneToneChoiceKey = "zoneToneChoice";
static const char * const registrationExpireKey = "registrationExpire";
static const char * const portNumKey = "portNum";
static const char * const searchBarDisplayKey = "searchBarDisplay";
static const char * const zeroConfenableKey = "zeroConfenable";
static const char * const md5HashKey = "md5Hash";
51

52
// voip preferences
53
54
55
56
57
static const char * const playDtmfKey = "playDtmf";
static const char * const playTonesKey = "playTones";
static const char * const pulseLengthKey = "pulseLength";
static const char * const symmetricRtpKey = "symmetric";
static const char * const zidFileKey = "zidFile";
Alexandre Savard's avatar
Alexandre Savard committed
58

59
// addressbook preferences
60
61
62
63
64
65
66
static const char * const photoKey = "photo";
static const char * const enabledKey = "enabled";
static const char * const listKey = "list";
static const char * const maxResultsKey = "maxResults";
static const char * const businessKey = "business";
static const char * const homeKey = "home";
static const char * const mobileKey = "mobile";
67
68

// hooks preferences
69
70
71
72
73
74
static const char * const iax2EnabledKey = "iax2Enabled";
static const char * const numberAddPrefixKey = "numberAddPrefix";
static const char * const numberEnabledKey = "numberEnabled";
static const char * const sipEnabledKey = "sipEnabled";
static const char * const urlCommandKey = "urlCommand";
static const char * const urlSipFieldKey = "urlSipField";
75

76
// audio preferences
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
static const char * const alsamapKey = "alsa";
static const char * const pulsemapKey = "pulse";
static const char * const cardinKey = "cardIn";
static const char * const cardoutKey = "cardOut";
static const char * const cardringKey = "cardRing";
static const char * const pluginKey = "plugin";
static const char * const smplrateKey = "smplRate";
static const char * const devicePlaybackKey = "devicePlayback";
static const char * const deviceRecordKey = "deviceRecord";
static const char * const deviceRingtoneKey = "deviceRingtone";
static const char * const recordpathKey = "recordPath";
static const char * const alwaysRecordingKey = "alwaysRecording";
static const char * const volumemicKey = "volumeMic";
static const char * const volumespkrKey = "volumeSpkr";
static const char * const noiseReduceKey = "noiseReduce";
static const char * const echoCancelKey = "echoCancel";
static const char * const echoTailKey = "echoTailLength";
static const char * const echoDelayKey = "echoDelayLength";
Alexandre Savard's avatar
Alexandre Savard committed
95

96
// video preferences
97
98
99
100
const std::string videoDeviceKey ("v4l2Dev");
const std::string videoChannelKey ("v4l2Channel");
const std::string videoSizeKey ("v4l2Size");
const std::string videoRateKey ("v4l2Rate");
101

102
// shortcut preferences
103
104
105
106
107
static const char * const hangupShortKey = "hangUp";
static const char * const pickupShortKey = "pickUp";
static const char * const popupShortKey = "popupWindow";
static const char * const toggleHoldShortKey = "toggleHold";
static const char * const togglePickupHangupShortKey = "togglePickupHangup";
Julien Bonjean's avatar
Julien Bonjean committed
108

109
class AudioLayer;
Julien Bonjean's avatar
Julien Bonjean committed
110

111
class Preferences : public Serializable {
Julien Bonjean's avatar
Julien Bonjean committed
112
    public:
113
114
        static const char * const DFT_ZONE;

Julien Bonjean's avatar
Julien Bonjean committed
115
116
        Preferences();

117
        virtual void serialize(Conf::YamlEmitter *emitter);
Julien Bonjean's avatar
Julien Bonjean committed
118

119
        virtual void unserialize(Conf::MappingNode *map);
Julien Bonjean's avatar
Julien Bonjean committed
120

121
122
        std::string getAccountOrder() const {
            return accountOrder_;
Julien Bonjean's avatar
Julien Bonjean committed
123
        }
124

125
        void setAccountOrder(const std::string &ord) {
126
            accountOrder_ = ord;
Julien Bonjean's avatar
Julien Bonjean committed
127
128
        }

129
130
        int getHistoryLimit() const {
            return historyLimit_;
Julien Bonjean's avatar
Julien Bonjean committed
131
        }
132

133
        void setHistoryLimit(int lim) {
134
            historyLimit_ = lim;
Julien Bonjean's avatar
Julien Bonjean committed
135
136
        }

137
138
        int getHistoryMaxCalls() const {
            return historyMaxCalls_;
Julien Bonjean's avatar
Julien Bonjean committed
139
        }
140

141
        void setHistoryMaxCalls(int max) {
142
            historyMaxCalls_ = max;
Julien Bonjean's avatar
Julien Bonjean committed
143
144
        }

145
146
        bool getNotifyMails() const {
            return notifyMails_;
Julien Bonjean's avatar
Julien Bonjean committed
147
        }
148

149
        void setNotifyMails(bool mails) {
150
            notifyMails_ = mails;
Julien Bonjean's avatar
Julien Bonjean committed
151
152
        }

153
154
        std::string getZoneToneChoice() const {
            return zoneToneChoice_;
Julien Bonjean's avatar
Julien Bonjean committed
155
        }
156

157
        void setZoneToneChoice(const std::string &str) {
158
            zoneToneChoice_ = str;
Julien Bonjean's avatar
Julien Bonjean committed
159
160
        }

161
162
        int getRegistrationExpire() const {
            return registrationExpire_;
Julien Bonjean's avatar
Julien Bonjean committed
163
        }
164

165
        void setRegistrationExpire(int exp) {
166
            registrationExpire_ = exp;
Julien Bonjean's avatar
Julien Bonjean committed
167
168
        }

169
170
        int getPortNum() const {
            return portNum_;
Julien Bonjean's avatar
Julien Bonjean committed
171
        }
172

173
        void setPortNum(int port) {
174
            portNum_ = port;
Julien Bonjean's avatar
Julien Bonjean committed
175
176
        }

177
178
        bool getSearchBarDisplay() const {
            return searchBarDisplay_;
Julien Bonjean's avatar
Julien Bonjean committed
179
        }
180

181
        void setSearchBarDisplay(bool search) {
182
            searchBarDisplay_ = search;
Julien Bonjean's avatar
Julien Bonjean committed
183
184
        }

185
186
        bool getZeroConfenable() const {
            return zeroConfenable_;
Julien Bonjean's avatar
Julien Bonjean committed
187
        }
188
        void setZeroConfenable(bool enable) {
189
            zeroConfenable_ = enable;
Julien Bonjean's avatar
Julien Bonjean committed
190
191
        }

192
193
        bool getMd5Hash() const {
            return md5Hash_;
Julien Bonjean's avatar
Julien Bonjean committed
194
        }
195
        void setMd5Hash(bool md5) {
196
            md5Hash_ = md5;
Julien Bonjean's avatar
Julien Bonjean committed
197
198
199
        }

    private:
200
201
202
203
204
205
206
207
208
209
        std::string accountOrder_;
        int historyLimit_;
        int historyMaxCalls_;
        bool notifyMails_;
        std::string zoneToneChoice_;
        int registrationExpire_;
        int portNum_;
        bool searchBarDisplay_;
        bool zeroConfenable_;
        bool md5Hash_;
210
211
};

212
class VoipPreference : public Serializable {
Julien Bonjean's avatar
Julien Bonjean committed
213
214
    public:
        VoipPreference();
Alexandre Savard's avatar
Alexandre Savard committed
215

216
        virtual void serialize(Conf::YamlEmitter *emitter);
Alexandre Savard's avatar
Alexandre Savard committed
217

218
        virtual void unserialize(Conf::MappingNode *map);
Alexandre Savard's avatar
Alexandre Savard committed
219

220
221
        bool getPlayDtmf() const {
            return playDtmf_;
Julien Bonjean's avatar
Julien Bonjean committed
222
        }
223

224
        void setPlayDtmf(bool dtmf) {
225
            playDtmf_ = dtmf;
Julien Bonjean's avatar
Julien Bonjean committed
226
        }
Alexandre Savard's avatar
Alexandre Savard committed
227

228
229
        bool getPlayTones() const {
            return playTones_;
Julien Bonjean's avatar
Julien Bonjean committed
230
        }
231

232
        void setPlayTones(bool tone) {
233
            playTones_ = tone;
Julien Bonjean's avatar
Julien Bonjean committed
234
        }
Alexandre Savard's avatar
Alexandre Savard committed
235

236
237
        int getPulseLength() const {
            return pulseLength_;
Julien Bonjean's avatar
Julien Bonjean committed
238
        }
239

240
        void setPulseLength(int length) {
241
            pulseLength_ = length;
Julien Bonjean's avatar
Julien Bonjean committed
242
        }
Alexandre Savard's avatar
Alexandre Savard committed
243

244
245
        bool getSymmetricRtp() const {
            return symmetricRtp_;
Julien Bonjean's avatar
Julien Bonjean committed
246
        }
247
        void setSymmetricRtp(bool sym) {
248
            symmetricRtp_ = sym;
Julien Bonjean's avatar
Julien Bonjean committed
249
        }
Alexandre Savard's avatar
Alexandre Savard committed
250

251
252
        std::string getZidFile() const {
            return zidFile_;
Julien Bonjean's avatar
Julien Bonjean committed
253
        }
254
        void setZidFile(const std::string &file) {
255
            zidFile_ = file;
Julien Bonjean's avatar
Julien Bonjean committed
256
        }
Alexandre Savard's avatar
Alexandre Savard committed
257

Julien Bonjean's avatar
Julien Bonjean committed
258
    private:
Alexandre Savard's avatar
Alexandre Savard committed
259

260
261
262
263
264
        bool playDtmf_;
        bool playTones_;
        int pulseLength_;
        bool symmetricRtp_;
        std::string zidFile_;
Alexandre Savard's avatar
Alexandre Savard committed
265
266
};

267
class AddressbookPreference : public Serializable {
Julien Bonjean's avatar
Julien Bonjean committed
268
269
270
    public:
        AddressbookPreference();

271
        virtual void serialize(Conf::YamlEmitter *emitter);
Julien Bonjean's avatar
Julien Bonjean committed
272

273
        virtual void unserialize(Conf::MappingNode *map);
Julien Bonjean's avatar
Julien Bonjean committed
274

275
276
        bool getPhoto() const {
            return photo_;
Julien Bonjean's avatar
Julien Bonjean committed
277
        }
278

279
        void setPhoto(bool p) {
280
            photo_ = p;
Julien Bonjean's avatar
Julien Bonjean committed
281
282
        }

283
284
        bool getEnabled() const {
            return enabled_;
Julien Bonjean's avatar
Julien Bonjean committed
285
        }
286

287
        void setEnabled(bool e) {
288
            enabled_ = e;
Julien Bonjean's avatar
Julien Bonjean committed
289
290
        }

291
292
        std::string getList() const {
            return list_;
Julien Bonjean's avatar
Julien Bonjean committed
293
        }
294

295
        void setList(const std::string &l) {
296
            list_ = l;
Julien Bonjean's avatar
Julien Bonjean committed
297
298
        }

299
300
        int getMaxResults() const {
            return maxResults_;
Julien Bonjean's avatar
Julien Bonjean committed
301
        }
302

303
        void setMaxResults(int r) {
304
            maxResults_ = r;
Julien Bonjean's avatar
Julien Bonjean committed
305
306
        }

307
308
        bool getBusiness() const {
            return business_;
Julien Bonjean's avatar
Julien Bonjean committed
309
        }
310

311
        void setBusiness(bool b) {
312
            business_ = b;
Julien Bonjean's avatar
Julien Bonjean committed
313
314
        }

315
316
        bool getHome() const {
            return home_;
Julien Bonjean's avatar
Julien Bonjean committed
317
        }
318
        void setHone(bool h) {
319
            home_ = h;
Julien Bonjean's avatar
Julien Bonjean committed
320
321
        }

322
323
        bool getMobile() const {
            return mobile_;
Julien Bonjean's avatar
Julien Bonjean committed
324
        }
325
        void setMobile(bool m) {
326
            mobile_ = m;
Julien Bonjean's avatar
Julien Bonjean committed
327
328
329
330
        }

    private:

331
332
333
334
335
336
337
        bool photo_;
        bool enabled_;
        std::string list_;
        int maxResults_;
        bool business_;
        bool home_;
        bool mobile_;
338
339
340
341

};


342
class HookPreference : public Serializable {
Julien Bonjean's avatar
Julien Bonjean committed
343
344
    public:
        HookPreference();
345

346
        virtual void serialize(Conf::YamlEmitter *emitter);
347

348
        virtual void unserialize(Conf::MappingNode *map);
349

350
351
        bool getIax2Enabled() const {
            return iax2Enabled_;
Julien Bonjean's avatar
Julien Bonjean committed
352
        }
353

354
        void setIax2Enabled(bool i) {
355
            iax2Enabled_ = i;
Julien Bonjean's avatar
Julien Bonjean committed
356
        }
357

358
359
        std::string getNumberAddPrefix() const {
            return numberAddPrefix_;
Julien Bonjean's avatar
Julien Bonjean committed
360
        }
361

362
        void setNumberAddPrefix(const std::string &n) {
363
            numberAddPrefix_ = n;
Julien Bonjean's avatar
Julien Bonjean committed
364
        }
365

366
367
        bool getNumberEnabled() const {
            return numberEnabled_;
Julien Bonjean's avatar
Julien Bonjean committed
368
        }
369

370
        void setNumberEnabled(bool n) {
371
            numberEnabled_ = n;
Julien Bonjean's avatar
Julien Bonjean committed
372
        }
373

374
375
        bool getSipEnabled() const {
            return sipEnabled_;
Julien Bonjean's avatar
Julien Bonjean committed
376
        }
377

378
        void setSipEnabled(bool s) {
379
            sipEnabled_ = s;
Julien Bonjean's avatar
Julien Bonjean committed
380
        }
381

382
383
        std::string getUrlCommand() const {
            return urlCommand_;
Julien Bonjean's avatar
Julien Bonjean committed
384
        }
385
        void setUrlCommand(const std::string &u) {
386
            urlCommand_ = u;
Julien Bonjean's avatar
Julien Bonjean committed
387
        }
388

389
390
        std::string getUrlSipField() const {
            return urlSipField_;
Julien Bonjean's avatar
Julien Bonjean committed
391
        }
392
        void setUrlSipField(const std::string &u) {
393
            urlSipField_ = u;
Julien Bonjean's avatar
Julien Bonjean committed
394
        }
395

Julien Bonjean's avatar
Julien Bonjean committed
396
    private:
397
398
399
400
401
402
        bool iax2Enabled_;
        std::string numberAddPrefix_;
        bool numberEnabled_;
        bool sipEnabled_;
        std::string urlCommand_;
        std::string urlSipField_;
403
404
405

};

406
class AudioPreference : public Serializable {
Julien Bonjean's avatar
Julien Bonjean committed
407
408
    public:
        AudioPreference();
409
410
        AudioLayer *createAudioLayer();
        AudioLayer *switchAndCreateAudioLayer();
Julien Bonjean's avatar
Julien Bonjean committed
411

412
413
        std::string getAudioApi() const {
            return audioApi_;
414
        }
Julien Bonjean's avatar
Julien Bonjean committed
415

416
        void setAudioApi(const std::string &api) {
417
            audioApi_ = api;
418
        }
Julien Bonjean's avatar
Julien Bonjean committed
419

420
        virtual void serialize(Conf::YamlEmitter *emitter);
Julien Bonjean's avatar
Julien Bonjean committed
421

422
        virtual void unserialize(Conf::MappingNode *map);
Julien Bonjean's avatar
Julien Bonjean committed
423
424

        // alsa preference
425
426
        int getCardin() const {
            return cardin_;
Julien Bonjean's avatar
Julien Bonjean committed
427
        }
428
        void setCardin(int c) {
429
            cardin_ = c;
Julien Bonjean's avatar
Julien Bonjean committed
430
431
        }

432
433
        int getCardout() const {
            return cardout_;
Julien Bonjean's avatar
Julien Bonjean committed
434
        }
435

436
        void setCardout(int c) {
437
            cardout_ = c;
Julien Bonjean's avatar
Julien Bonjean committed
438
439
        }

440
441
        int getCardring() const {
            return cardring_;
Julien Bonjean's avatar
Julien Bonjean committed
442
        }
443

444
        void setCardring(int c) {
445
            cardring_ = c;
Julien Bonjean's avatar
Julien Bonjean committed
446
447
        }

448
449
        std::string getPlugin() const {
            return plugin_;
Julien Bonjean's avatar
Julien Bonjean committed
450
        }
451

452
        void setPlugin(const std::string &p) {
453
            plugin_ = p;
Julien Bonjean's avatar
Julien Bonjean committed
454
455
        }

456
457
        int getSmplrate() const {
            return smplrate_;
Julien Bonjean's avatar
Julien Bonjean committed
458
        }
459
        void setSmplrate(int r) {
460
            smplrate_ = r;
Julien Bonjean's avatar
Julien Bonjean committed
461
462
463
        }

        //pulseaudio preference
464
465
        std::string getDevicePlayback() const {
            return devicePlayback_;
Julien Bonjean's avatar
Julien Bonjean committed
466
        }
467

468
        void setDevicePlayback(const std::string &p) {
469
            devicePlayback_ = p;
Julien Bonjean's avatar
Julien Bonjean committed
470
471
        }

472
473
        std::string getDeviceRecord() const {
            return deviceRecord_;
Julien Bonjean's avatar
Julien Bonjean committed
474
        }
475
        void setDeviceRecord(const std::string &r) {
476
            deviceRecord_ = r;
Julien Bonjean's avatar
Julien Bonjean committed
477
478
        }

479
480
        std::string getDeviceRingtone() const {
            return deviceRingtone_;
Julien Bonjean's avatar
Julien Bonjean committed
481
        }
482

483
        void setDeviceRingtone(const std::string &r) {
484
            deviceRingtone_ = r;
Julien Bonjean's avatar
Julien Bonjean committed
485
486
487
        }

        // general preference
488
489
        std::string getRecordpath() const {
            return recordpath_;
Julien Bonjean's avatar
Julien Bonjean committed
490
        }
491
        void setRecordpath(const std::string &r) {
492
            recordpath_ = r;
Julien Bonjean's avatar
Julien Bonjean committed
493
494
        }

495
496
        bool getIsAlwaysRecording() const {
            return alwaysRecording_;
497
498
499
        }

        void setIsAlwaysRecording(bool rec) {
500
            alwaysRecording_ = rec;
501
502
        }

503
504
        int getVolumemic() const {
            return volumemic_;
Julien Bonjean's avatar
Julien Bonjean committed
505
        }
506
        void setVolumemic(int m) {
507
            volumemic_ = m;
Julien Bonjean's avatar
Julien Bonjean committed
508
509
        }

510
511
        int getVolumespkr() const {
            return volumespkr_;
Julien Bonjean's avatar
Julien Bonjean committed
512
        }
513
        void setVolumespkr(int s) {
514
            volumespkr_ = s;
Julien Bonjean's avatar
Julien Bonjean committed
515
516
        }

517
518
        bool getNoiseReduce() const {
            return noisereduce_;
519
520
        }

521
        void setNoiseReduce(bool noise) {
522
            noisereduce_ = noise;
523
524
        }

525
526
        bool getEchoCancel() const {
            return echocancel_;
527
528
529
        }

        void setEchoCancel(bool echo) {
530
            echocancel_ = echo;
531
532
        }

533
534
        int getEchoCancelTailLength() const {
            return echoCancelTailLength_;
535
536
537
        }

        void setEchoCancelTailLength(int length) {
538
            echoCancelTailLength_ = length;
539
540
        }

541
542
        int getEchoCancelDelay() const {
            return echoCancelDelay_;
543
544
545
        }

        void setEchoCancelDelay(int delay) {
546
            echoCancelDelay_ = delay;
547
548
        }

Julien Bonjean's avatar
Julien Bonjean committed
549
    private:
550
        std::string audioApi_;
Julien Bonjean's avatar
Julien Bonjean committed
551
552

        // alsa preference
553
554
555
556
557
        int cardin_;
        int cardout_;
        int cardring_;
        std::string plugin_;
        int smplrate_;
Julien Bonjean's avatar
Julien Bonjean committed
558
559

        //pulseaudio preference
560
561
562
        std::string devicePlayback_;
        std::string deviceRecord_;
        std::string deviceRingtone_;
Julien Bonjean's avatar
Julien Bonjean committed
563
564

        // general preference
565
566
567
568
569
570
571
572
573
        std::string recordpath_; //: /home/msavard/Bureau
        bool alwaysRecording_;
        int volumemic_;
        int volumespkr_;

        bool noisereduce_;
        bool echocancel_;
        int echoCancelTailLength_;
        int echoCancelDelay_;
574
575
};

576
577
578
579
580
581
582
583
584
585
586
class VideoPreference : public Serializable
{
    public:

        VideoPreference();
        ~VideoPreference();

        virtual void serialize (Conf::YamlEmitter *emitter);

        virtual void unserialize (Conf::MappingNode *map);

587
        std::map<std::string, std::string> getVideoSettings();
588

589
590
        std::string getDevice() const {
            return device_;
591
        }
592

593
        void setDevice(const std::string &device) {
594
            device_ = device;
595
596
        }

597
598
        std::string getChannel() const {
            return channel_;
599
600
        }

601
        void setChannel(const std::string & input) {
602
            channel_ = input;
603
604
        }

605
606
        std::string getSize() const {
            return size_;
607
608
        }

609
        void setSize(const std::string & size) {
610
            size_ = size;
611
612
        }

613
614
        const std::string & getRate() const {
            return rate_;
615
616
        }

617
        void setRate(const std::string & rate) {
618
            rate_ = rate;
619
620
        }

621
622
        std::vector<std::string> getDeviceList() const {
        	return v4l2_list_->getDeviceList();
623
624
        }

625
626
        std::vector<std::string> getChannelList(const std::string &dev) const {
        	return v4l2_list_->getChannelList(dev);
627
628
        }

629
630
        std::vector<std::string> getSizeList(const std::string &dev, const std::string &channel) const {
        	return v4l2_list_->getSizeList(dev, channel);
631
632
        }

633
634
        std::vector<std::string> getRateList(const std::string &dev, const std::string &channel, const std::string &size) const {
        	return v4l2_list_->getRateList(dev, channel, size);
635
636
637
        }


638
    private:
639
        NON_COPYABLE(VideoPreference);
640

641
        // V4L2 devices
642
        sfl_video::VideoV4l2ListThread *v4l2_list_;
643

644
645
646
647
        std::string device_;
        std::string channel_;
        std::string size_;
        std::string rate_;
648
};
649

650
class ShortcutPreferences : public Serializable {
Julien Bonjean's avatar
Julien Bonjean committed
651
    public:
652
        ShortcutPreferences();
653
654
        virtual void serialize(Conf::YamlEmitter *emitter);
        virtual void unserialize(Conf::MappingNode *map);
655

656
        void setShortcuts(std::map<std::string, std::string> shortcuts);
657
        std::map<std::string, std::string> getShortcuts() const;
658

659
660
        std::string getHangup() const {
            return hangup_;
Julien Bonjean's avatar
Julien Bonjean committed
661
        }
662

663
        void setHangup(const std::string &hangup) {
664
            hangup_ = hangup;
Julien Bonjean's avatar
Julien Bonjean committed
665
        }
666

667
668
        std::string getPickup() const {
            return pickup_;
Julien Bonjean's avatar
Julien Bonjean committed
669
        }
670

671
        void setPickup(const std::string &pickup) {
672
            pickup_ = pickup;
Julien Bonjean's avatar
Julien Bonjean committed
673
        }
674

675
676
        std::string getPopup() const {
            return popup_;
Julien Bonjean's avatar
Julien Bonjean committed
677
        }
678

679
        void setPopup(const std::string &popup) {
680
            popup_ = popup;
Julien Bonjean's avatar
Julien Bonjean committed
681
        }
682

683
684
        std::string getToggleHold() const {
            return toggleHold_;
Julien Bonjean's avatar
Julien Bonjean committed
685
        }
686

687
        void setToggleHold(const std::string &hold) {
688
            toggleHold_ = hold;
Julien Bonjean's avatar
Julien Bonjean committed
689
        }
690

691
692
        std::string getTogglePickupHangup() const {
            return togglePickupHangup_;
Julien Bonjean's avatar
Julien Bonjean committed
693
        }
694

695
        void setTogglePickupHangup(const std::string &toggle) {
696
            togglePickupHangup_ = toggle;
Julien Bonjean's avatar
Julien Bonjean committed
697
        }
698

Julien Bonjean's avatar
Julien Bonjean committed
699
    private:
700
701
702
703
704
        std::string hangup_;
        std::string pickup_;
        std::string popup_;
        std::string toggleHold_;
        std::string togglePickupHangup_;
705
706
};

707
#endif