1
/****************************************************************************
2
* Copyright (C) 2014 by Savoir-Faire Linux *
3
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
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. *
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. *
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
***************************************************************************/
24
* This class allow to get and set the different hooks
26
class LIB_EXPORT HookManager : public QObject
31
static HookManager* instance();
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 )
42
QString prefix () const;
43
QString sipFeild () const;
44
QString command () const;
45
bool isIax2Enabled () const;
46
bool isSipEnabled () const;
47
bool isPhoneNumberEnabled() const;
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 );
58
explicit HookManager();
59
virtual ~HookManager();
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" ;
78
bool m_PhoneNumberEnabled;
80
static HookManager* m_spInstance;
b'\\ No newline at end of file'