stateproviders/ftustateprovider/inc/ftuwizardactivatedstate.h
changeset 0 c464cd7e2753
child 2 66c26770985f
equal deleted inserted replaced
-1:000000000000 0:c464cd7e2753
       
     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 
       
    18 
       
    19 #ifndef FTU_STATES_WIZARDACTIVATEDSTATE_H
       
    20 #define FTU_STATES_WIZARDACTIVATEDSTATE_H
       
    21 
       
    22 #include <QState>
       
    23 #include <QAbstractItemModel>
       
    24 #include "ftutest_global.h"
       
    25 
       
    26 FTU_TEST_CLASS(FtuStateProviderTest)
       
    27 
       
    28 class QGraphicsWidget;
       
    29 class HbMainWindow;
       
    30 class HbLabel;
       
    31 class HbStackedWidget;
       
    32 class HbView;
       
    33 class HbDocumentLoader;
       
    34 class HbAction;
       
    35 class HbGridView;
       
    36 class QGraphicsLinearLayout;
       
    37 class FtuContentService;
       
    38 class FtuWizard;
       
    39 
       
    40  
       
    41 /** @ingroup group_ftustateprovider
       
    42  * @brief The state handles wizard activation and interaction.
       
    43  *
       
    44  * @see StateMachine
       
    45  *
       
    46  * @lib ?library
       
    47  * @since S60 ?S60_version
       
    48  */
       
    49 class FtuWizardActivatedState : public QState
       
    50 {
       
    51     Q_OBJECT
       
    52 public: 
       
    53     /*
       
    54      * The plugin's display mode enumeration.
       
    55      * FullScreen means menustrip is not shown.
       
    56      * PartialScreen means menustrip is shown.
       
    57      */
       
    58     enum PluginDisplayMode{FullScreen, PartialScreen};
       
    59     
       
    60 public:
       
    61 
       
    62     /**
       
    63      * Constructor.
       
    64      * @since S60 ?S60_version.     
       
    65      * @param aParent Owner.
       
    66      */
       
    67     FtuWizardActivatedState(QState *aParent = 0);
       
    68 
       
    69     /**
       
    70      * Destructor.
       
    71      * @since S60 ?S60_version.
       
    72      */
       
    73 	virtual ~FtuWizardActivatedState();
       
    74 	
       
    75 protected:
       
    76 
       
    77     /**
       
    78      * @copydoc QState::onEntry()
       
    79      */
       
    80     void onEntry(QEvent *event);
       
    81     
       
    82     /**
       
    83      * @copydoc QState::onExit()
       
    84      */
       
    85     void onExit(QEvent *event);
       
    86 
       
    87 private:
       
    88     
       
    89     /**
       
    90      * Returns content service object.
       
    91      * @return The content service pointer.
       
    92      * @since S60 ?S60_version.
       
    93      */
       
    94     FtuContentService *content() const;
       
    95     
       
    96     /**
       
    97      * Returns the main window handle.
       
    98      * @since S60 ?S60_version.
       
    99      * @return The pointer to the main window.
       
   100      */
       
   101     HbMainWindow* mainWindow();
       
   102     
       
   103     /**
       
   104      * Creates the menustrip.
       
   105      * @since S60 ?S60_version.
       
   106      */   
       
   107     void constructGrid();
       
   108 
       
   109     /**
       
   110      * Connects signals and slots for active wizard.
       
   111      * @since S60 ?S60_version.
       
   112      */  
       
   113     void setActiveWizardConnections();
       
   114         
       
   115     /**
       
   116      * Calculates the wizard's geometry.
       
   117      * @since S60 ?S60_version.
       
   118      * @return The calculated rect.
       
   119      */       
       
   120     QRectF calculateWizardGeometry();
       
   121     
       
   122 public slots:
       
   123     
       
   124     /**
       
   125      * Signalled when back action is triggerd from toolbaar.
       
   126      * @since S60 ?S60_version.
       
   127      */
       
   128     void handleBackEvent();
       
   129     
       
   130     /**
       
   131      * @copydoc FtuWizard::onViewChanged
       
   132      */
       
   133     void changeWizardView(FtuWizard *caller, QGraphicsWidget* viewWidget);
       
   134     
       
   135     /**
       
   136       * @copydoc FtuWizard::fullScreenModeRequested
       
   137       */
       
   138     void enableFullScreenMode(FtuWizard *caller);
       
   139      
       
   140     /**
       
   141       * @copydoc FtuWizard::partialScreenModeRequested
       
   142       */
       
   143     void enablePartialScreenMode(FtuWizard *caller);
       
   144     
       
   145     /**
       
   146      * @copydoc FtuWizard::onInfoTextUpdated
       
   147      */
       
   148     void updateInfoText(FtuWizard *caller, QString text);
       
   149     
       
   150     /**
       
   151      * Handles the item selection from grid.
       
   152      * @param index The activated item.
       
   153      * @sice S60 ?S60_version.
       
   154      */
       
   155     void activateWizard(const QModelIndex index);
       
   156 
       
   157 signals:
       
   158         
       
   159     /**
       
   160      * Emitted when the menu state is to be activated.
       
   161      * @since S60 ?S60_version.
       
   162      */
       
   163     void backEventTriggered();  
       
   164  
       
   165 private:
       
   166 
       
   167     /**
       
   168      * HbMainWindow instance.
       
   169      */
       
   170     HbMainWindow*           mMainWindow;
       
   171     
       
   172     /**
       
   173      * HbDocumentLoader instance.
       
   174      */
       
   175     HbDocumentLoader*       mDocumentLoader;
       
   176 
       
   177     /**
       
   178      * Plugin view instance.
       
   179      */
       
   180     HbView*                 mPluginView;
       
   181     
       
   182     /**
       
   183      * Pointer to the activated wizard. Not owned.
       
   184      */
       
   185     FtuWizard*              mActiveWizard;    
       
   186    
       
   187     /**
       
   188      * Info text label.
       
   189      */
       
   190     HbLabel*                mPluginTitleLabel;
       
   191 
       
   192     /**
       
   193      * Wizard widget area.
       
   194      */
       
   195     HbStackedWidget*        mWizardStackedWidget;
       
   196 
       
   197     /**
       
   198      * Back action overriding the app exit functionality.
       
   199      */
       
   200     HbAction*               mBackAction;
       
   201     
       
   202     /**
       
   203      * The menustrip component.
       
   204      */     
       
   205     HbGridView*             mMenustrip;
       
   206     
       
   207     /**
       
   208      * Plugin's previously activated view.
       
   209      */
       
   210     QGraphicsWidget*        mPreviousView;
       
   211 
       
   212     /**
       
   213      * Plugin's currently activated view.
       
   214      */
       
   215     QGraphicsWidget*        mCurrentView;
       
   216 
       
   217     /**
       
   218      * The Plugin's display mode.
       
   219      */
       
   220     PluginDisplayMode       mPluginDisplayMode;
       
   221     
       
   222     FTU_TEST_FRIEND_CLASS(FtuStateProviderTest)    
       
   223 };
       
   224 
       
   225 #endif //FTU_STATES_WizardActivatedState_H