1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CELLULARINDICATORPLUGIN_H |
|
19 #define CELLULARINDICATORPLUGIN_H |
|
20 |
|
21 #include <hbindicatorplugininterface.h> |
|
22 #include <hbindicatorinterface.h> |
|
23 #include <QtCore/QProcess> |
|
24 #include <QtCore/QVariant> |
|
25 #include <QSharedPointer> |
|
26 |
|
27 // Forward declarations |
|
28 class HbTranslator; |
|
29 |
|
30 /** |
|
31 * This class describes cellular indicator plug-in |
|
32 */ |
|
33 class CellularIndicatorPlugin : public HbIndicatorInterface, |
|
34 public HbIndicatorPluginInterface |
|
35 { |
|
36 |
|
37 Q_OBJECT |
|
38 Q_INTERFACES(HbIndicatorPluginInterface) |
|
39 |
|
40 public: |
|
41 |
|
42 CellularIndicatorPlugin(); |
|
43 ~CellularIndicatorPlugin(); |
|
44 |
|
45 public: |
|
46 |
|
47 //from HbIndicatorPluginInterface |
|
48 |
|
49 // Return indicator type of indicator |
|
50 QStringList indicatorTypes() const; |
|
51 |
|
52 // Access is allowed allways |
|
53 bool accessAllowed(const QString &indicatorType, |
|
54 const QVariantMap &securityInfo) const; |
|
55 |
|
56 // Create indicator. Currently installs translation. |
|
57 HbIndicatorInterface* createIndicator(const QString &indicatorType); |
|
58 |
|
59 // Return error if any |
|
60 int error() const; |
|
61 |
|
62 public: |
|
63 |
|
64 //from HbIndicatorInterface |
|
65 |
|
66 // Client requests are directed to here |
|
67 bool handleClientRequest (RequestType type, const QVariant ¶meter); |
|
68 |
|
69 // This called when item is selected in indicator menu |
|
70 bool handleInteraction(InteractionType type); |
|
71 |
|
72 // Used to get indicator data (icon or text) |
|
73 QVariant indicatorData(int role) const; |
|
74 |
|
75 private: // data |
|
76 |
|
77 // Disable copy constructor |
|
78 Q_DISABLE_COPY(CellularIndicatorPlugin) |
|
79 // Indicator type |
|
80 QStringList mIndicatorTypes; |
|
81 // Error stored to member variable |
|
82 int mError; |
|
83 // Used to store the connection info |
|
84 QVariant mParameter; |
|
85 // Process to start external programs |
|
86 QProcess process; |
|
87 |
|
88 // Translator for the localisation Text Id's |
|
89 QSharedPointer<HbTranslator> mTranslator; |
|
90 |
|
91 }; |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 #endif // CELLULARINDICATORPLUGIN_H |
|