camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     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 CXUIPOSTCAPTUREVIEW_H
       
    18 #define CXUIPOSTCAPTUREVIEW_H
       
    19 
       
    20 #include <QObject>
       
    21 #include <QList>
       
    22 #include <QTimer>
       
    23 #include <xqappmgr.h>
       
    24 #include "cxuiview.h"
       
    25 
       
    26 class QGraphicsRectItem;
       
    27 class HbMainWindow;
       
    28 class HbAction;
       
    29 class HbLabel;
       
    30 class ShareUi;
       
    31 
       
    32 class CxeEngine;
       
    33 class CxuiDocumentLoader;
       
    34 class ThumbnailManager;
       
    35 
       
    36 /**
       
    37  * Post-capture view
       
    38  */
       
    39 class CxuiPostcaptureView : public CxuiView
       
    40 {
       
    41     Q_OBJECT
       
    42 
       
    43 public:
       
    44     CxuiPostcaptureView(QGraphicsItem *parent = 0);
       
    45     virtual ~CxuiPostcaptureView();
       
    46     void construct(HbMainWindow *mainwindow, CxeEngine *engine,
       
    47                    CxuiDocumentLoader *documentLoader, CxuiCaptureKeyHandler *keyHandler,
       
    48                    HbActivityManager *activityManager);
       
    49 
       
    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();
       
    55 
       
    56 signals:
       
    57     void changeToPrecaptureView();
       
    58 
       
    59 public slots:
       
    60     void enterStandby();
       
    61     void exitStandby();
       
    62     void handleCaptureKeyPressed();
       
    63     void handleAutofocusKeyPressed();
       
    64 
       
    65 protected:
       
    66     bool eventFilter(QObject *object, QEvent *event);
       
    67     void showEvent(QShowEvent *event);
       
    68     void hideEvent(QHideEvent *event);
       
    69     void showToolbar();
       
    70     void createBackground();
       
    71     void updateSnapshotImage();
       
    72     void stopTimers();
       
    73 
       
    74 protected slots:
       
    75     void goToPrecaptureView();
       
    76     void stopViewfinder();
       
    77 
       
    78     void hideToolbar();
       
    79 
       
    80     // toolbar actions
       
    81     void select();
       
    82     void launchShare();
       
    83     void playVideo();
       
    84     void showDeleteNote();
       
    85 
       
    86     void handleDeleteDialogClosed(int action);
       
    87 
       
    88 private:
       
    89     bool isFileDeleted();
       
    90     QString getCurrentFilename();
       
    91 
       
    92     void startTimers();
       
    93     void startPostcaptureTimer();
       
    94     void startReleaseTimers();
       
    95 
       
    96 private slots:
       
    97     void handleThumbnailReady(QPixmap thumbnail);
       
    98 
       
    99 private: // data
       
   100     HbToolBar *mStillToolbar;
       
   101     HbToolBar *mVideoToolbar;
       
   102     HbToolBar *mEmbeddedToolbar;
       
   103     QGraphicsRectItem *mBackgroundItem;
       
   104     HbLabel *mImageLabel;
       
   105 
       
   106     ShareUi *mShareUi;
       
   107 
       
   108     /**
       
   109      * Timer used to stop viewfinder after a delay if the user remains in
       
   110      * post-capture view. Viewfinder is not stopped immediately when
       
   111      * capturing an image to improve the latency it takes to return to
       
   112      * pre-capture view.
       
   113      */
       
   114     QTimer mStopViewfinderTimer;
       
   115 
       
   116     /**
       
   117      * Timer used to release the camera HW after a delay if the user
       
   118      * remains in post-capture view. Releasing the camera improves
       
   119      * power efficiency, but creates additional latency when returning
       
   120      * to pre-capture view.
       
   121      */
       
   122     QTimer mReleaseCameraTimer;
       
   123 
       
   124     /*
       
   125     * Timer used to return back to precapture view after a time-out
       
   126     * Timer is disabled if show postcapture view setting is "continuous" i.e. -1
       
   127     */
       
   128     QTimer mPostcaptureTimer;
       
   129 
       
   130     bool mTimersStarted;
       
   131 
       
   132     XQApplicationManager mAppManager;
       
   133 
       
   134     bool mDeleteNoteOpen;
       
   135 
       
   136     QString mFilename;
       
   137 
       
   138     ThumbnailManager *mThumbnailManager;
       
   139 };
       
   140 
       
   141 #endif // CXUIPOSTCAPTUREVIEW_H