~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2015-01-07 14:51:16 UTC
  • mfrom: (4.3.5 sid)
  • Revision ID: package-import@ubuntu.com-20150107145116-yxnafinf4lrdvrmx
Tags: 1.4.1-0.1ubuntu1
* Merge with Debian, remaining changes:
 - Drop soprano, nepomuk build-dep
* Drop ubuntu patches, now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
 *   Copyright (C) 2014 by Savoir-Faire Linux                               *
 
3
 *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
 
4
 *                                                                          *
 
5
 *   This library is free software; you can redistribute it and/or          *
 
6
 *   modify it under the terms of the GNU Lesser General Public             *
 
7
 *   License as published by the Free Software Foundation; either           *
 
8
 *   version 2.1 of the License, or (at your option) any later version.     *
 
9
 *                                                                          *
 
10
 *   This library 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 GNU      *
 
13
 *   Lesser General Public License for more details.                        *
 
14
 *                                                                          *
 
15
 *   You should have received a copy of the GNU General Public License      *
 
16
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
 
17
 ***************************************************************************/
 
18
#ifndef HOOKMANAGER_H
 
19
#define HOOKMANAGER_H
 
20
 
 
21
#include "typedefs.h"
 
22
 
 
23
/**
 
24
 * This class allow to get and set the different hooks
 
25
 */
 
26
class LIB_EXPORT HookManager : public QObject
 
27
{
 
28
   Q_OBJECT
 
29
 
 
30
public:
 
31
   static HookManager* instance();
 
32
 
 
33
   //Properties
 
34
   Q_PROPERTY(QString prefix              READ prefix               WRITE setPrefix             )
 
35
   Q_PROPERTY(QString sipFeild            READ sipFeild             WRITE setSipFeild           )
 
36
   Q_PROPERTY(QString command             READ command              WRITE setCommand            )
 
37
   Q_PROPERTY(bool    iax2Enabled         READ isIax2Enabled        WRITE setIax2Enabled        )
 
38
   Q_PROPERTY(bool    sipEnabled          READ isSipEnabled         WRITE setSipEnabled         )
 
39
   Q_PROPERTY(bool    phoneNumberEnabled  READ isPhoneNumberEnabled WRITE setPhoneNumberEnabled )
 
40
 
 
41
   //Getters
 
42
   QString prefix           () const;
 
43
   QString sipFeild         () const;
 
44
   QString command          () const;
 
45
   bool isIax2Enabled       () const;
 
46
   bool isSipEnabled        () const;
 
47
   bool isPhoneNumberEnabled() const;
 
48
 
 
49
   //Setters
 
50
   void setPrefix             (const QString& prefix );
 
51
   void setSipFeild           (const QString& field  );
 
52
   void setCommand            (const QString& command);
 
53
   void setIax2Enabled        (bool enabled          );
 
54
   void setSipEnabled         (bool enabled          );
 
55
   void setPhoneNumberEnabled (bool enabled          );
 
56
 
 
57
private:
 
58
   explicit HookManager();
 
59
   virtual ~HookManager();
 
60
   void save();
 
61
 
 
62
   class Names {
 
63
   public:
 
64
      constexpr static const char* PHONE_NUMBER_HOOK_ADD_PREFIX = "PHONE_NUMBER_HOOK_ADD_PREFIX";
 
65
      constexpr static const char* URLHOOK_SIP_FIELD            = "URLHOOK_SIP_FIELD"           ;
 
66
      constexpr static const char* URLHOOK_COMMAND              = "URLHOOK_COMMAND"             ;
 
67
      constexpr static const char* URLHOOK_IAX2_ENABLED         = "URLHOOK_IAX2_ENABLED"        ;
 
68
      constexpr static const char* URLHOOK_SIP_ENABLED          = "URLHOOK_SIP_ENABLED"         ;
 
69
      constexpr static const char* PHONE_NUMBER_HOOK_ENABLED    = "PHONE_NUMBER_HOOK_ENABLED"   ;
 
70
   };
 
71
 
 
72
   //Attributes
 
73
   QString m_AddPrefix      ;
 
74
   QString m_SipFeild       ;
 
75
   QString m_Command        ;
 
76
   bool m_Iax2Enabled       ;
 
77
   bool m_SipEnabled        ;
 
78
   bool m_PhoneNumberEnabled;
 
79
 
 
80
   static HookManager* m_spInstance;
 
81
};
 
82
 
 
83
#endif
 
 
b'\\ No newline at end of file'