camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h
changeset 43 0e652f8f1fbd
parent 28 3075d9b614e6
child 45 24fd82631616
equal deleted inserted replaced
28:3075d9b614e6 43:0e652f8f1fbd
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    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
   123     * Timer used to return back to precapture view after a time-out
   124     * Timer used to return back to precapture view after a time-out
   124     * Timer is disabled if show postcapture view setting is "continuous" i.e. -1
   125     * Timer is disabled if show postcapture view setting is "continuous" i.e. -1
   125     */
   126     */
   126     QTimer mPostcaptureTimer;
   127     QTimer mPostcaptureTimer;
   127 
   128 
   128     bool mControlsVisible;
   129     bool mTimersStarted;
   129 
   130 
   130     bool mTimersStarted;
       
   131     
       
   132     XQApplicationManager mAppManager;
   131     XQApplicationManager mAppManager;
   133 
   132 
       
   133     bool mDeleteNoteOpen;
       
   134 
       
   135     QString mFilename;
       
   136 
       
   137     ThumbnailManager *mThumbnailManager;
   134 };
   138 };
   135 
   139 
   136 #endif // CXUIPOSTCAPTUREVIEW_H
   140 #endif // CXUIPOSTCAPTUREVIEW_H