menufw/hierarchynavigator/hnpresentationmodel/inc/hnsuitemodelcontainer.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:   suite presentation models container
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_HNSUITEMODELCONTAINER_H
       
    20 #define C_HNSUITEMODELCONTAINER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class MHnMdModelEventObserver;
       
    25 class CHnSuitesStack;
       
    26 class CHnEventHandler;
       
    27 class CHnSuiteModel;
       
    28 class CLiwGenericParamList;
       
    29 class MHnControllerInterface;
       
    30 class CLiwGenericParamList;
       
    31 
       
    32 /**
       
    33  * Predefined offsets.
       
    34  */
       
    35 enum THighlightOffset
       
    36     {
       
    37     EOffsetPrevious = -1,
       
    38     EOffsetNone = 0,
       
    39     EOffsetNext = 1
       
    40     };
       
    41 
       
    42 /**
       
    43  *  Suite Model Container class.
       
    44  *  It manages the presentation models, and manages their position on the
       
    45  *  presentation stack.
       
    46  *
       
    47  *  @lib hnpresentationmodel
       
    48  *  @since S60 5.0
       
    49  *  @ingroup group_hnpresentationmodel
       
    50  */
       
    51 NONSHARABLE_CLASS( CHnSuiteModelContainer ) : public CBase
       
    52     {
       
    53 public:
       
    54 
       
    55     /**
       
    56      * Two-phased constructors.
       
    57      * 
       
    58      * @since S60 5.0
       
    59      * @param aModelObserver Interface of the model event observer.
       
    60      * @param aController Interface enabling to issues request to Hn engine.
       
    61      */
       
    62     IMPORT_C static CHnSuiteModelContainer* NewL( 
       
    63                                     MHnMdModelEventObserver& aModelObserver,
       
    64                                     MHnControllerInterface& aController );
       
    65     
       
    66     /**
       
    67      * Two-phased constructors.
       
    68      * 
       
    69      * @since S60 5.0
       
    70      * @param aModelObserver Interface of the model event observer.
       
    71      * @param aController Interface enabling to issues request to Hn engine.
       
    72      */
       
    73     IMPORT_C static CHnSuiteModelContainer* NewLC( 
       
    74                                     MHnMdModelEventObserver& aModelObserver,
       
    75                                     MHnControllerInterface& aController );
       
    76 
       
    77     /**
       
    78     * Virtual Destructor.
       
    79     * 
       
    80     * @since S60 5.0
       
    81     */
       
    82     ~CHnSuiteModelContainer();
       
    83     
       
    84     /**
       
    85      * Pushes a new swuite model to the stack,
       
    86      * by the name of aGenre
       
    87      * 
       
    88      * @since S60 v5.0
       
    89      * @param aGenre Name of the suite.
       
    90      * @return the Suite Model
       
    91      */
       
    92     IMPORT_C void PushNewSuiteModelL( const TDesC& aGenre  );
       
    93 
       
    94     /**
       
    95      * Fetches a Suite Model for the supplied genre name
       
    96      * "root" name reserved for root grid
       
    97      * 
       
    98      * @since S60 v5.0
       
    99      * @param aGenre genre name
       
   100      * @return the Suite Model
       
   101      */
       
   102     IMPORT_C CHnSuiteModel* GetSuiteModel( const TDesC& aGenre );
       
   103     
       
   104     /**
       
   105      * Pops the last Suite Model from the internal Suites Stack
       
   106      * and retruns in turn the element which remains as the last
       
   107      * after the change.
       
   108      * 
       
   109      * @since S60 v5.0
       
   110      * @param aGenre Name of the suite which is expected to be at the top
       
   111      * @return Suite Model which remains as the last.
       
   112      */
       
   113     IMPORT_C CHnSuiteModel* PopSuiteModelL( const TDesC& aGenre );
       
   114    
       
   115     /**
       
   116      * Fetches the count of suites stored in the container.
       
   117      * 
       
   118      * @since S60 v5.0
       
   119      * @return Suite count
       
   120      */
       
   121     IMPORT_C TInt GetSuiteModelCount() const;
       
   122     
       
   123     /**
       
   124      * Fetches the last suite model from the container.
       
   125      * 
       
   126      * @since S60 5.0
       
   127      * @return Requested, last suite model.
       
   128      */
       
   129     CHnSuiteModel* GetLastSuiteModel();
       
   130     
       
   131     /**
       
   132      * Fetches parent suite model from the container.
       
   133      * 
       
   134      * @since S60 5.0
       
   135      * @return Requested, last suite model.
       
   136      */
       
   137     CHnSuiteModel* GetParentSuiteModel();
       
   138     
       
   139     /**
       
   140      * Fetches the last suite model from the container.
       
   141      * 
       
   142      * @since S60 5.0
       
   143      * @param aPosition Position of the model in the stack.
       
   144      * @return Requested suite model.
       
   145      */
       
   146     CHnSuiteModel* GetSuiteModel( TInt aPosition );
       
   147     
       
   148     /**
       
   149      * Handles event.
       
   150      *
       
   151      * @since S60 5.0
       
   152      * @param aEventId Event id.
       
   153      * @param aRecipientId Recipient id.
       
   154      * @param aEventParameters Parameters to an event.
       
   155      * @return Status code.
       
   156      */
       
   157     IMPORT_C TInt OfferHnEventL( const TInt aEventId,
       
   158             const TInt aRecipientId, CLiwGenericParamList* aEventParameters = NULL );
       
   159     
       
   160     /**
       
   161      * Returns CHnSuiteModel matching given criteria (custom_id).
       
   162      * 
       
   163      * @param aCustomId Suite's custom identifier. 
       
   164      * @return Pointer to the suite model or null if model not found.
       
   165      */
       
   166     IMPORT_C CHnSuiteModel* GetMatchingSuiteModel( TInt64 aCustomId );
       
   167     
       
   168     /**
       
   169      * Removes all  LIW objects owned by this object.
       
   170      * 
       
   171      * LIW objects owned by non-LIW objects that are owned by
       
   172      * this object are also removed.
       
   173      * @since S60 5.0
       
   174      */
       
   175     IMPORT_C void RemoveLiwObjects();
       
   176     
       
   177 private:
       
   178 
       
   179     /**
       
   180      * Standard C++ Constructor.
       
   181      * 
       
   182      * @since S60 5.0
       
   183      */
       
   184     CHnSuiteModelContainer( );
       
   185       
       
   186     /**
       
   187      * Symbian 2nd phase constructor.
       
   188      * 
       
   189      * @since S60 5.0
       
   190      * @param aModelObserver Interface of the model event observer.
       
   191      * @param aController Interface enabling to issues request to Hn engine.
       
   192      */
       
   193     void ConstructL( MHnMdModelEventObserver& aModelObserver,
       
   194             MHnControllerInterface& aController );
       
   195     
       
   196 private: // data
       
   197         
       
   198     /**
       
   199      * Event handler.
       
   200      * Not own.
       
   201      */
       
   202     CHnEventHandler* iEventHandler;
       
   203     
       
   204     /**
       
   205      * Suites stack
       
   206      * Own
       
   207      */
       
   208     CHnSuitesStack* iSuitesStack;
       
   209    
       
   210     };
       
   211 
       
   212 #endif //C_HNSUITEMODELCONTAINER_H