stateproviders/ftustateprovider/inc/ftuwizardmenustate.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:  Declaration of the wizard menu state.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef FTU_STATES_WIZARDMENUSTATE_H
       
    20 #define FTU_STATES_WIZARDMENUSTATE_H
       
    21 
       
    22 #include <QAbstractItemModel>
       
    23 #include <QState>
       
    24 #include "ftutest_global.h"
       
    25 
       
    26 FTU_TEST_CLASS(FtuStateProviderTest)
       
    27 
       
    28 class HbMainWindow;
       
    29 class HbView;
       
    30 class HbListView;
       
    31 class HbLabel;
       
    32 class HbDocumentLoader;
       
    33 class QStandardItemModel;
       
    34 class FtuContentService;
       
    35 class QDate;
       
    36 class FtuWizard;
       
    37 class HbAction;
       
    38 
       
    39 /** @ingroup group_ftustateprovider
       
    40  * @brief The state where wizard menu is shown
       
    41  *
       
    42  * @see StateMachine
       
    43  *
       
    44  * @lib ?library
       
    45  * @since S60 ?S60_version
       
    46  */
       
    47 class FtuWizardMenuState : public QState
       
    48 {
       
    49     Q_OBJECT
       
    50 
       
    51 public:
       
    52 
       
    53     /**
       
    54      * Constructor.
       
    55      * @since S60 ?S60_version.     
       
    56      * @param aParent Owner.
       
    57      */
       
    58     FtuWizardMenuState(QState *aParent = 0);
       
    59 
       
    60     /**
       
    61      * Destructor.
       
    62      * @since S60 ?S60_version.
       
    63      */
       
    64 	virtual ~FtuWizardMenuState();
       
    65 	
       
    66 
       
    67 protected:
       
    68 
       
    69     /**
       
    70      * @copydoc QState::onEntry()
       
    71      */
       
    72     void onEntry(QEvent *event);
       
    73     
       
    74     /**
       
    75      * @copydoc QState::onExit()
       
    76      */
       
    77     void onExit(QEvent *event);
       
    78     
       
    79 private:
       
    80     /**
       
    81      * Creates table of contents widget.
       
    82      * @since S60 ?S60_version.
       
    83      */
       
    84     void createTocList();
       
    85 	
       
    86 	/**
       
    87      * Creates title text on a label.
       
    88      * @since S60 ?S60_version.
       
    89      */
       
    90     void createInfoText();
       
    91     	
       
    92 	/**
       
    93      * Returns content service object.
       
    94      * @since S60 ?S60_version.
       
    95      */
       
    96     FtuContentService *content() const;
       
    97     /**
       
    98      * Gets the date as string.
       
    99      * @param date The date to convert as string.
       
   100      * @since S60 ?S60_version.
       
   101      */
       
   102     QString updatedAsString(const QDate& date) const;
       
   103     
       
   104 public slots: 
       
   105 
       
   106     /**
       
   107      * Called when new wizards arrives.
       
   108      * @since S60 ?S60_version.
       
   109      * @param index Wizard index in content service.
       
   110      */
       
   111     void addWizardToListModel(int aIndex);
       
   112 
       
   113     /**
       
   114      * Signalled when user selects an item from the list.
       
   115      * @param index The index of the selected item.
       
   116      */    
       
   117     void activateWizard(const QModelIndex index);
       
   118 
       
   119     /**
       
   120      * @copydoc FtuWizard::progressUpdated()
       
   121      */    
       
   122     void updateProgress(FtuWizard *caller, bool show, int progress);
       
   123     
       
   124     /**
       
   125      * Called when application has to exit
       
   126      */  
       
   127     void exitApp();
       
   128     
       
   129 signals:
       
   130 
       
   131     /**
       
   132      * Signalled when user selects an item from the list and the
       
   133      * plugin is activated.
       
   134      */    
       
   135      void wizardSelected();
       
   136 	
       
   137 private:
       
   138 
       
   139     HbMainWindow*                           mMainWindow;
       
   140     HbView*                                 mTocView;
       
   141     HbLabel*                                mInfoText;
       
   142     HbListView*                             mListView;    
       
   143     HbDocumentLoader*                       mDocumentLoader;
       
   144 
       
   145     QStandardItemModel*                     mModel;
       
   146     HbAction*                               mExitAction;
       
   147 
       
   148     FTU_TEST_FRIEND_CLASS(FtuStateProviderTest)
       
   149 };
       
   150 
       
   151 #endif //FTU_STATES_WIZARDMENUSTATE_H