|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HBDEVICEPOWERMENUWIDEGT_P_H |
|
19 #define HBDEVICEPOWERMENUWIDEGT_P_H |
|
20 |
|
21 |
|
22 #include <QObject> |
|
23 #include <QVariantMap> |
|
24 #include <hbdevicedialoginterface.h> |
|
25 #include <hbdevicedialog.h> |
|
26 #include <hbdialog.h> |
|
27 #include <hbdocumentloader.h> |
|
28 #include <HbTranslator.h> |
|
29 //For widgets used |
|
30 #include <hbpushbutton.h> |
|
31 #include <hbslider.h> |
|
32 #include <hbcheckBox.h> |
|
33 #include <hbinstance.h> |
|
34 |
|
35 class HbDevicePowerMenuWidget : public QObject, public HbDeviceDialogInterface |
|
36 { |
|
37 Q_OBJECT |
|
38 |
|
39 public: |
|
40 HbDevicePowerMenuWidget(const QVariantMap ¶meters); |
|
41 ~HbDevicePowerMenuWidget(); |
|
42 |
|
43 public: |
|
44 //HbDeviceDialogInterface methods to be implemented |
|
45 bool setDeviceDialogParameters(const QVariantMap ¶meters); |
|
46 int deviceDialogError() const; |
|
47 void closeDeviceDialog(bool byClient); |
|
48 HbPopup *deviceDialogWidget() const; |
|
49 virtual QObject *signalSender() const; |
|
50 |
|
51 |
|
52 private: |
|
53 bool preConstructDialog(); |
|
54 void constructDialog(const QVariantMap ¶meters); |
|
55 void hideEvent(QHideEvent *event); |
|
56 void showEvent(QShowEvent *event); |
|
57 void cleanupMemory(); |
|
58 |
|
59 private: |
|
60 void customizeVolumeSlider(); |
|
61 void setSpeakerIcon(); |
|
62 bool IsValidHandles(); |
|
63 |
|
64 private slots: |
|
65 void handleVolumeChanged(int aVolume); |
|
66 void handleSilenceMode(bool aState); |
|
67 void handleVibrationToggled(int aVibrationToggel); |
|
68 void handleOfflineToggled(int aOfflineToggel); |
|
69 void handlePowerOff(bool aState); |
|
70 //void setDialogWidget(Qt::Orientation); |
|
71 void closedialog(); |
|
72 |
|
73 signals: |
|
74 void deviceDialogClosed(); |
|
75 void deviceDialogData(QVariantMap data); |
|
76 |
|
77 private: |
|
78 Q_DISABLE_COPY(HbDevicePowerMenuWidget) |
|
79 |
|
80 int mDeviceDialogError; //DeviceDialogError |
|
81 int mVolumeLevel; //shows current Volume Level |
|
82 bool mShowVolume; //used to Enable or Disbale Volume |
|
83 bool mVibrationChecked; //Vibration enabled or Disabled |
|
84 bool mOfflineChecked; //offline enabled or Disabled |
|
85 bool mSilencelatched; //SilenceMode Enabled or Disabled |
|
86 bool mCypherOff; //Shows Encryption/Decryption ON/OFF |
|
87 |
|
88 HbDialog* mDialogWidget; //Handle for Powermenu Dialog |
|
89 HbPushButton* mSilenceButton; //Handle for Silence button |
|
90 HbSlider* mVolumeSlider; //Handle for Slider |
|
91 HbCheckBox* mVibarte; //Handle for Vibration check Box |
|
92 HbCheckBox* mOffline; //Handle for Offline CheckBox |
|
93 HbPushButton * mPowerOffButton; //Handle for PowerOff Button |
|
94 HbDocumentLoader* mLoader; //Hnadle for Documnet Loader to load docml |
|
95 //HbMainWindow* mMainWindow; //Handle for mainWindow, used to Catch Orientation changes |
|
96 HbTranslator* mHbTranslator; //Translator used for localization; loads translation files |
|
97 }; |
|
98 |
|
99 #endif // HBDEVICEPOWERMENUWIDEGT_P_H |