camerauis/cameraxui/cxui/inc/cxuipostcaptureview.h
changeset 19 d9aefe59d544
child 21 fa6d9f75d6a6
child 28 3075d9b614e6
equal deleted inserted replaced
3:8b2d6d0384b0 19:d9aefe59d544
       
     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 CXUIPOSTCAPTUREVIEW_H
       
    18 #define CXUIPOSTCAPTUREVIEW_H
       
    19 
       
    20 #include <QObject>
       
    21 #include <QList>
       
    22 #include <QTimer>
       
    23 #include <hbview.h>
       
    24 
       
    25 class QGraphicsRectItem;
       
    26 class HbMainWindow;
       
    27 class HbAction;
       
    28 class HbLabel;
       
    29 
       
    30 class CxeEngine;
       
    31 class CxuiDocumentLoader;
       
    32 
       
    33 
       
    34 /**
       
    35  * Post-capture view
       
    36  */
       
    37 class CxuiPostcaptureView : public HbView
       
    38 {
       
    39     Q_OBJECT
       
    40 
       
    41 public:
       
    42     CxuiPostcaptureView(QGraphicsItem *parent = 0);
       
    43     virtual ~CxuiPostcaptureView();
       
    44     void construct(HbMainWindow *mainwindow, CxeEngine *engine, CxuiDocumentLoader *documentLoader);
       
    45 
       
    46 signals:
       
    47     void changeToPrecaptureView();
       
    48 
       
    49 public slots:
       
    50     void handleCaptureKeyPressed();
       
    51     void handleAutofocusKeyPressed();
       
    52 
       
    53 protected:
       
    54     bool eventFilter(QObject *object, QEvent *event);
       
    55     bool event(QEvent *event);
       
    56     void mousePressEvent(QGraphicsSceneMouseEvent *event);
       
    57     void showEvent(QShowEvent *event);
       
    58     void hideEvent(QHideEvent *event);
       
    59     void showToolbar();
       
    60     void createBackground();
       
    61     void updateSnapshotImage();
       
    62     void stopTimers();
       
    63 
       
    64 protected slots:
       
    65     void goToPrecaptureView();
       
    66     void stopViewfinder();
       
    67     void releaseCamera();
       
    68 
       
    69     // Control visibility
       
    70     void hideControls();
       
    71     void showControls();
       
    72     void toggleControls();
       
    73 
       
    74     // toolbar actions
       
    75     void launchPhotosApp();
       
    76     void select();
       
    77     void launchShare();
       
    78     void playVideo();
       
    79     void showDeleteNote();
       
    80     void launchVideosApp();
       
    81 
       
    82 private:
       
    83     void launchNotSupportedNotification();
       
    84     QString getCurrentFilename();
       
    85 
       
    86 private slots:
       
    87     void startTimers();
       
    88     void handleFocusLost();
       
    89 
       
    90 private: // data
       
    91     HbMainWindow *mMainWindow; // not own
       
    92     CxeEngine *mEngine; // not own
       
    93     CxuiDocumentLoader *mDocumentLoader; // not own
       
    94     HbToolBar *mStillToolbar;
       
    95     HbToolBar *mVideoToolbar;
       
    96     HbToolBar *mEmbeddedToolbar;
       
    97     QGraphicsRectItem *mBackgroundItem;
       
    98     HbLabel *mImageLabel;
       
    99 
       
   100     QTimer mHideControlsTimeout;
       
   101 
       
   102     /**
       
   103      * Timer used to stop viewfinder after a delay if the user remains in
       
   104      * post-capture view. Viewfinder is not stopped immediately when
       
   105      * capturing an image to improve the latency it takes to return to
       
   106      * pre-capture view.
       
   107      */
       
   108     QTimer mStopViewfinderTimer;
       
   109 
       
   110     /**
       
   111      * Timer used to release the camera HW after a delay if the user
       
   112      * remains in post-capture view. Releasing the camera improves
       
   113      * power efficiency, but creates additional latency when returning
       
   114      * to pre-capture view.
       
   115      */
       
   116     QTimer mReleaseCameraTimer;
       
   117 
       
   118     /*
       
   119     * Timer used to return back to precapture view after a time-out
       
   120     * Timer is disabled if show postcapture view setting is "continuous" i.e. -1
       
   121     */
       
   122     QTimer mPostcaptureTimer;
       
   123 
       
   124     bool mControlsVisible;
       
   125 
       
   126     bool mTimersStarted;
       
   127 
       
   128 };
       
   129 
       
   130 #endif // CXUIPOSTCAPTUREVIEW_H