camerauis/cameraxui/cxui/inc/cxuiscenemodeview.h
author hgs
Fri, 06 Aug 2010 10:03:37 +0300
changeset 46 c826656d6714
parent 41 67457b2ffb33
child 58 ddba9caa7f32
permissions -rw-r--r--
201031
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
3075d9b614e6 201017_1
hgs
parents:
diff changeset
     1
/*
39
c5025ea871a1 201021_1
hgs
parents: 28
diff changeset
     2
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
28
3075d9b614e6 201017_1
hgs
parents:
diff changeset
     3
* All rights reserved.
3075d9b614e6 201017_1
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
3075d9b614e6 201017_1
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
3075d9b614e6 201017_1
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
3075d9b614e6 201017_1
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
3075d9b614e6 201017_1
hgs
parents:
diff changeset
     8
*
3075d9b614e6 201017_1
hgs
parents:
diff changeset
     9
* Initial Contributors:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    11
*
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    12
* Contributors:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    13
*
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    14
* Description:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    15
*
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    16
*/
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    17
#ifndef CXUISCENEMODEVIEW_H
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    18
#define CXUISCENEMODEVIEW_H
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    19
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    20
#include <QMetaType>
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    21
#include <QPropertyAnimation>
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    22
#include <QTimer>
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    23
#include <hbframedrawer.h>
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    24
#include <hbview.h>
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    25
#include <hbmainwindow.h>
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    26
#include <hblabel.h>
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    27
#include <hbpushbutton.h>
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    28
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    29
#include "cxeerror.h"
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    30
#include "cxenamespace.h"
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    31
#include "cxuisettingsinfo.h"
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    32
#include "cxuienums.h"
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    33
#include "cxeengine.h"
39
c5025ea871a1 201021_1
hgs
parents: 28
diff changeset
    34
#include "cxuiview.h"
28
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    35
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    36
class CxuiCaptureKeyHandler;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    37
class CxuiDocumentLoader;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    38
class HbPushButton;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    39
class HbLabel;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    40
class HbView;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    41
class CxuiSettingsInfo;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    42
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    43
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    44
/**
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    45
 * Scene mode view class for both video and still sides
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    46
 */
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    47
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    48
39
c5025ea871a1 201021_1
hgs
parents: 28
diff changeset
    49
class CxuiSceneModeView : public CxuiView
28
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    50
{
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    51
    Q_OBJECT
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    52
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    53
public:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    54
    CxuiSceneModeView(QGraphicsItem *parent = 0);
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    55
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    56
    virtual ~CxuiSceneModeView();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    57
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    58
public:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    59
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    60
    void construct(HbMainWindow *mainwindow,
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    61
                   CxeEngine *engine,
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    62
                   CxuiDocumentLoader *documentLoader,
41
hgs
parents: 40
diff changeset
    63
                   CxuiCaptureKeyHandler *keyHandler,
hgs
parents: 40
diff changeset
    64
                   HbActivityManager *activityManager);
28
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    65
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    66
    void loadDefaultWidgets();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    67
    void loadBackgroundImages();
41
hgs
parents: 40
diff changeset
    68
    void saveActivity();
28
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    69
signals:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    70
    void viewCloseEvent();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    71
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    72
public slots:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    73
    void handleCaptureKeyPressed();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    74
    void handleAutofocusKeyPressed();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    75
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    76
private slots:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    77
    void handleSceneRadiobuttonPress(int index);
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    78
    void finishScenesTransition();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    79
    void handleOkButtonPress();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    80
    void handleCancelButtonPress();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    81
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    82
protected:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    83
    void showEvent(QShowEvent *event);
39
c5025ea871a1 201021_1
hgs
parents: 28
diff changeset
    84
    bool allowShowControls() const;
41
hgs
parents: 40
diff changeset
    85
    bool isFeedbackEnabled() const;
28
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    86
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    87
private:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    88
    QString backgroundForScene(const QString& sceneId);
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    89
    void startBackgroundTransition();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    90
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    91
    void connectSignals();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    92
    void closeView();
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    93
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    94
private:
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    95
    CxuiSettingsInfo *mSettingsInfo;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    96
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    97
    HbLabel* mScenesBackground;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    98
    HbLabel* mScenesBackground2;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
    99
    CxuiSettingRadioButtonList* mScenesList;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   100
    QList<CxUiSettings::SettingItem> mSettingPairList;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   101
    HbPushButton* mScenesOkButton;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   102
    HbPushButton* mScenesCancelButton;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   103
    HbWidget* mScenesContainer;
40
hgs
parents: 39
diff changeset
   104
    HbLabel *mScenesHeading;
28
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   105
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   106
    QTimer mCameraReleaseTimer;
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   107
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   108
    QPropertyAnimation* mTransitionAnimation; //for mScenesBackground
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   109
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   110
};
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   111
3075d9b614e6 201017_1
hgs
parents:
diff changeset
   112
#endif // CXUISCENEMODEVIEW_H