46
|
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 cleanupMemory();
|
|
56 |
|
|
57 |
private:
|
|
58 |
void customizeVolumeSlider();
|
|
59 |
void setSpeakerIcon();
|
|
60 |
bool IsValidHandles();
|
|
61 |
|
|
62 |
private slots:
|
|
63 |
void handleVolumeChanged(int aVolume);
|
|
64 |
void handleSilenceMode(bool aState);
|
|
65 |
void handleVibrationToggled(int aVibrationToggel);
|
|
66 |
void handleOfflineToggled(int aOfflineToggel);
|
|
67 |
void handlePowerOff(bool aState);
|
|
68 |
void closedialog();
|
|
69 |
|
|
70 |
signals:
|
|
71 |
void deviceDialogClosed();
|
|
72 |
void deviceDialogData(QVariantMap data);
|
|
73 |
|
|
74 |
private:
|
|
75 |
Q_DISABLE_COPY(HbDevicePowerMenuWidget)
|
|
76 |
|
|
77 |
int mDeviceDialogError; //DeviceDialogError
|
|
78 |
int mVolumeLevel; //shows current Volume Level
|
|
79 |
bool mShowVolume; //used to Enable or Disbale Volume
|
|
80 |
bool mVibrationChecked; //Vibration enabled or Disabled
|
|
81 |
bool mOfflineChecked; //offline enabled or Disabled
|
|
82 |
bool mSilencelatched; //SilenceMode Enabled or Disabled
|
|
83 |
bool mCypherOff; //Shows Encryption/Decryption ON/OFF
|
|
84 |
|
|
85 |
HbDialog* mDialogWidget; //Handle for Powermenu Dialog
|
|
86 |
HbPushButton* mSilenceButton; //Handle for Silence button
|
|
87 |
HbSlider* mVolumeSlider; //Handle for Slider
|
|
88 |
HbCheckBox* mVibarte; //Handle for Vibration check Box
|
|
89 |
HbCheckBox* mOffline; //Handle for Offline CheckBox
|
|
90 |
HbPushButton * mPowerOffButton; //Handle for PowerOff Button
|
|
91 |
HbDocumentLoader* mLoader; //Hnadle for Documnet Loader to load docml
|
|
92 |
HbTranslator* mHbTranslator; //Translator used for localization; loads translation files
|
|
93 |
};
|
|
94 |
|
|
95 |
#endif // HBDEVICEPOWERMENUWIDEGT_P_H
|