~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to daemon/src/preferences.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-05-19 21:46:37 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120519214637-la8rbrford5kj6m3
Tags: 1.1.0-1
* New upstream release 
  - Fixes "FTBFS with libccrtp-dev/2.0.2 from experimental" (Closes: #663282)
* NEW Maintainer: Debian VoIP Team - Thanks Francois for your work.
  - (Closes: #665789: O: sflphone -- SIP and IAX2 compatible VoIP phone)
* Added Build-Depends: libdbus-c++-bin
* Add gcc47-fixes.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#define __PREFERENCE_H__
33
33
 
34
34
#include "config/serializable.h"
35
 
 
36
 
// general preferences
37
 
static const char * const orderKey = "order";
38
 
static const char * const audioApiKey = "audioApi";
39
 
static const char * const historyLimitKey = "historyLimit";
40
 
static const char * const historyMaxCallsKey = "historyMaxCalls";
41
 
static const char * const  notifyMailsKey = "notifyMails";
42
 
static const char * const zoneToneChoiceKey = "zoneToneChoice";
43
 
static const char * const registrationExpireKey = "registrationExpire";
44
 
static const char * const portNumKey = "portNum";
45
 
static const char * const searchBarDisplayKey = "searchBarDisplay";
46
 
static const char * const zeroConfenableKey = "zeroConfenable";
47
 
static const char * const md5HashKey = "md5Hash";
48
 
 
49
 
// voip preferences
50
 
static const char * const playDtmfKey = "playDtmf";
51
 
static const char * const playTonesKey = "playTones";
52
 
static const char * const pulseLengthKey = "pulseLength";
53
 
static const char * const symmetricRtpKey = "symmetric";
54
 
static const char * const zidFileKey = "zidFile";
55
 
 
56
 
// addressbook preferences
57
 
static const char * const photoKey = "photo";
58
 
static const char * const enabledKey = "enabled";
59
 
static const char * const listKey = "list";
60
 
static const char * const maxResultsKey = "maxResults";
61
 
static const char * const businessKey = "business";
62
 
static const char * const homeKey = "home";
63
 
static const char * const mobileKey = "mobile";
64
 
 
65
 
// hooks preferences
66
 
static const char * const iax2EnabledKey = "iax2Enabled";
67
 
static const char * const numberAddPrefixKey = "numberAddPrefix";
68
 
static const char * const numberEnabledKey = "numberEnabled";
69
 
static const char * const sipEnabledKey = "sipEnabled";
70
 
static const char * const urlCommandKey = "urlCommand";
71
 
static const char * const urlSipFieldKey = "urlSipField";
72
 
 
73
 
// audio preferences
74
 
static const char * const alsamapKey = "alsa";
75
 
static const char * const pulsemapKey = "pulse";
76
 
static const char * const cardinKey = "cardIn";
77
 
static const char * const cardoutKey = "cardOut";
78
 
static const char * const cardringKey = "cardRing";
79
 
static const char * const pluginKey = "plugin";
80
 
static const char * const smplrateKey = "smplRate";
81
 
static const char * const devicePlaybackKey = "devicePlayback";
82
 
static const char * const deviceRecordKey = "deviceRecord";
83
 
static const char * const deviceRingtoneKey = "deviceRingtone";
84
 
static const char * const recordpathKey = "recordPath";
85
 
static const char * const alwaysRecordingKey = "alwaysRecording";
86
 
static const char * const volumemicKey = "volumeMic";
87
 
static const char * const volumespkrKey = "volumeSpkr";
88
 
static const char * const noiseReduceKey = "noiseReduce";
89
 
static const char * const echoCancelKey = "echoCancel";
90
 
static const char * const echoTailKey = "echoTailLength";
91
 
static const char * const echoDelayKey = "echoDelayLength";
92
 
 
93
 
// shortcut preferences
94
 
static const char * const hangupShortKey = "hangUp";
95
 
static const char * const pickupShortKey = "pickUp";
96
 
static const char * const popupShortKey = "popupWindow";
97
 
static const char * const toggleHoldShortKey = "toggleHold";
98
 
static const char * const togglePickupHangupShortKey = "togglePickupHangup";
 
35
#include <string>
 
36
#include <map>
99
37
 
100
38
class AudioLayer;
101
39
 
102
40
class Preferences : public Serializable {
103
41
    public:
104
42
        static const char * const DFT_ZONE;
 
43
        static const char * const REGISTRATION_EXPIRE_KEY;
105
44
 
106
45
        Preferences();
107
46
 
108
 
        virtual void serialize(Conf::YamlEmitter *emitter);
109
 
 
110
 
        virtual void unserialize(Conf::MappingNode *map);
 
47
        virtual void serialize(Conf::YamlEmitter &emitter);
 
48
        virtual void unserialize(const Conf::MappingNode &map);
111
49
 
112
50
        std::string getAccountOrder() const {
113
51
            return accountOrder_;
204
142
    public:
205
143
        VoipPreference();
206
144
 
207
 
        virtual void serialize(Conf::YamlEmitter *emitter);
208
 
 
209
 
        virtual void unserialize(Conf::MappingNode *map);
 
145
        virtual void serialize(Conf::YamlEmitter &emitter);
 
146
        virtual void unserialize(const Conf::MappingNode &map);
210
147
 
211
148
        bool getPlayDtmf() const {
212
149
            return playDtmf_;
259
196
    public:
260
197
        AddressbookPreference();
261
198
 
262
 
        virtual void serialize(Conf::YamlEmitter *emitter);
263
 
 
264
 
        virtual void unserialize(Conf::MappingNode *map);
 
199
        virtual void serialize(Conf::YamlEmitter &emitter);
 
200
        virtual void unserialize(const Conf::MappingNode &map);
265
201
 
266
202
        bool getPhoto() const {
267
203
            return photo_;
326
262
        bool business_;
327
263
        bool home_;
328
264
        bool mobile_;
329
 
 
330
265
};
331
266
 
332
267
 
 
268
class pjsip_msg;
 
269
 
333
270
class HookPreference : public Serializable {
334
271
    public:
335
272
        HookPreference();
336
 
 
337
 
        virtual void serialize(Conf::YamlEmitter *emitter);
338
 
 
339
 
        virtual void unserialize(Conf::MappingNode *map);
340
 
 
341
 
        bool getIax2Enabled() const {
342
 
            return iax2Enabled_;
343
 
        }
344
 
 
345
 
        void setIax2Enabled(bool i) {
346
 
            iax2Enabled_ = i;
347
 
        }
 
273
        HookPreference(const std::map<std::string, std::string> &settings);
 
274
 
 
275
        virtual void serialize(Conf::YamlEmitter &emitter);
 
276
        virtual void unserialize(const Conf::MappingNode &map);
348
277
 
349
278
        std::string getNumberAddPrefix() const {
350
 
            return numberAddPrefix_;
351
 
        }
352
 
 
353
 
        void setNumberAddPrefix(const std::string &n) {
354
 
            numberAddPrefix_ = n;
355
 
        }
356
 
 
357
 
        bool getNumberEnabled() const {
358
 
            return numberEnabled_;
359
 
        }
360
 
 
361
 
        void setNumberEnabled(bool n) {
362
 
            numberEnabled_ = n;
363
 
        }
364
 
 
365
 
        bool getSipEnabled() const {
366
 
            return sipEnabled_;
367
 
        }
368
 
 
369
 
        void setSipEnabled(bool s) {
370
 
            sipEnabled_ = s;
371
 
        }
372
 
 
373
 
        std::string getUrlCommand() const {
374
 
            return urlCommand_;
375
 
        }
376
 
        void setUrlCommand(const std::string &u) {
377
 
            urlCommand_ = u;
378
 
        }
379
 
 
380
 
        std::string getUrlSipField() const {
381
 
            return urlSipField_;
382
 
        }
383
 
        void setUrlSipField(const std::string &u) {
384
 
            urlSipField_ = u;
385
 
        }
 
279
            if (numberEnabled_)
 
280
                return numberAddPrefix_;
 
281
            else
 
282
                return "";
 
283
        }
 
284
 
 
285
        std::map<std::string, std::string> toMap() const;
 
286
        void runHook(pjsip_msg *msg);
386
287
 
387
288
    private:
388
289
        bool iax2Enabled_;
391
292
        bool sipEnabled_;
392
293
        std::string urlCommand_;
393
294
        std::string urlSipField_;
394
 
 
395
295
};
396
296
 
397
297
class AudioPreference : public Serializable {
408
308
            audioApi_ = api;
409
309
        }
410
310
 
411
 
        virtual void serialize(Conf::YamlEmitter *emitter);
412
 
 
413
 
        virtual void unserialize(Conf::MappingNode *map);
 
311
        virtual void serialize(Conf::YamlEmitter &emitter);
 
312
        virtual void unserialize(const Conf::MappingNode &map);
414
313
 
415
314
        // alsa preference
416
315
        int getCardin() const {
567
466
class ShortcutPreferences : public Serializable {
568
467
    public:
569
468
        ShortcutPreferences();
570
 
        virtual void serialize(Conf::YamlEmitter *emitter);
571
 
        virtual void unserialize(Conf::MappingNode *map);
 
469
        virtual void serialize(Conf::YamlEmitter &emitter);
 
470
        virtual void unserialize(const Conf::MappingNode &map);
572
471
 
573
472
        void setShortcuts(std::map<std::string, std::string> shortcuts);
574
473
        std::map<std::string, std::string> getShortcuts() const;