18 #define CXUIPOSTCAPTUREVIEW_H |
18 #define CXUIPOSTCAPTUREVIEW_H |
19 |
19 |
20 #include <QObject> |
20 #include <QObject> |
21 #include <QList> |
21 #include <QList> |
22 #include <QTimer> |
22 #include <QTimer> |
23 #include <hbview.h> |
|
24 #include <xqappmgr.h> |
23 #include <xqappmgr.h> |
|
24 #include "cxuiview.h" |
25 |
25 |
26 class QGraphicsRectItem; |
26 class QGraphicsRectItem; |
27 class HbMainWindow; |
27 class HbMainWindow; |
28 class HbAction; |
28 class HbAction; |
29 class HbLabel; |
29 class HbLabel; |
|
30 class ShareUi; |
30 |
31 |
31 class CxeEngine; |
32 class CxeEngine; |
32 class CxuiDocumentLoader; |
33 class CxuiDocumentLoader; |
33 |
34 class ThumbnailManager; |
34 |
35 |
35 /** |
36 /** |
36 * Post-capture view |
37 * Post-capture view |
37 */ |
38 */ |
38 class CxuiPostcaptureView : public HbView |
39 class CxuiPostcaptureView : public CxuiView |
39 { |
40 { |
40 Q_OBJECT |
41 Q_OBJECT |
41 |
42 |
42 public: |
43 public: |
43 CxuiPostcaptureView(QGraphicsItem *parent = 0); |
44 CxuiPostcaptureView(QGraphicsItem *parent = 0); |
44 virtual ~CxuiPostcaptureView(); |
45 virtual ~CxuiPostcaptureView(); |
45 void construct(HbMainWindow *mainwindow, CxeEngine *engine, CxuiDocumentLoader *documentLoader); |
46 void construct(HbMainWindow *mainwindow, CxeEngine *engine, |
|
47 CxuiDocumentLoader *documentLoader, CxuiCaptureKeyHandler *keyHandler, |
|
48 HbActivityManager *activityManager); |
46 |
49 |
47 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); |
50 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); |
|
51 |
|
52 void restoreActivity(const QString &activityId, const QVariant &data); |
|
53 void saveActivity(); |
|
54 void clearActivity(); |
48 |
55 |
49 signals: |
56 signals: |
50 void changeToPrecaptureView(); |
57 void changeToPrecaptureView(); |
51 |
58 |
52 public slots: |
59 public slots: |
|
60 void enterStandby(); |
|
61 void exitStandby(); |
53 void handleCaptureKeyPressed(); |
62 void handleCaptureKeyPressed(); |
54 void handleAutofocusKeyPressed(); |
63 void handleAutofocusKeyPressed(); |
55 |
64 |
56 protected: |
65 protected: |
57 bool eventFilter(QObject *object, QEvent *event); |
66 bool eventFilter(QObject *object, QEvent *event); |
58 void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
59 void showEvent(QShowEvent *event); |
67 void showEvent(QShowEvent *event); |
60 void hideEvent(QHideEvent *event); |
68 void hideEvent(QHideEvent *event); |
61 void showToolbar(); |
69 void showToolbar(); |
62 void createBackground(); |
70 void createBackground(); |
63 void updateSnapshotImage(); |
71 void updateSnapshotImage(); |
64 void stopTimers(); |
72 void stopTimers(); |
65 |
73 |
66 protected slots: |
74 protected slots: |
67 void goToPrecaptureView(); |
75 void goToPrecaptureView(); |
68 void stopViewfinder(); |
76 void stopViewfinder(); |
69 void releaseCamera(); |
|
70 |
77 |
71 // Control visibility |
78 void hideToolbar(); |
72 void hideControls(); |
|
73 void showControls(); |
|
74 void toggleControls(); |
|
75 |
79 |
76 // toolbar actions |
80 // toolbar actions |
77 void launchPhotosApp(); |
|
78 void select(); |
81 void select(); |
79 void launchShare(); |
82 void launchShare(); |
80 void playVideo(); |
83 void playVideo(); |
81 void showDeleteNote(); |
84 void showDeleteNote(); |
82 void launchVideosApp(); |
|
83 |
85 |
84 void handleDeleteDialogClosed(HbAction *action); |
86 void handleDeleteDialogClosed(int action); |
85 |
87 |
86 private: |
88 private: |
87 void launchNotSupportedNotification(); |
|
88 QString getCurrentFilename(); |
89 QString getCurrentFilename(); |
89 |
90 |
|
91 void startTimers(); |
|
92 void startPostcaptureTimer(); |
|
93 void startReleaseTimers(); |
|
94 |
90 private slots: |
95 private slots: |
91 void startTimers(); |
96 void handleThumbnailReady(QPixmap thumbnail, void *clientData, int id, int errorCode); |
92 void handleFocusLost(); |
|
93 |
97 |
94 private: // data |
98 private: // data |
95 HbMainWindow *mMainWindow; // not own |
|
96 CxeEngine *mEngine; // not own |
|
97 CxuiDocumentLoader *mDocumentLoader; // not own |
|
98 HbToolBar *mStillToolbar; |
99 HbToolBar *mStillToolbar; |
99 HbToolBar *mVideoToolbar; |
100 HbToolBar *mVideoToolbar; |
100 HbToolBar *mEmbeddedToolbar; |
101 HbToolBar *mEmbeddedToolbar; |
101 QGraphicsRectItem *mBackgroundItem; |
102 QGraphicsRectItem *mBackgroundItem; |
102 HbLabel *mImageLabel; |
103 HbLabel *mImageLabel; |
103 |
104 |
104 QTimer mHideControlsTimeout; |
105 ShareUi *mShareUi; |
105 |
106 |
106 /** |
107 /** |
107 * Timer used to stop viewfinder after a delay if the user remains in |
108 * Timer used to stop viewfinder after a delay if the user remains in |
108 * post-capture view. Viewfinder is not stopped immediately when |
109 * post-capture view. Viewfinder is not stopped immediately when |
109 * capturing an image to improve the latency it takes to return to |
110 * capturing an image to improve the latency it takes to return to |