00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #if !defined(__AVKON_ENV_H__)
00021 #define __AVKON_ENV_H__
00022
00023
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>
00031 #include <akndef.h>
00032
00033
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
00051
00052 typedef CLafSystemFont CAknSystemFont;
00053
00054
00055
00062
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
00068
00069
00070
00071
00072
00080 class CAknEnv : public CBase
00081 {
00082 public:
00092 IMPORT_C static CAknEnv* Static();
00093
00097 IMPORT_C ~CAknEnv();
00098 public:
00099
00100
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:
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:
00345
00352 IMPORT_C TBool LoadAknLayoutL();
00360 IMPORT_C TBool LoadAknLayoutL(const TAknLayoutConfigScreenMode& aScreenMode);
00361
00368 void ReloadAknLayoutL();
00369
00370
00377 IMPORT_C const AknLayout::CInstance& AknLayout() const;
00378
00379 public:
00388 IMPORT_C static TRgb AvkonColor( TInt );
00389
00390 public:
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:
00410
00411
00412
00413
00414
00415
00416 TBool IsFeatureLanguage(TInt aFeatureLanguage);
00417
00418 private:
00419
00420 void SetWsBufferSize();
00421 void SetWsBufferSize( TInt aRequestedBufferSize );
00422
00423
00424
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
00515 TAknLayoutId iLastLayoutId;
00516 TInt iLastScreenMode;
00517 TAknUiZoom iLastZoom;
00518
00519 CEikonEnv* iCoeEnv;
00520 CAknFontRegistry* iFontRegistry;
00521 CCdlEngineRef* iCdlEngRef;
00522 const AknLayout::CInstance* iLayout;
00523 CArrayPtr<CAknSystemFont>* iSystemFontArray;
00524 TBool iSplitViewActive;
00525 CTransitionManager* iTransitionManager;
00526 CAknCommandMediator* iCommandMediator;
00527
00528
00529
00530
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