|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Accessory Indicator class |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef ACCINDICATOR_H |
|
19 #define ACCINDICATOR_H |
|
20 |
|
21 #include <QObject> |
|
22 |
|
23 #include <QVariant> |
|
24 #include <QtCore/QProcess> |
|
25 |
|
26 #include <hbindicatorinterface.h> |
|
27 #include <hbindicatorplugininterface.h> |
|
28 |
|
29 #include <accpolaccessorymode.h> |
|
30 |
|
31 /** |
|
32 * Accessory indicator class. |
|
33 * Handles client request and shows the indications. |
|
34 */ |
|
35 class AccIndicatorPlugin : public HbIndicatorInterface, public HbIndicatorPluginInterface |
|
36 { |
|
37 Q_OBJECT |
|
38 Q_INTERFACES(HbIndicatorPluginInterface) |
|
39 public: |
|
40 |
|
41 AccIndicatorPlugin(); |
|
42 ~AccIndicatorPlugin(); |
|
43 public: |
|
44 //from HbindicatorInterface |
|
45 bool handleInteraction(InteractionType type); |
|
46 QVariant indicatorData(int role) const; |
|
47 |
|
48 public: |
|
49 //from HbIndicatorPluginInterface |
|
50 QStringList indicatorTypes() const; |
|
51 bool accessAllowed(const QString &indicatorType, |
|
52 const HbSecurityInfo *securityInfo) const; |
|
53 HbIndicatorInterface* createIndicator(const QString &indicatorType); |
|
54 int error() const; |
|
55 |
|
56 protected: |
|
57 //from HbindicatorInterface |
|
58 bool handleClientRequest(RequestType type, const QVariant ¶meter); |
|
59 |
|
60 private: |
|
61 void prepareDisplayName(); |
|
62 |
|
63 private: |
|
64 |
|
65 QString mDisplayName; |
|
66 QProcess mProcess; |
|
67 TAccMode mAccMode; |
|
68 int mAccType; |
|
69 QStringList mIndicatorTypes; |
|
70 QStringList mArgs; |
|
71 |
|
72 private slots: |
|
73 void processError(QProcess::ProcessError err); // handler for error codes |
|
74 |
|
75 private: |
|
76 Q_DISABLE_COPY(AccIndicatorPlugin) |
|
77 int mError; |
|
78 }; |
|
79 |
|
80 #endif // ACCINDICATOR_H |
|
81 |