equal
deleted
inserted
replaced
1 /* |
|
2 * Copyright (c) 2009-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 #ifndef CXUISELFTIMER_H |
|
18 #define CXUISELFTIMER_H |
|
19 |
|
20 #include <QObject> |
|
21 #include <QTimer> |
|
22 #include <QSound> |
|
23 #include <QVariant> |
|
24 |
|
25 class CxeSettings; |
|
26 class CxuiDocumentLoader; |
|
27 class HbLabel; |
|
28 class HbPushButton; |
|
29 class HbWidget; |
|
30 |
|
31 class CxuiSelfTimer : public QObject |
|
32 { |
|
33 Q_OBJECT |
|
34 |
|
35 public: |
|
36 explicit CxuiSelfTimer(CxeSettings &mSettings); |
|
37 ~CxuiSelfTimer(); |
|
38 |
|
39 void loadSelftimerWidgets(CxuiDocumentLoader *documentLoader); |
|
40 bool isEnabled(); |
|
41 bool isOngoing(); |
|
42 |
|
43 int getTimeout() const; |
|
44 signals: |
|
45 void timerFinished(); |
|
46 void cancelled(); |
|
47 |
|
48 public slots: |
|
49 void changeTimeOut(int seconds); |
|
50 void startTimer(); |
|
51 void reset(bool update = true); |
|
52 void cancel(); |
|
53 void enableSound(long int uid, unsigned long int key, QVariant value); |
|
54 |
|
55 protected slots: |
|
56 void timeout(); |
|
57 |
|
58 private: |
|
59 void updateWidgets(); |
|
60 void showWidgets(); |
|
61 void hideWidgets(); |
|
62 void playSound(); |
|
63 |
|
64 private: |
|
65 Q_DISABLE_COPY(CxuiSelfTimer) |
|
66 |
|
67 int mDelay; |
|
68 int mCounter; |
|
69 QTimer mTimer; |
|
70 int mOldPostCaptureTimeOut; |
|
71 |
|
72 // UI widgets, not own |
|
73 HbWidget *mWidgetContainer; |
|
74 HbLabel *mTimerLabel; |
|
75 HbPushButton *mCancelButton; |
|
76 HbPushButton *mStartButton; |
|
77 |
|
78 // settings, not own |
|
79 CxeSettings &mSettings; |
|
80 |
|
81 QSound mSound; |
|
82 bool mUseSound; |
|
83 }; |
|
84 |
|
85 #endif // CXUISELFTIMER_H |
|