43 |
43 |
44 virtual ~CxuiVideoPrecaptureView(); |
44 virtual ~CxuiVideoPrecaptureView(); |
45 |
45 |
46 public: |
46 public: |
47 |
47 |
48 /** |
|
49 * Construct-method handles initialisation tasks for this class. |
|
50 * @param mainwindow |
|
51 * @param engine |
|
52 * @param documentLoader |
|
53 * @param keyHandler |
|
54 */ |
|
55 void construct(HbMainWindow *mainwindow, CxeEngine *engine, |
48 void construct(HbMainWindow *mainwindow, CxeEngine *engine, |
56 CxuiDocumentLoader *documentLoader, |
49 CxuiDocumentLoader *documentLoader, |
57 CxuiCaptureKeyHandler *keyHandler = NULL); |
50 CxuiCaptureKeyHandler *keyHandler, |
|
51 HbActivityManager *activityManager); |
58 |
52 |
59 /** |
|
60 * Loads widgets that are needed right from the start. |
|
61 */ |
|
62 virtual void loadDefaultWidgets(); |
53 virtual void loadDefaultWidgets(); |
63 |
54 |
64 /** |
|
65 * Loads widgets that are not part of the default section in layouts xml. |
|
66 * Widgets are created at the time they are first loaded. |
|
67 */ |
|
68 virtual void loadWidgets(); |
55 virtual void loadWidgets(); |
69 |
56 |
70 void updateOrientation(Qt::Orientation orientation); |
57 void restoreActivity(const QString &activityId, const QVariant &data); |
|
58 void saveActivity(); |
|
59 void clearActivity(); |
71 |
60 |
72 public slots: |
61 public slots: |
73 |
62 |
74 // from CxuiPrecaptureView |
63 // from CxuiPrecaptureView |
75 virtual void handleSettingValueChanged(const QString& key, QVariant newValue); |
64 virtual void handleSettingValueChanged(const QString& key, QVariant newValue); |
76 |
65 |
|
66 void handleSceneChanged(CxeScene &scene); |
77 void handleQuitClicked(); |
67 void handleQuitClicked(); |
78 |
68 |
79 protected slots: |
69 protected slots: |
80 |
70 |
81 void handleSnapshot(CxeError::Id error); |
71 void handleSnapshot(CxeError::Id error); |
82 void record(); |
72 void record(); |
83 void pause(); |
73 void pause(); |
84 void stop(); |
74 void stop(); |
85 void stopAndPrepareNewVideo(); |
|
86 void goToStill(); |
75 void goToStill(); |
87 void showEvent(QShowEvent *event); |
76 void showEvent(QShowEvent *event); |
88 void handleVideoStateChanged(CxeVideoCaptureControl::State newState, CxeError::Id error); |
77 void handleVideoStateChanged(CxeVideoCaptureControl::State newState, CxeError::Id error); |
89 void handleCaptureKeyPressed(); |
78 void handleCaptureKeyPressed(); |
90 void prepareNewVideo(CxeError::Id error = CxeError::None); |
79 void prepareNewVideo(CxeError::Id error = CxeError::None); |
91 void toggleLight(); |
|
92 void launchVideoScenePopup(); |
80 void launchVideoScenePopup(); |
93 void launchSetting(); |
81 void launchSetting(); |
94 |
|
95 /** |
|
96 * Application focus slots are called if focus state is changed. |
|
97 * Recording is stopped and camera released or reserved according to new state. |
|
98 */ |
|
99 void handleFocusLost(); |
|
100 |
|
101 /** |
|
102 * Battery almost empty warning signal. |
|
103 * Need to stop ongoing recording. |
|
104 */ |
|
105 void handleBatteryEmpty(); |
|
106 |
|
107 void updateTimeLabels(); |
82 void updateTimeLabels(); |
108 |
83 |
109 // from CxuiPrecaptureView |
84 // from CxuiPrecaptureView |
110 void hideControls(); |
85 void hideControls(); |
111 |
86 |
112 protected: |
87 protected: |
113 |
88 |
114 void setVideoTime(HbLabel* label, int time); |
89 void setVideoTime(HbLabel* label, int time); |
115 bool getElapsedTime(); |
90 bool getElapsedTime(); |
116 void getRemainingTime(); |
91 void getRemainingTime(); |
117 virtual void showToolbar(); |
92 bool allowShowControls() const; |
|
93 bool isFeedbackEnabled() const; |
|
94 void showToolbar(); |
118 void disableFeedback(); |
95 void disableFeedback(); |
119 void enableFeedback(); |
96 void enableFeedback(); |
120 |
97 |
121 void initializeSettingsGrid(); |
98 void initializeSettingsGrid(); |
|
99 bool isPostcaptureOn() const; |
|
100 void updateSceneIcon(const QString& sceneId); |
|
101 void updateQualityIcon(); |
122 void setRecordingItemsVisibility(bool visible); |
102 void setRecordingItemsVisibility(bool visible); |
123 |
103 |
124 // from QObject |
104 // from QObject |
125 bool eventFilter(QObject *object, QEvent *event); |
105 bool eventFilter(QObject *object, QEvent *event); |
|
106 |
|
107 private: |
|
108 void reloadIndicatorWidgets(); |
|
109 |
126 protected: |
110 protected: |
127 QTimer mElapsedTimer; |
111 QTimer mElapsedTimer; |
128 int mTimeElapsed; |
112 int mTimeElapsed; |
129 int mTimeRemaining; |
113 int mTimeRemaining; |
130 |
114 |
131 HbLabel *mElapsedTimeText; // not own |
115 HbLabel *mElapsedTimeText; // not own |
132 HbLabel *mRemainingTimeText; // not own |
116 HbLabel *mRemainingTimeText; // not own |
133 HbLabel *mRecordingIcon; // not own |
117 HbLabel *mRecordingIcon; // not own |
134 HbAction *mGoToStillAction; // not own |
118 HbAction *mGoToStillAction; // not own |
135 HbToolBar *mToolBarIdle; // not own |
119 HbToolBar *mToolbarIdle; // not own |
136 HbToolBar *mToolBarRec; // not own |
120 HbToolBar *mToolbarRec; // not own |
137 HbToolBar *mToolBarPaused; // not own |
121 HbToolBar *mToolbarPaused; // not own |
138 HbDialog *mVideoScenePopup; |
122 HbDialog *mVideoScenePopup; |
139 CxeVideoCaptureControl *mVideoCaptureControl; |
123 CxeVideoCaptureControl *mVideoCaptureControl; |
140 HbMenu *mMenu; // own |
124 HbMenu *mMenu; // own |
141 QPropertyAnimation* mRecordingAnimation; //For recording indicator |
125 QPropertyAnimation* mRecordingAnimation; //For recording indicator |
142 |
126 |