Revamping the build such that passing in VERBOSE in the CONFIG will
[profile/ivi/hfdialer.git] / src / common.h
1 /*
2  * hfdialer - Hands Free Voice Call Manager
3  * Copyright (c) 2012, Intel Corporation.
4  *
5  * This program is licensed under the terms and conditions of the
6  * Apache License, version 2.0.  The full text of the Apache License is at
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  */
10
11 #ifndef COMMON_H
12 #define COMMON_H
13
14
15 #ifdef VERBOSE 
16 #include <QDebug>
17 #define TRACE qDebug() << "[" << __FILE__ << "]" << __func__ << "():" << __LINE__;
18 #else
19 #define TRACE
20 #endif
21
22 /*
23  * Commonly used QRegExp expressions
24  */
25 #include <QRegExp>
26 #define MATCH_ANY(p) QRegExp(p,Qt::CaseInsensitive,QRegExp::FixedString)
27 #define MATCH_ALL QRegExp()
28
29 /*
30  * Commonly used values for MNotifications
31  */
32 #define DEFAULT_AVATAR_ICON "icon-m-content-avatar-placeholder"
33 #define NOTIFICATION_CALL_EVENT "x-nokia.call"
34
35 /*
36  * Convienence macro for showing TBD message
37  */
38 #define SHOW_TBD \
39     MainWindow *w = dynamic_cast<MainWindow *>(DialerApplication::instance()->activeApplicationWindow()); \
40     if (w) \
41        w->showTBD();
42
43 /*
44  * Convience macro for checking available dialer modes
45  */
46 #define CONFIG_KEY_TARGET_MODE "/apps/dialer/mode"
47 #define MODE_HFP_STR "hfp"
48 #define MODE_HANDSET_STR "handset"
49 #define MODE_HFP_ENABLED DC->modes().contains(MODE_HFP_STR)
50 #define MODE_HANDSET_ENABLED DC->modes().contains(MODE_HANDSET_STR)
51 QString stripLineID(QString lineid);
52
53 bool currentPageIs(int pagenum);
54
55 #include <QDateTime>
56 QDateTime qDateTimeFromOfono(const QString &val);
57
58 #endif // COMMON_H