satui/satapp/inc/satappview.h
changeset 12 ae8abd0db65c
child 13 e32024264ebb
equal deleted inserted replaced
0:ff3b6d0fd310 12:ae8abd0db65c
       
     1 /*
       
     2 * Copyright (c) 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 */
       
    18 
       
    19 #ifndef SATAPPVIEW_H
       
    20 #define SATAPPVIEW_H
       
    21 
       
    22 #include <QEventLoop>
       
    23 #include <hbview.h>
       
    24 #include <msatuiobserver.h>
       
    25 
       
    26 class QTimer;
       
    27 class HbMainWindow;
       
    28 class HbAction;
       
    29 class HbListWidget;
       
    30 class HbListWidgetItem;
       
    31 class HbLabel;
       
    32 class SatAppEventProvider;
       
    33 class SatAppUiProvider;
       
    34 
       
    35 class SatAppView : public HbView
       
    36     {
       
    37     Q_OBJECT
       
    38 
       
    39 public:
       
    40      /**
       
    41      * Constructor
       
    42      */
       
    43     SatAppView(QGraphicsItem *parent = 0);
       
    44 
       
    45      /**
       
    46      * Destructor
       
    47      */
       
    48     ~SatAppView();
       
    49 
       
    50     void setMainWindow(HbMainWindow &mainWindow);
       
    51 
       
    52      /**
       
    53      * Initialize setup menu view
       
    54      * Handles the SetUpMenu command.
       
    55      * @param in eventProvider The reference of SatAppEventProvider.
       
    56      * @param in uiProvider The eference of SatAppUiProvider.
       
    57      */
       
    58     void initSetupMenu(SatAppEventProvider &eventProvider, 
       
    59                        SatAppUiProvider &uiProvider);
       
    60 
       
    61      /**
       
    62      * Initialize select item view
       
    63      * Handles the SelectItem command.
       
    64      * @param in utils The reference of SatAppEventProvider.
       
    65      * @param in manager The reference of SatAppUiProvider.
       
    66      */
       
    67     void initSelectItem(SatAppEventProvider &eventProvider, 
       
    68                         SatAppUiProvider &uiProvider);
       
    69     /**
       
    70     * Handles the SetUpMenu command.
       
    71     * @param aRes the out parameter. the result of the command.
       
    72     * @param aText The title text.
       
    73     * @param aMenuItems The array of menu item captions.
       
    74     * @param aMenuItemNextActions The array of menu item next action
       
    75     * indicator captions.
       
    76     * @param aIconBitmap The Context pane icon.
       
    77     * @param aItemsIconArray Array of item icons
       
    78     * @param aSelfExplanatoryItems Flag indicating if only icons are shown.
       
    79     * @param aHelpIsAvailable A flag indicating if SAT help is available.
       
    80     */
       
    81    void showSetUpMenuContent(
       
    82        TSatUiResponse &aRes,
       
    83        const QString &aText,
       
    84        const QStringList &aMenuItems,
       
    85        //const CArrayFixFlat<TSatAction>* aMenuItemNextActions,
       
    86        //const HbIcon &aIcon,
       
    87        //const CAknIconArray* aItemIconsArray,
       
    88        const bool aSelfExplanatoryItems,
       
    89        const bool aHelpIsAvailable);
       
    90 
       
    91    /**
       
    92     * Handles the SelectItem view.
       
    93     * @param aRes the out parameter. the result of the command.
       
    94     * @param aText The title text.
       
    95     * @param aMenuItems The array of menu items.
       
    96     * @param aMenuItemNextActions The array of next action indicators.
       
    97     * @param aDefaultItem The item in focus.
       
    98     * @param aSelection The item index selected by the user.
       
    99     * @param aIconBitmap The Context Pane icon.
       
   100     * @param aItemsIconArray Array of item icons
       
   101     * @param aSelfExplanatoryItems Flag indicating if only icons are shown.
       
   102     * @param aHelpIsAvailable A flag indicating if SAT help is available.
       
   103     * @return Information of the operation result.
       
   104     */
       
   105     void showSelectItemContent(
       
   106         TSatUiResponse &aRes,
       
   107         const QString &aText,
       
   108         const QStringList &aMenuItems,
       
   109         //const CArrayFixFlat<TSatAction>* aMenuItemNextActions,
       
   110         const int aDefaultItem,
       
   111         unsigned char &aSelection,
       
   112         //const HbIcon &aIcon,
       
   113         //const CAknIconArray* aItemsIconArray,
       
   114         const bool aSelfExplanatoryItems,
       
   115         const bool aHelpIsAvailable);
       
   116 
       
   117 public slots:
       
   118     /**
       
   119      * Private slot for select item event.
       
   120      */
       
   121     void selectItemTimeOut();
       
   122         /**
       
   123      * Private slot for active item.
       
   124      */
       
   125     void menuItemSelected(HbListWidgetItem *item);
       
   126 
       
   127 private slots:
       
   128     /**
       
   129      * Private slot for receiving backSoftkey press event.
       
   130      */
       
   131     void backButtonClicked();
       
   132 
       
   133 private: // From HbView
       
   134     /**
       
   135      * handle key press event
       
   136      */
       
   137     void keyPressEvent(QKeyEvent *event);
       
   138 
       
   139 private: // New method
       
   140     /**
       
   141      * Set the secondary softkey as back softkey.
       
   142      */
       
   143     void setSoftkeyBack();
       
   144 
       
   145     /**
       
   146      * Connect item with menuItemSelected.
       
   147      */
       
   148     void connectItem();
       
   149 
       
   150     /**
       
   151      * Disonnect item with menuItemSelected.
       
   152      */
       
   153     void disconnectItem();
       
   154 
       
   155 private: // data
       
   156     /**
       
   157      * Support select item time out.
       
   158      */
       
   159     bool mTimeout;
       
   160 
       
   161     /**
       
   162      * Indicatd Select item view and Setup Menu view.
       
   163      */
       
   164     bool mSelectItem;
       
   165 
       
   166      /**
       
   167      * Indicate use click back softkey.
       
   168      */
       
   169     bool mClickBackSoftkey;
       
   170 
       
   171     /**
       
   172      * The index of list widget.
       
   173      */
       
   174     int mItemIndex;
       
   175 
       
   176     /**
       
   177      * Own,an event loop for select item and menu selection
       
   178      */
       
   179     QEventLoop* mLoop;
       
   180 
       
   181     /**
       
   182      * Own,support selection item time out
       
   183      */
       
   184     QTimer *mTimer;
       
   185 
       
   186     // quit for setup menu view
       
   187     /**
       
   188      * Not own. From main
       
   189      */
       
   190     HbMainWindow *mWindow;
       
   191 
       
   192     /**
       
   193      * Own. An Action to quit sat application
       
   194      */
       
   195     HbAction *mSoftKeyQuitAction;
       
   196 
       
   197     /**
       
   198      * Own. An action to back to setup menu view
       
   199      */
       
   200     HbAction *mSoftKeyBackAction;
       
   201 
       
   202     /**
       
   203      * Not own.
       
   204      */
       
   205     SatAppEventProvider *mEvent;
       
   206 
       
   207     /**
       
   208      * Not own.
       
   209      */
       
   210     SatAppUiProvider *mUi;
       
   211 
       
   212     /**
       
   213      * Own,from application xml,don't delete in distructor
       
   214      */
       
   215     HbListWidget *mListWidget;
       
   216 
       
   217     /**
       
   218      * Own,from application xml,don't delete in distructor
       
   219      */
       
   220     HbListWidget *mSelectListWidget;
       
   221 
       
   222     /**
       
   223      * Own,from application xml,don't delete in distructor
       
   224      */
       
   225     HbLabel *mSubTitle;
       
   226     };
       
   227 
       
   228 #endif // SATAPPVIEW_H