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 #ifndef CXUISTANDBY_H |
|
18 #define CXUISTANDBY_H |
|
19 |
|
20 #include <QObject> |
|
21 |
|
22 // constants |
|
23 |
|
24 const int CXUI_STANDBY_CAMERA_TIMEOUT = 60000; // 60 seconds |
|
25 |
|
26 // forward declaration |
|
27 class HbDialog; |
|
28 class QTimer; |
|
29 class CxeEngine; |
|
30 class CxuiDocumentLoader; |
|
31 class CxuiCaptureKeyHandler; |
|
32 |
|
33 |
|
34 /* |
|
35 * class CxuiStandby continuously monitors for releasing camera when there are no user actions |
|
36 * for a specific time period. Timer is used to release the camera HW and switching to stanby mode |
|
37 * after a delay.Releasing the camera improves power efficiency, but creates additional latency |
|
38 * when returning to pre-capture view. |
|
39 */ |
|
40 class CxuiStandby : public QObject |
|
41 { |
|
42 Q_OBJECT |
|
43 |
|
44 public: |
|
45 CxuiStandby(CxuiCaptureKeyHandler &keyHandler, CxuiDocumentLoader *documentLoader, CxeEngine *engine); |
|
46 ~CxuiStandby(); |
|
47 |
|
48 signals: |
|
49 |
|
50 /* |
|
51 * signal to prepare for standby |
|
52 */ |
|
53 void aboutToEnterStandby(); |
|
54 |
|
55 /* |
|
56 * signal to prepare UI for exiting standby |
|
57 */ |
|
58 void aboutToExitStandby(); |
|
59 |
|
60 public slots: |
|
61 |
|
62 /* |
|
63 * starts standby timer |
|
64 */ |
|
65 void startTimer(); |
|
66 |
|
67 /* |
|
68 * stops standby timer |
|
69 */ |
|
70 void stopTimer(); |
|
71 |
|
72 /* |
|
73 * handles focus gain event |
|
74 */ |
|
75 bool handleMouseEvent(); |
|
76 |
|
77 private slots: |
|
78 |
|
79 void dismissStandby(); |
|
80 void toStandby(); |
|
81 |
|
82 private: // helper methods |
|
83 |
|
84 bool proceedToStandy(); |
|
85 bool eventFilter(QObject *object, QEvent *event); |
|
86 |
|
87 private: |
|
88 |
|
89 CxuiCaptureKeyHandler &mKeyHandler; |
|
90 CxuiDocumentLoader *mDocumentLoader; // not own |
|
91 CxeEngine *mEngine; // not own |
|
92 HbDialog *mStandbyPopup; |
|
93 QTimer *mStandbyTimer; |
|
94 bool mStandbyDialogVisible; |
|
95 }; |
|
96 |
|
97 #endif // CXUISTANDBY_H |
|