camerauis/cameraxui/cxui/inc/cxuivideoprecaptureview.h
branchRCL_3
changeset 53 61bc0f252b2b
equal deleted inserted replaced
50:f54ad444594d 53:61bc0f252b2b
       
     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 CXUIVIDEOPRECAPTUREVIEW_H
       
    18 #define CXUIVIDEOPRECAPTUREVIEW_H
       
    19 
       
    20 #include <QTimer>
       
    21 #include <QPropertyAnimation>
       
    22 
       
    23 #include "cxuiprecaptureview.h"
       
    24 #include "cxevideocapturecontrol.h"
       
    25 
       
    26 class HbLabel;
       
    27 class HbAction;
       
    28 class CxeVideoCaptureControl;
       
    29 class CxuiDocumentLoader;
       
    30 class CxuiCaptureKeyHandler;
       
    31 class HbDialog;
       
    32 
       
    33 
       
    34 /**
       
    35  * Pre-capture view for video recording mode
       
    36  */
       
    37 class CxuiVideoPrecaptureView : public CxuiPrecaptureView
       
    38     {
       
    39     Q_OBJECT
       
    40 
       
    41 public:
       
    42     CxuiVideoPrecaptureView(QGraphicsItem *parent = 0);
       
    43 
       
    44     virtual ~CxuiVideoPrecaptureView();
       
    45 
       
    46 public:
       
    47 
       
    48     void construct(HbMainWindow *mainwindow, CxeEngine *engine,
       
    49                    CxuiDocumentLoader *documentLoader,
       
    50                    CxuiCaptureKeyHandler *keyHandler,
       
    51                    HbActivityManager *activityManager);
       
    52 
       
    53     virtual void loadDefaultWidgets();
       
    54 
       
    55     virtual void loadWidgets();
       
    56 
       
    57     void restoreActivity(const QString &activityId, const QVariant &data);
       
    58     void saveActivity();
       
    59     void clearActivity();
       
    60 
       
    61 public slots:
       
    62 
       
    63     // from CxuiPrecaptureView
       
    64     virtual void handleSettingValueChanged(const QString& key, QVariant newValue);
       
    65 
       
    66     void handleSceneChanged(const QVariant &scene);
       
    67     void handleQuitClicked();
       
    68 
       
    69 protected slots:
       
    70 
       
    71     void record();
       
    72     void pause();
       
    73     void stop();
       
    74     void goToStill();
       
    75     void showEvent(QShowEvent *event);
       
    76     void handleVideoStateChanged(CxeVideoCaptureControl::State newState, CxeError::Id error);
       
    77     void handleCaptureKeyPressed();
       
    78     void prepareNewVideo(CxeError::Id error = CxeError::None);
       
    79     void launchVideoScenePopup();
       
    80     void launchSetting();
       
    81     void updateTimeLabels();
       
    82 
       
    83     // from CxuiPrecaptureView
       
    84     void hideControls();
       
    85 
       
    86 protected:
       
    87 
       
    88     void setVideoTime(HbLabel* label, int elapsedTime, int remainingTime);
       
    89     bool getElapsedTime();
       
    90     void getRemainingTime();
       
    91     bool allowShowControls() const;
       
    92     bool isFeedbackEnabled() const;
       
    93     void showToolbar();
       
    94     void disableFeedback();
       
    95     void enableFeedback();
       
    96 
       
    97     void initializeSettingsGrid();
       
    98     bool isPostcaptureOn() const;
       
    99     void updateSceneIcon(const QString& sceneId);
       
   100     void updateQualityIcon();
       
   101 
       
   102     // from QObject
       
   103     bool eventFilter(QObject *object, QEvent *event);
       
   104 
       
   105 private:
       
   106     void reloadIndicatorWidgets();
       
   107 
       
   108 protected:
       
   109     QTimer mElapsedTimer;
       
   110     int mTimeElapsed;
       
   111     int mTimeRemaining;
       
   112 
       
   113     HbLabel *mVideoTimeText; // not own
       
   114     HbLabel *mRecordingIcon; // not own
       
   115     HbAction *mGoToStillAction; // not own
       
   116     HbToolBar *mToolbarIdle; // not own
       
   117     HbToolBar *mToolbarRec; // not own
       
   118     HbToolBar *mToolbarPaused; // not own
       
   119     HbDialog *mVideoScenePopup;
       
   120     CxeVideoCaptureControl *mVideoCaptureControl;
       
   121     HbMenu *mMenu;    // own
       
   122     QPropertyAnimation* mRecordingAnimation; //For recording indicator
       
   123 
       
   124     bool mCapturePending;
       
   125     QTimer mPauseTimer;
       
   126     };
       
   127 
       
   128 #endif // CXUIVIDEOPRECAPTUREVIEW_H