photosgallery/imgvwr/inc/glxivwrappui.h
branchRCL_3
changeset 56 b023a8d2866a
parent 13 71da52165949
equal deleted inserted replaced
47:f9e827349359 56:b023a8d2866a
     9  * Initial Contributors:
     9  * Initial Contributors:
    10  * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11  *
    11  *
    12  * Contributors:
    12  * Contributors:
    13  *
    13  *
    14  * Description:    AppUi class 
    14  * Description: Image Viewer AppUi class 
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 
    18 
    19 
    19 
    20 
    20 
    21 #ifndef C_GLXIVIEWERAPPUI_H
    21 #ifndef C_GLXIVIEWERAPPUI_H
    22 #define C_GLXIVIEWERAPPUI_H
    22 #define C_GLXIVIEWERAPPUI_H
    23 
    23 
    24 #include <aknViewAppUi.h>
    24 #include <aknViewAppUi.h>
    25 #include <mpxcollectionobserver.h>
       
    26 #include <mglxnavigationalstateobserver.h>
    25 #include <mglxnavigationalstateobserver.h>
    27 #include <mpxcollectionpath.h>
    26 #include <mpxcollectionpath.h>
    28 #include "glxiadupdate.h"
    27 #include <mglxcache.h>
    29 
    28 
    30 class MMPXViewUtility;
    29 class MMPXViewUtility;
    31 class MMPXCollectionUtility;
       
    32 class CGlxUiUtility;
    30 class CGlxUiUtility;
    33 class CGlxNavigationalState;
    31 class CGlxNavigationalState;
    34 class CAknGlobalNote;
       
    35 
    32 
    36 /**
    33 /**
    37  *  CGlxIVwrAppUi
    34  *  CGlxIVwrAppUi
    38  *
    35  *
    39  *  @lib ViewerApplication
    36  *  @lib ViewerApplication
    40  */
    37  */
    41 
    38 
    42 class CGlxIVwrAppUi : public CAknViewAppUi, public MGlxNavigationalStateObserver
    39 class CGlxIVwrAppUi : public CAknViewAppUi,
       
    40         public MGlxNavigationalStateObserver
    43     {
    41     {
    44 public:
    42 public:
    45     CGlxIVwrAppUi();
    43     CGlxIVwrAppUi();
    46     void ConstructL();
    44     void ConstructL();
    47     ~CGlxIVwrAppUi();
    45     ~CGlxIVwrAppUi();
       
    46     /**
       
    47      * Open the viewer on receving OpenFileL() callback in CViewerDocument
       
    48      */
       
    49     void HandleOpenFileL();
    48 
    50 
    49 public: // from CAknAppUi
    51 public:
       
    52     // from CAknAppUi
    50     /**
    53     /**
    51      * From CAknAppUi
    54      * From CAknAppUi
    52      * Handle user menu selections
    55      * Handle user menu selections
    53      * @param aCommand Id of the command
    56      * @param aCommand Id of the command
    54      */
    57      */
    55     void HandleCommandL(TInt aCommand);
    58     void HandleCommandL(TInt aCommand);
    56 
    59 
    57     // From MGlxNavigationalStateObserver
    60     // From MGlxNavigationalStateObserver
    58     void HandleNavigationalStateChangedL();
    61     void HandleNavigationalStateChangedL();
       
    62     
    59     //OOM Method
    63     //OOM Method
    60     void HandleApplicationSpecificEventL(TInt aEventType, const TWsEvent& aWsEvent);
    64     void HandleApplicationSpecificEventL(TInt aEventType,
       
    65             const TWsEvent& aWsEvent);
    61 
    66 
    62     /**
    67 protected:
    63      * Open the viewer on receving OpenFileL() callback in CViewerDocument
    68     // From CEikAppUi
    64      */
    69     void OpenFileL(const TDesC& aFileName);
    65     void HandleOpenFileL();
       
    66     
       
    67 private:    // From CEikAppUi
       
    68 
    70 
    69     TBool ProcessCommandParametersL(TApaCommand aCommand,
    71     TBool ProcessCommandParametersL(TApaCommand aCommand,
    70             TFileName& aDocumentName, const TDesC8& aTail);
    72             TFileName& aDocumentName, const TDesC8& aTail);
    71 
       
    72 private: // From CCoeAppUi
       
    73 
       
    74     void HandleForegroundEventL( TBool aForeground );
       
    75 
    73 
    76 private:
    74 private:
    77     enum TEntryType
    75     enum TEntryType
    78         {
    76         {
    79         EEntryTypeStartUp = 0,
    77         EEntryTypeStartUp = 0,
    82     /**
    80     /**
    83      * Get view scoring ids based on current navigational state
    81      * Get view scoring ids based on current navigational state
    84      * (using Get in the name since the function does not return anything)
    82      * (using Get in the name since the function does not return anything)
    85      * @param aIns list that will be populated with scoring ids
    83      * @param aIns list that will be populated with scoring ids
    86      */
    84      */
    87     void GetViewScoringIdsL( RArray<TUid>& aIds ) const;
    85     void GetViewScoringIdsL(RArray<TUid>& aIds) const;
    88 
    86 
    89     /**
    87     /**
    90      * Get view scoring id for collection plugin
    88      * Get view scoring id for collection plugin
    91      * @param naviState Path to represent navigational state
    89      * @param naviState Path to represent navigational state
    92      * @return scoding id
    90      * @return scoding id
    93      */
    91      */
    94     TUid GetViewScoringIdForCollectionPlugin( const CMPXCollectionPath& aNaviState ) const;
    92     TUid GetViewScoringIdForCollectionPlugin(
       
    93             const CMPXCollectionPath& aNaviState) const;
    95 
    94 
    96     /**
    95     /**
    97      * Get view scoring id for depth in ui hierarchy
    96      * Get view scoring id for depth in ui hierarchy
    98      * @param naviState Path to represent navigational state
    97      * @param naviState Path to represent navigational state
    99      * @return scoding id
    98      * @return scoding id
   100      */
    99      */
   101     TUid ViewScoringIdForNaviStateDepth( const CMPXCollectionPath& aNaviState ) const;
   100     TUid ViewScoringIdForNaviStateDepth(
       
   101                     const CMPXCollectionPath& aNaviState) const;
   102 
   102 
   103     /**
   103     /**
   104      * Requesting OOM to Free Some Memory, so that photos image viewer can start
   104      * Requesting OOM to Free Some Memory, so that photos image viewer can start
   105      * @return Error if Memory Cannot be freed else Error None
   105      * @return Error if Memory Cannot be freed else Error None
   106      */
   106      */
   107     TInt OOMRequestFreeMemoryL( TInt aBytesRequested) ;
   107     TInt OOMRequestFreeMemoryL(TInt aBytesRequested);
   108 
   108 
   109     /**
   109     /**
   110      * Finds Current Memory Availability And Decides to Send a Request for freeing the memory 
   110      * Finds Current Memory Availability And Decides to Send a Request for freeing the memory 
   111      * @param aCriticalMemoryRequired Bare Minimum to start photos image viewer
   111      * @param aCriticalMemoryRequired Bare Minimum to start photos image viewer
   112      * @return Error Code from OOM
   112      * @return Error Code from OOM
   113      */
   113      */
   114     TInt ReserveMemoryL(TInt aCriticalMemoryRequired);
   114     TInt ReserveMemoryL(TInt aCriticalMemoryRequired);
   115     
   115 
   116     /**
   116     /**
   117      * Finds Current Minimum Required memory to start photos image viewer
   117      * Finds Current Minimum Required memory to start photos image viewer
   118      * @param Type of application invokation 
   118      * @param Type of application invokation 
   119      * @return Required Critical Memory
   119      * @return Required Critical Memory
   120      */
   120      */
   121     TInt RamRequiredInBytesL(TEntryType aType);
   121     TInt RamRequiredInBytesL(TEntryType aType);
   122     
   122 
   123     /**
   123     /**
   124      * Reserve critical memory qequired to start photos image viewer
   124      * Reserve critical memory qequired to start photos image viewer
   125      * @param Type of application invokation 
   125      * @param Type of application invokation 
   126      */
   126      */
   127     void ReserveMemoryL(TEntryType aType);
   127     void ReserveMemoryL(TEntryType aType);
   128 
   128 
   129     /**
   129     /**
   130      * close photos app.
   130      * Close Image Viewer App.
   131      */
   131      */
   132     void CloseImgVwr();
   132     void CloseImgVwr();
   133 
   133 
   134 private:
   134 private:
       
   135     /// MPX View Utility
   135     MMPXViewUtility* iViewUtility;
   136     MMPXViewUtility* iViewUtility;
   136 
   137 
   137 	/// Singleton that stores gallery's navigational state
   138     /// Image Viewer's Navigational State
   138     CGlxNavigationalState* iNavigationalState;
   139     CGlxNavigationalState* iNavigationalState;
   139 
   140 
   140     /** Optional view plugin UID to activate when the collection is opened */
   141     /// Optional view plugin UID to activate when the collection is opened
   141     TUid iStartupViewUid;
   142     TUid iStartupViewUid;
   142 
   143 
   143     ///Ui utility
   144     /// Ui Utility
   144     CGlxUiUtility* iUiUtility;
   145     CGlxUiUtility* iUiUtility;
   145     };
   146     };
   146 
   147 
   147 
   148 
   148 #endif // C_GLXIVIEWERAPPUI_H
   149 #endif // C_GLXIVIEWERAPPUI_H