aknenv.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : AknEnv.h
00004 *  Part of  : Avkon
00005 *
00006 *  Description:
00007 *  Version:
00008 *
00009 *  Copyright © 2002 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation. All rights are reserved. Copying, 
00013 *  including reproducing, storing,  adapting or translating, any 
00014 *  or all of this material requires the prior written consent of 
00015 *  Nokia Corporation. This material also contains confidential 
00016 *  information which may not be disclosed to others without the 
00017 *  prior written consent of Nokia Corporation.
00018 * ============================================================================
00019 */
00020 #if !defined(__AVKON_ENV_H__)
00021 #define __AVKON_ENV_H__
00022 
00023 //  INCLUDES
00024 #include <eikenv.h>
00025 #include <eiksbfrm.h>
00026 #include <eikcba.h>
00027 #include <eikmobs.h>
00028 #include <eikmenub.h>
00029 #include <eikappui.h>
00030 #include <aknlayout2id.h> // for TAknLayoutId
00031 #include <akndef.h> // for TAknUiZoom
00032 
00033 // FORWARD DECLARATIONS
00034 namespace AknLayout { class CInstance; }
00035 namespace LayoutPack { class CInstance; }
00036 
00037 class CCdlEngineRef;
00038 class MAknEditingStateIndicator;
00039 class MAknIntermediateState;
00040 class CAknAppUi;
00041 class CAknWaitDialog;
00042 class CEikListBox;
00043 class CAknSettingCache;
00044 class CAknFontRegistry;
00045 class CLafSystemFont;
00046 class TAknLayoutConfigScreenMode;
00047 class CCdlRefs;
00048 class CTransitionManager;
00049 class CAknCommandMediator;
00050 // Since there is no include of aknsystemfont.h we need the typedef CLafSystemFont here as well
00051 // Hence this requires parallel maintenance.
00052 typedef CLafSystemFont CAknSystemFont;
00053 
00054 // MACROS
00055 // Color Macros
00062 // Color macros 
00063 #define AKN_LAF_COLOR_ENV(env,nn)       CAknEnv::AvkonColor(nn)
00064 #define AKN_LAF_COLOR(nn)                       CAknEnv::AvkonColor(nn)
00065 #define AKN_LAF_COLOR_STATIC(nn)        CAknEnv::AvkonColor(nn)
00066 
00067         // Avkon layout
00068 //      IMPORT_C const AknLayout::CInstance& AknLayout() const;
00069 
00070 
00071 // CLASS DECLARATION
00072 
00080 class CAknEnv : public CBase
00081         {
00082 public:
00092         IMPORT_C static CAknEnv* Static();
00093 
00097         IMPORT_C ~CAknEnv();
00098 public:
00099         // this one creates an empty dialog. for list queries and popup lists with 
00100         // "No Data" in it.
00108         IMPORT_C void ExecuteEmptyPopupListL(const TDesC *aEmptyText=0);
00109 
00121         IMPORT_C void ExecuteEmptyPopupListL(const TDesC *aEmptyText, 
00122                                              const TDesC *aTitle, 
00123                                              TInt aSoftkeyId=0);
00124 
00125 public:
00131         IMPORT_C void SetFepMenuObserver(MEikMenuObserver* aObserver);
00132 
00138         IMPORT_C MEikMenuObserver* FepMenuObserver();
00139 
00145         IMPORT_C MAknEditingStateIndicator* EditingStateIndicator();
00146 
00147 
00154         IMPORT_C MAknEditingStateIndicator* SwapEditingStateIndicator(
00155             MAknEditingStateIndicator* aIndicator);
00156 
00160         IMPORT_C static void ExitForegroundAppL();
00161 
00162 public: // Intermediate states support
00170         IMPORT_C void RegisterIntermediateStateL(MAknIntermediateState *aState);
00171 
00179         IMPORT_C void UnRegisterIntermediateState(MAknIntermediateState *aState);
00180 
00184         IMPORT_C void CloseAllIntermediateStates();
00185 
00186 public:
00190         IMPORT_C static void RunAppShutter();
00191 
00199         IMPORT_C static CAknAppUi* AppWithShutterRunning();
00200 
00206         IMPORT_C static void StopSchedulerWaitWithBusyMessage(
00207             CActiveSchedulerWait& aWait);
00208 
00209 public:
00215         IMPORT_C void CreateCbaObserverL(CEikButtonGroupContainer *aCba, 
00216                                          CEikListBox *aListBox);
00217 
00221         IMPORT_C void RemoveCbaObserver();
00222 
00223 
00228         IMPORT_C void InformCbaDeletion(CEikButtonGroupContainer *aCba);
00229 
00241     IMPORT_C void RequestCommandMediationL( CEikButtonGroupContainer& aCba,
00242         MEikCommandObserver& aCommandObserver );
00243 
00251     IMPORT_C void EndCommandMediation( MEikCommandObserver& aCommandObserver );
00252 
00253 public:
00259         IMPORT_C void GetCurrentLayoutId(TAknLayoutId& aCurrentLayoutId) const;
00260 
00266     IMPORT_C void GetCurrentGlobalUiZoom(TAknUiZoom& aCurrentGlobalUiZoom) const;
00267 
00268 public:
00275         IMPORT_C TInt StatusPaneResIdForCurrentLayout(TInt aResId) const;
00276 
00277 public:
00297     IMPORT_C TInt RequestWsBuffer( TInt aRequestedBufferSize );
00298 
00310     IMPORT_C void CancelWsBufferRequest( TInt aRequestID );
00311 
00312 public:
00316         IMPORT_C CAknSettingCache& SettingCache() const;
00317 
00327     CAknFontRegistry& FontRegistry() const;
00328 
00338     CArrayPtr<CAknSystemFont>* SystemFontArray() const;
00339 
00340     void UpdateSystemFontsL();
00341 
00342 public: // layout
00343     
00350         IMPORT_C TBool LoadAknLayoutL();
00358         IMPORT_C TBool LoadAknLayoutL(const TAknLayoutConfigScreenMode& aScreenMode);
00359         // Avkon layout
00366         IMPORT_C const AknLayout::CInstance& AknLayout() const;
00367 
00368 public: // color support
00377     IMPORT_C static TRgb AvkonColor( TInt );
00378 
00379 public: // split view support
00385     IMPORT_C TBool SplitViewActive() const;
00386 
00392     void SplitViewActive( const TBool aSplitViewActive );
00393 
00394     void TransitionEvent(TInt aEvent, const TUid& aAppUid);
00395     void TransitionEvent(TInt aEvent);
00396     TBool HasBlank() const;
00397 
00398 public: // future language
00399     /*
00400      * Check if the feature language is same.
00401      * @param aFeatureLanguage feature language (e.g. KFeatureIdJapanese)
00402      * @return ETrue if the arg is same as iFeatureLanguage.
00403      * 
00404      */
00405     TBool IsFeatureLanguage(TInt aFeatureLanguage);
00406 
00407 private:
00408 
00409     void SetWsBufferSize();
00410     void SetWsBufferSize( TInt aRequestedBufferSize );
00411 
00412     // Only these can use run info array, so it cannot get messed up
00413     // by simultaneous use.
00414     friend class AknBidiTextUtils;
00415     friend class TAknTextWrapper;
00416 
00424     TBidirectionalState::TRunInfo* RunInfoArray( TInt& aLength ) const;
00425 
00434     TInt PrepareRunInfoArray( const TDesC& aLogicalText );
00435 
00444     TInt SetRequiredRunInfoArraySize( TInt aLength );
00445 
00446         void SetLayoutRequirementsL();
00447         void AssertLayoutLoaded();
00448         TBool LoadAknLayoutL(TAknLayoutId aId, const TAknLayoutConfigScreenMode& aScreenMode, TAknUiZoom aUiZoom);
00449     TAknUiZoom ResolveCurrentUiZoom();
00450         void FindAknLayoutL(TAknLayoutId aId, const TAknLayoutConfigScreenMode& aScreenMode, TAknUiZoom aUiZoom, CCdlRefs* aRefs, LayoutPack::CInstance*& aBestPack, TBool aStrict);
00451     
00455     void SetConeFontSizeArrayL() const;
00456 
00457 private:
00458         static TInt RealCloseIntermediateStates(TAny *aEnv);
00459         static TInt SchedulerStoppedCallBack(TAny* aWaitNote);
00460         void DoSchedulerStoppedCallBack();
00461 
00462 private:
00463         friend class LafEnv;
00464 
00465         IMPORT_C static void InstallAknEnvAsExtensionL(CEikonEnv* aEnv);
00466         IMPORT_C CAknEnv();
00467         IMPORT_C void ConstructL();
00468 
00469 private:
00470         MEikMenuObserver* iFepMenuObserver;
00471         MAknEditingStateIndicator* iEditStateIndicator;
00472 private:
00473         CArrayPtr<MAknIntermediateState> *iStateArray;
00474         CArrayPtr<CBase> *iDeleteArray;
00475         CIdle *iIdle;
00476         CAknWaitDialog* iBusyMsgDialog;
00477         TInt iBusyMsgCount;
00478         MEikCommandObserver *iCbaCommandObserver;
00479     CAknSettingCache* iSettingCache;
00480     TBidirectionalState::TRunInfo* iRunInfoArray;
00481     TInt iRunInfoArrayLength;
00482 
00483     struct TWsBufferRequest
00484         {
00485         TInt iRequestID;
00486         TInt iRequestedSize;
00487         };
00488 
00489     RArray<TWsBufferRequest> iWsBufferRequestArray;
00490     TInt iRequestIdCounter;
00491     TInt iCurrentWsBufferRequest;
00492 
00493         // cache for layout parameters
00494         TAknLayoutId iLastLayoutId;
00495         TInt iLastScreenMode;
00496         TAknUiZoom iLastZoom;
00497 
00498         CEikonEnv* iCoeEnv;
00499     CAknFontRegistry* iFontRegistry;  // Owned register of CAknLayoutFont pointers
00500     CCdlEngineRef* iCdlEngRef;
00501     const AknLayout::CInstance* iLayout;        
00502     CArrayPtr<CAknSystemFont>* iSystemFontArray; // Not owned. System Font array is owned by CEikonEnv
00503     TBool iSplitViewActive;
00504     HBufC* iLastLayoutDll;
00505     CTransitionManager* iTransitionManager;
00506     CAknCommandMediator* iCommandMediator;
00507     /*
00508      * Set the feature language Id
00509      * If device uses Japanese language variant, KFeatureIdJapanese is set.
00510      * 
00511      */
00512     TInt iFeatureLanguage;
00513     };
00514 
00515 
00516 #define iAvkonEnv (STATIC_CAST(CAknEnv*,iEikonEnv->Extension()))
00517 #define AVKONENV (STATIC_CAST(CAknEnv*, CEikonEnv::Static()->Extension()))
00518 
00519 #endif

Copyright © Nokia Corporation 2001-2008
Back to top