menufw/hierarchynavigator/hnpresentationmodel/inc/hnsuitesstack.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 stack
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_HNSUITESSTACK_H
       
    20 #define C_HNSUITESSTACK_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class CHnSuiteModel;
       
    25 class MHnControllerInterface;
       
    26 
       
    27 /**
       
    28  *  Class implements Suites stack.
       
    29  *  Suite stack is used to keep visual models of suites
       
    30  *  in the order they have been opened.
       
    31  *
       
    32  *  @lib hnpresentationmodel
       
    33  *  @since S60 5.0
       
    34  *  @ingroup group_hnpresentationmodel
       
    35  */
       
    36 NONSHARABLE_CLASS( CHnSuitesStack ): public CBase
       
    37     {
       
    38 
       
    39 public:
       
    40 
       
    41     /**
       
    42      * Two-phased constructor.
       
    43      * 
       
    44      * @since S60 5.0
       
    45      * @param aControllerInterface A HN controller inteface.
       
    46      * @return Fully constructed object.
       
    47      */
       
    48     IMPORT_C static CHnSuitesStack* NewL( MHnControllerInterface& aControllerInterface );
       
    49     
       
    50     /**
       
    51      * Virtual Destructor.
       
    52      * 
       
    53      * @since S60 5.0
       
    54      */
       
    55     ~CHnSuitesStack();
       
    56     
       
    57     /**
       
    58      * Pushes a Suite Model onto the stack.
       
    59      * 
       
    60      * @since S60 v5.0
       
    61      * @param aSuiteModel Model to be pushed to stack.
       
    62      * @return Quantity of models in the stack after insert.
       
    63      */
       
    64     IMPORT_C TInt PushL( CHnSuiteModel* aSuiteModel );
       
    65 
       
    66     /**
       
    67      * Pops the last Suite Model from the top of the stack.
       
    68      * Ownership is transfered to the code that invokes it.
       
    69      * 
       
    70      * @since S60 v5.0
       
    71      * @return Suite Model object, ownership is transfered to 
       
    72      *         invoking code.
       
    73      */
       
    74     IMPORT_C CHnSuiteModel* PopL();
       
    75     
       
    76     /**
       
    77      * Gets the last Suite Model, from the top of the stack.
       
    78      * 
       
    79      * @since S60 v5.0
       
    80      * @return Suite Model at the top of the stack.
       
    81      */
       
    82     IMPORT_C CHnSuiteModel* GetLast();
       
    83     
       
    84     /**
       
    85     * Gets the stack, from a certain position in the stack.
       
    86     * Index 0, refers to the lowest Suite Model.
       
    87     * 
       
    88     * @since S60 v5.0
       
    89     * @param aPositon Position to fetch model from.
       
    90     * @return Suite Model form a certain posiotion.
       
    91     */
       
    92     IMPORT_C CHnSuiteModel* Get( TInt aPositon );
       
    93     
       
    94     /**
       
    95      * Gets the Suite Model from the bottom of the stack.
       
    96      * 
       
    97      * @since S60 v5.0
       
    98      * @return Suite Model from the bottom of the stack.
       
    99      */
       
   100     IMPORT_C CHnSuiteModel* GetRootSuite();
       
   101      
       
   102     /**
       
   103      * Checks if the stack is empty.
       
   104      * 
       
   105      * @since S60 v5.0
       
   106      * @return Bollean value.
       
   107      */
       
   108     IMPORT_C TBool IsEmpty();
       
   109     
       
   110     /**
       
   111      * Gets the size of the stack.
       
   112      * 
       
   113      * @since S60 v5.0
       
   114      * @return Number of Suite Models in the stack.
       
   115      */
       
   116     IMPORT_C TInt Count();
       
   117 
       
   118 private:
       
   119     
       
   120     /**
       
   121      * Constructor.
       
   122      * 
       
   123      * @since S60 v5.0
       
   124      * @param aControllerInterface Reference to App Ui - event observer
       
   125      */
       
   126     CHnSuitesStack( MHnControllerInterface& aControllerInterface );
       
   127 
       
   128     /**
       
   129      * Second pahse constructor.
       
   130      * 
       
   131      * @since S60 v5.0
       
   132      */
       
   133     void ConstructL( );
       
   134 
       
   135 private:
       
   136 
       
   137     /**
       
   138      * Suites stack
       
   139      */
       
   140     RPointerArray< CHnSuiteModel > iStack;
       
   141     
       
   142     /**
       
   143      * Reference to App Ui - event observer
       
   144      */
       
   145     MHnControllerInterface& iControllerInterface; 
       
   146 
       
   147     };
       
   148 
       
   149 #endif // C_HNSUITESSSTACK_H