photosgallery/gallery/inc/glxappui.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:    AppUi class 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_GLXWERAPPUI_H
       
    22 #define C_GLXWERAPPUI_H
       
    23 
       
    24 #include <aknViewAppUi.h>
       
    25 #include <mpxcollectionobserver.h>
       
    26 #include <mglxnavigationalstateobserver.h>
       
    27 #include <mpxcollectionpath.h>
       
    28 #include "glxiadupdate.h"
       
    29 
       
    30 class MMPXViewUtility;
       
    31 class MMPXCollectionUtility;
       
    32 class CGlxUiUtility;
       
    33 class CRepository;
       
    34 class CGlxNavigationalState;
       
    35 class CAknGlobalNote;
       
    36 
       
    37 class CGlxBackServiceWrapper;
       
    38 
       
    39 /**
       
    40  *  CGlxAppUi
       
    41  *
       
    42  *  @lib ViewerApplication
       
    43  */
       
    44 
       
    45 class CGlxAppUi : public CAknViewAppUi, public MGlxNavigationalStateObserver
       
    46 	{
       
    47 public:
       
    48 	CGlxAppUi();
       
    49 	void ConstructL();
       
    50 	~CGlxAppUi();
       
    51 
       
    52 public: // from CAknAppUi
       
    53 	/**
       
    54 	 * From CAknAppUi
       
    55      * Handle user menu selections
       
    56   	 * @param aCommand Id of the command
       
    57      */
       
    58 	void HandleCommandL(TInt aCommand);
       
    59 
       
    60     // From MGlxNavigationalStateObserver
       
    61     void HandleNavigationalStateChangedL();
       
    62     //OOM Method
       
    63     void HandleApplicationSpecificEventL(TInt aEventType, const TWsEvent& aWsEvent);
       
    64 
       
    65 
       
    66 private:    // From CEikAppUi
       
    67     MCoeMessageObserver::TMessageResponse HandleMessageL(
       
    68                             TUint32 aClientHandleOfTargetWindowGroup,
       
    69                             TUid aMessageUid, const TDesC8& aMessageParameters);
       
    70     TBool ProcessCommandParametersL(TApaCommand aCommand,
       
    71                             TFileName& aDocumentName, const TDesC8& aTail);
       
    72 
       
    73 private: // From CCoeAppUi
       
    74 
       
    75     void HandleForegroundEventL( TBool aForeground );
       
    76  
       
    77 private:
       
    78     enum TEntryType
       
    79         {
       
    80         EEntryTypeStartUp = 0,
       
    81         EEntryTypeFocusGained
       
    82         };
       
    83     
       
    84 
       
    85     /**
       
    86      * Handle an activation message.
       
    87      * @param aCommand command data sent from the activating application.
       
    88      * @param aDocumentName image file name data sent from the activating application.
       
    89      * @param aData Message data from activating application.
       
    90      */
       
    91     void HandleActivationMessageL(const TApaCommand& aCommand, const TFileName& aDocumentName, const TDesC8& aData);
       
    92 	 /**
       
    93      * Handle an activation message.    
       
    94      * @param aData Message data from activating application.
       
    95      */
       
    96     void HandleActivationMessageL(const TDesC8& aData);
       
    97     /**
       
    98      * Set activation parameter for startup view, converting to 16-bit
       
    99      * descriptor used by MPX.
       
   100      * @param aParam Activation parameter.
       
   101      */
       
   102     void SetActivationParamL(const TDesC8& aParam);
       
   103 
       
   104     /**
       
   105      * Get view scoring ids based on current navigational state
       
   106      * (using Get in the name since the function does not return anything)
       
   107      * @param aIns list that will be populated with scoring ids
       
   108      */
       
   109     void GetViewScoringIdsL( RArray<TUid>& aIds ) const;
       
   110 
       
   111     /**
       
   112      * Get view scoring id for collection plugin
       
   113      * @param naviState Path to represent navigational state
       
   114      * @return scoding id
       
   115      */
       
   116     TUid GetViewScoringIdForCollectionPlugin( const CMPXCollectionPath& aNaviState ) const;
       
   117 
       
   118     /**
       
   119      * Get view scoring id for depth in ui hierarchy
       
   120      * @param naviState Path to represent navigational state
       
   121      * @return scoding id
       
   122      */
       
   123     TUid ViewScoringIdForNaviStateDepth( const CMPXCollectionPath& aNaviState ) const;
       
   124 
       
   125     /**
       
   126      * Requesting OOM to Free Some Memory, so that photos can Start
       
   127      * @return Error if Memory Cannot be freed else Error None
       
   128      */
       
   129     TInt OOMRequestFreeMemoryL( TInt aBytesRequested) ;
       
   130 
       
   131     /**
       
   132      * Finds Current Memory Availability And Decides to Send a Request for freeing the memory 
       
   133      * @param aCriticalMemoryRequired Bare Minimum to start photos 
       
   134      * @return Error Code from OOM
       
   135      */
       
   136     TInt ReserveMemoryL(TInt aCriticalMemoryRequired);
       
   137     
       
   138     /**
       
   139      * Finds Current Minimum Required memory to start photos 
       
   140      * @param Type of application invokation 
       
   141      * @return Required Critical Memory
       
   142      */
       
   143     TInt RamRequiredInBytesL(TEntryType aType);
       
   144     
       
   145     /**
       
   146      * @todo:
       
   147      * Get view scoring id for depth in ui hierarchy
       
   148      * @param naviState Path to represent navigational state
       
   149      * @return scoding id
       
   150      */
       
   151     void ReserveMemoryL(TEntryType aType);
       
   152 
       
   153     //OOM
       
   154     /*
       
   155     *Invoked by the OOM framwork when photos app needs to free memory for other applications.
       
   156     */
       
   157     void StartCleanupL();
       
   158 
       
   159     //OOM
       
   160     /*
       
   161     *Invoked by the OOM framwork when photos app needs to free memory for other applications.
       
   162     */
       
   163     void StopCleanupL();
       
   164     /**
       
   165      * To move back to the app which started photossuite when done options->exit from
       
   166      * within the app. 
       
   167      * @param aMessage exit action from photossuite 
       
   168      */
       
   169     void LaunchMmViewL(const TDesC8& aMessage);
       
   170 	
       
   171 	/**
       
   172      * Check for updates via IAD.
       
   173      */
       
   174     void DoCheckForIADUpdatesL();
       
   175     /**
       
   176      * close photos app.
       
   177      */
       
   178      void ClosePhotosL();
       
   179 
       
   180 private:
       
   181     MMPXViewUtility* iViewUtility;
       
   182     
       
   183     CAknGlobalNote* iGlobalWaitNote;
       
   184     TInt iNoteId;
       
   185     HBufC* iFreeMemText;
       
   186 
       
   187     /// Singleton that stores gallery's navigational state
       
   188     CGlxNavigationalState* iNavigationalState;
       
   189     
       
   190     /** Optional view plugin UID to activate when the collection is opened */
       
   191     TUid iStartupViewUid;
       
   192 
       
   193     /** Optional activation parameter for the next view */
       
   194     HBufC* iActivationParam;
       
   195     
       
   196     TBool iFocusLostLowMemory;
       
   197     TBool iStartUpSequence;
       
   198 
       
   199     ///Ui utility
       
   200     CGlxUiUtility* iUiUtility;
       
   201 
       
   202     /// Central repository entry for app (owned)
       
   203     CRepository* iRepository;
       
   204     
       
   205     CGlxBackServiceWrapper* iBSWrapper;
       
   206     /**
       
   207      * IAD updater class
       
   208      */
       
   209     CGlxIadUpdate* iIadUpdate;
       
   210 	
       
   211     /**
       
   212     *This flag to chk whether red key has been pressed
       
   213     */
       
   214     TBool iEndKeyPressed;
       
   215 
       
   216 };
       
   217 
       
   218 
       
   219 #endif // C_GLXWERAPPUI_H
       
   220