1 /*\r
2 * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/\r
3 *\r
4 *\r
5 * Redistribution and use in source and binary forms, with or without\r
6 * modification, are permitted provided that the following conditions\r
7 * are met:\r
8 *\r
9 * Redistributions of source code must retain the above copyright\r
10 * notice, this list of conditions and the following disclaimer.\r
11 *\r
12 * Redistributions in binary form must reproduce the above copyright\r
13 * notice, this list of conditions and the following disclaimer in the\r
14 * documentation and/or other materials provided with the\r
15 * distribution.\r
16 *\r
17 * Neither the name of Texas Instruments Incorporated nor the names of\r
18 * its contributors may be used to endorse or promote products derived\r
19 * from this software without specific prior written permission.\r
20 *\r
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
32 *\r
33 */\r
34 #ifndef KEYWORD_H\r
35 #define KEYWORD_H\r
36 \r
37 #include <QByteArray>\r
38 #include <QObject>\r
39 \r
40 \r
41 QT_USE_NAMESPACE\r
42 \r
43 QT_BEGIN_NAMESPACE\r
44 \r
45 QT_END_NAMESPACE\r
46 \r
47 class Keyword : public QObject\r
48 {\r
49 Q_OBJECT\r
50 \r
51 public:\r
52 Keyword(QObject *object);\r
53 ~Keyword();\r
54 char m_keyword[4] = {6, 8, 4, 3};\r
55 \r
56 signals:\r
57 void keywordMatched();\r
58 \r
59 public slots:\r
60 void handleDownGesture();\r
61 void handleRightGesture();\r
62 void handleMotionDetected();\r
63 void handleNoActivity();\r
64 \r
65 private:\r
66 QObject *m_digitArray[4] = {nullptr};\r
67 unsigned char m_counter[4] = {0, 0, 4, 4};\r
68 unsigned char m_activeIndex = 0;\r
69 QObject *m_qmlCompObject;\r
70 };\r
71 \r
72 #endif\r