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     static void ShutOrHideAppL();
00343 
00344 public: // layout
00345     
00352         IMPORT_C TBool LoadAknLayoutL();
00360         IMPORT_C TBool LoadAknLayoutL(const TAknLayoutConfigScreenMode& aScreenMode);
00361         
00368         void ReloadAknLayoutL();
00369         
00370         // Avkon layout
00377         IMPORT_C const AknLayout::CInstance& AknLayout() const;
00378 
00379 public: // color support
00388     IMPORT_C static TRgb AvkonColor( TInt );
00389 
00390 public: // split view support
00396     IMPORT_C TBool SplitViewActive() const;
00397 
00403     void SplitViewActive( const TBool aSplitViewActive );
00404 
00405     void TransitionEvent(TInt aEvent, const TUid& aAppUid);
00406     void TransitionEvent(TInt aEvent);
00407     TBool HasBlank() const;
00408 
00409 public: // future language
00410     /*
00411      * Check if the feature language is same.
00412      * @param aFeatureLanguage feature language (e.g. KFeatureIdJapanese)
00413      * @return ETrue if the arg is same as iFeatureLanguage.
00414      * @since 3.1
00415      */
00416     TBool IsFeatureLanguage(TInt aFeatureLanguage);
00417 
00418 private:
00419 
00420     void SetWsBufferSize();
00421     void SetWsBufferSize( TInt aRequestedBufferSize );
00422 
00423     // Only these can use run info array, so it cannot get messed up
00424     // by simultaneous use.
00425     friend class AknBidiTextUtils;
00426     friend class TAknTextWrapper;
00427 
00435     TBidirectionalState::TRunInfo* RunInfoArray( TInt& aLength ) const;
00436 
00445     TInt PrepareRunInfoArray( const TDesC& aLogicalText );
00446 
00455     TInt SetRequiredRunInfoArraySize( TInt aLength );
00456 
00457         void SetLayoutRequirementsL();
00458         void AssertLayoutLoaded();
00459         TBool TryLoadAknLayoutL(TAknLayoutId aId, const TAknLayoutConfigScreenMode& aScreenMode, TAknUiZoom aUiZoom);
00460         TBool LoadAknLayoutL(TAknLayoutId aId, const TAknLayoutConfigScreenMode& aScreenMode, TAknUiZoom aUiZoom);
00461     TAknUiZoom ResolveCurrentUiZoom();
00462     
00466     void SetConeFontSizeArrayL() const;
00467 
00468 private:
00469         static TInt RealCloseIntermediateStates(TAny *aEnv);
00470         static TInt SchedulerStoppedCallBack(TAny* aWaitNote);
00471         void DoSchedulerStoppedCallBack();
00472 
00473 private:
00474     friend class LafEnv;
00475 
00476     IMPORT_C static void InstallAknEnvAsExtensionL(CEikonEnv* aEnv);
00477     IMPORT_C CAknEnv();
00478     IMPORT_C void ConstructL();
00479     
00480 public:
00488     IMPORT_C TBool TransparencyEnabled() const; 
00489 
00490 private:
00491         MEikMenuObserver* iFepMenuObserver;
00492         MAknEditingStateIndicator* iEditStateIndicator;
00493 private:
00494         CArrayPtr<MAknIntermediateState> *iStateArray;
00495         CArrayPtr<CBase> *iDeleteArray;
00496         CIdle *iIdle;
00497         CAknWaitDialog* iBusyMsgDialog;
00498         TInt iBusyMsgCount;
00499         MEikCommandObserver *iCbaCommandObserver;
00500     CAknSettingCache* iSettingCache;
00501     TBidirectionalState::TRunInfo* iRunInfoArray;
00502     TInt iRunInfoArrayLength;
00503 
00504     struct TWsBufferRequest
00505         {
00506         TInt iRequestID;
00507         TInt iRequestedSize;
00508         };
00509 
00510     RArray<TWsBufferRequest> iWsBufferRequestArray;
00511     TInt iRequestIdCounter;
00512     TInt iCurrentWsBufferRequest;
00513 
00514         // cache for layout parameters
00515         TAknLayoutId iLastLayoutId;
00516         TInt iLastScreenMode;
00517         TAknUiZoom iLastZoom;
00518 
00519         CEikonEnv* iCoeEnv;
00520     CAknFontRegistry* iFontRegistry;  // Owned register of CAknLayoutFont pointers
00521     CCdlEngineRef* iCdlEngRef;
00522     const AknLayout::CInstance* iLayout;        
00523     CArrayPtr<CAknSystemFont>* iSystemFontArray; // Not owned. System Font array is owned by CEikonEnv
00524     TBool iSplitViewActive;
00525     CTransitionManager* iTransitionManager;
00526     CAknCommandMediator* iCommandMediator;
00527     /*
00528      * Set the feature language Id
00529      * If device uses Japanese language variant, KFeatureIdJapanese is set.
00530      * @since 3.1
00531      */
00532     TInt iFeatureLanguage;
00533     };
00534 
00535 
00536 #define iAvkonEnv (STATIC_CAST(CAknEnv*,iEikonEnv->Extension()))
00537 #define AVKONENV (STATIC_CAST(CAknEnv*, CEikonEnv::Static()->Extension()))
00538 
00539 #endif

Copyright © Nokia Corporation 2001-2007
Back to top