photosgallery/commonui/inc/glxnavigationalstate.h
changeset 0 4e91876724a2
child 2 7d9067c6fcb1
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-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:    Navigational state of the app
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __C_GLXNAVIGATIONALSTATE_H__
       
    22 #define __C_GLXNAVIGATIONALSTATE_H__
       
    23 
       
    24 #include <e32std.h>
       
    25 
       
    26 #include <glxmediaid.h>
       
    27 #include <vwsdef.h>
       
    28 #include <glxnavigationalstatedefs.h>
       
    29 
       
    30 class CGlxNavigationalStateImp;
       
    31 class CMPXCollectionPath;
       
    32 class MGlxNavigationalStateObserver;
       
    33 
       
    34 /**
       
    35  * CGlxNavigationalState
       
    36  *
       
    37  * Class that stores the navigational state of the application.
       
    38  * Navigational state means the currently viewed node in UI hierarchy
       
    39  *
       
    40  * Design: CGlxNavigationalState delegates all operations to 
       
    41  * CGlxNavigationalStateImp, to avoid client having to include mpx dependencies.
       
    42  * CGlxNavigationalStateImp stores the navigational state in MPX collection 
       
    43  * server by owning an MMPXCollectionUtility. 
       
    44  * 
       
    45  * @author Aki Vanhatalo
       
    46  */
       
    47 class CGlxNavigationalState : public CBase
       
    48     {
       
    49 private:
       
    50 
       
    51 public:
       
    52     /**
       
    53      * Return a (singleton) instance of the class
       
    54      * Close the instance by calling Close() when done with the instance
       
    55      */
       
    56     IMPORT_C static CGlxNavigationalState* InstanceL(); 
       
    57     
       
    58     /**
       
    59      * Close the instance and remove observer if any
       
    60      * See @ref MGlxActiveMediaListResolver::Close
       
    61      * @param aObserver Observer to remove
       
    62      */
       
    63     IMPORT_C void Close();
       
    64     
       
    65     /**
       
    66      * Add an observer
       
    67      * @param aObserver Observer of changes to the state
       
    68      */
       
    69     IMPORT_C void AddObserverL( MGlxNavigationalStateObserver& aObserver );
       
    70     
       
    71     /**
       
    72      * Remove an observer
       
    73      * @param aObserver Observer to remove. 
       
    74      */
       
    75     IMPORT_C void RemoveObserver( MGlxNavigationalStateObserver& aObserver );
       
    76 
       
    77     /**
       
    78      * @return the current navigational state. Caller gets ownership.
       
    79      */
       
    80     IMPORT_C CMPXCollectionPath* StateLC() const;
       
    81     
       
    82     /**
       
    83      * Navigate back in the UI hierarchy
       
    84      * Does nothing, if currently at root.
       
    85      */
       
    86     IMPORT_C void NavigateToParentL();
       
    87     
       
    88     /**
       
    89      * Navigate forward to provided item
       
    90      * @param aItemToOpen Id of item to navigate to
       
    91      */
       
    92     IMPORT_C void NavigateToChildL( const TGlxMediaId& aItemIdToOpen );
       
    93     
       
    94     /**
       
    95      * Navigate to provided position in hierarchy
       
    96      * @param aNewState Path object which describes the new position in hierarchy
       
    97      */
       
    98     IMPORT_C void NavigateToL( const CMPXCollectionPath& aNewState );
       
    99 
       
   100      /**
       
   101      * Activate previous view
       
   102      */
       
   103     IMPORT_C void ActivatePreviousViewL();
       
   104      
       
   105      /**
       
   106      * returns the current viewing mode of the application
       
   107      */
       
   108      IMPORT_C NGlxNavigationalState::TViewingMode ViewingMode();
       
   109      
       
   110      /**
       
   111      * Sets the mode to "view"
       
   112      */
       
   113      IMPORT_C void SetToViewMode();
       
   114 
       
   115      IMPORT_C void SetBackExitStatus(TBool aStatus);
       
   116      
       
   117      IMPORT_C TBool BackExitStatus();
       
   118   
       
   119 private:
       
   120     /** Constructor for singleton store */
       
   121     static CGlxNavigationalState* NewL();
       
   122     
       
   123     /** Destructor */
       
   124     ~CGlxNavigationalState();
       
   125 
       
   126 private:
       
   127     /// Implementation 
       
   128     CGlxNavigationalStateImp* iImp;
       
   129     
       
   130 public:
       
   131     TBool iBackExitStatus;
       
   132     };
       
   133     
       
   134     
       
   135 #endif // __C_GLXNAVIGATIONALSTATE_H__