homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsarrangestate.h
changeset 35 f9ce957a272c
child 36 cdae8c6c3876
equal deleted inserted replaced
5:c743ef5928ba 35:f9ce957a272c
       
     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 #ifndef ARRANGE_H
       
    19 #define ARRANGE_H
       
    20 
       
    21 #include <QState>
       
    22 #include <QVariant>
       
    23 #include <hsmenuservice.h>
       
    24 #include <QAbstractItemModel>
       
    25 
       
    26 #include "hsmenustates_global.h"
       
    27 HS_STATES_TEST_CLASS(MenuStatesTest)
       
    28 
       
    29 class HbListWidget;
       
    30 class HsMenuItemModel;
       
    31 class HbDialog;
       
    32 
       
    33 class HsArrangeState: public QState
       
    34 {
       
    35     Q_OBJECT
       
    36 
       
    37     // Friend classes
       
    38     HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
       
    39 
       
    40 public:
       
    41 
       
    42     HsArrangeState(QState *parent = 0);
       
    43 
       
    44     virtual ~HsArrangeState();
       
    45 
       
    46 protected:
       
    47 
       
    48     /**
       
    49      * Derived from QState.
       
    50      * Method invoked when a state is entered.
       
    51      * @param event an event causing the entrance the state.
       
    52      *
       
    53      * @since S60 ?S60_version.
       
    54      */
       
    55     void onEntry(QEvent *event);
       
    56 
       
    57     /**
       
    58      * Slot connected to saving action of state.
       
    59      * It is called when new application are addend to collection.
       
    60      *
       
    61      * @since S60 ?S60_version.
       
    62      * @param id Id of collection to which applications were added.
       
    63      */
       
    64     //    void showMessageAppsAdded(int id);
       
    65 
       
    66 private slots:
       
    67 
       
    68     /**
       
    69      * Slot invoked when a state is exited.
       
    70      *
       
    71      * @since S60 ?S60_version.
       
    72      */
       
    73     void stateExited();
       
    74 
       
    75 private:
       
    76 
       
    77     /**
       
    78      * Constructs contained objects.
       
    79      *
       
    80      * @since S60 ?S60_version.
       
    81      */
       
    82     void construct();
       
    83 
       
    84     /*
       
    85      * Fulfills collection list.
       
    86      */
       
    87     void fulfillEntriesList();
       
    88 
       
    89     /**
       
    90      * Appends new order of items to ids list.
       
    91      */
       
    92     void getArrangedEntriesIds();
       
    93 
       
    94     /**
       
    95      * Saves data in content arsenal(selected applications in collection).
       
    96      *
       
    97      * @since S60 ?S60_version.
       
    98      */
       
    99     void save();
       
   100 
       
   101 private:
       
   102 
       
   103     /**
       
   104      * Dialog consists of collection's entries.
       
   105      */
       
   106     HbDialog *mDialog;
       
   107 
       
   108     /**
       
   109      * Entries list collected from DB.
       
   110      */
       
   111     HbListWidget *mEntriesList;
       
   112 
       
   113     /**
       
   114      * Collection name.W
       
   115      */
       
   116     HsMenuItemModel *mItemModel;
       
   117 
       
   118     /**
       
   119      * Item id visible on top.
       
   120      */
       
   121     int mTopItemId;
       
   122 
       
   123     /*
       
   124      * ModelIndex visible on top.
       
   125      */
       
   126     QModelIndex mTopModelIndex;
       
   127 
       
   128     /**
       
   129      * Collection list.
       
   130      */
       
   131     QList<int> mCollIdList;
       
   132 
       
   133     /**
       
   134      * Collection list.
       
   135      */
       
   136     QList<int> mArrangedCollIdList;
       
   137 
       
   138 };
       
   139 
       
   140 #endif /* ARRANGE_H_ */