00001 /* 00002 * ============================================================================ 00003 * Name : AknViewAppUi.h 00004 * Part of : Avkon 00005 * 00006 * Description: Base class for view architecture-based applications. 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 #ifndef __AKNVIEWAPPUI_H__ 00021 #define __AKNVIEWAPPUI_H__ 00022 00023 // INCLUDES 00024 #include <aknappui.h> 00025 00026 // FORWARD DECLARATIONS 00027 class CAknView; 00028 class CAknViewShutter; 00029 class CAknLocalScreenClearer; 00030 class CAknViewAppUiExtension; 00031 class CAknViewNavigator; 00032 00033 // MACROS 00034 #define iAvkonViewAppUi ((CAknViewAppUi*)CEikonEnv::Static()->EikAppUi()) 00035 00036 // CLASS DECLARATION 00037 00043 class CAknViewAppUi : public CAknAppUi 00044 { 00045 public: 00046 NONSHARABLE_CLASS(CViewActivationItem) : public CBase 00047 { 00048 public: 00049 00058 static CViewActivationItem* NewLC(CAknView* aNewView, 00059 TUid aCustomMessageId, 00060 const TDesC8& aCustomMessage, 00061 const TVwsViewId& aPrevViewId); 00062 00066 ~CViewActivationItem(); 00067 private: 00068 CViewActivationItem(CAknView* aNewView, 00069 TUid aCustomMessageId, 00070 const TVwsViewId& aPrevViewId); 00071 00072 void ConstructL(const TDesC8& aCustomMessage); 00073 public: 00074 00075 // Application view. 00076 CAknView* iNewView; 00077 00078 // Message ID. 00079 TUid iCustomMessageId; 00080 00081 // Message contents. 00082 HBufC8* iCustomMessage; 00083 00084 // The UID of the previously active view. 00085 TVwsViewId iPrevViewId; 00086 }; 00087 00091 NONSHARABLE_CLASS(TAknSplitViewContainer) 00092 { 00093 public: 00099 TBool IsPartOf( const TUid aViewId ); 00100 00101 public: 00102 // view uids 00103 TUid iViewIds[2]; 00104 // ETrue if a view's activation failed 00105 TBool iFailed[2]; 00106 // drawing areas 00107 TRect iViewRect[2]; 00108 // the size of the leftmost view 00109 TInt iLeftViewSize; 00110 }; 00111 00112 typedef CArrayPtrFlat<CViewActivationItem> CAknViewActivationQueue; 00113 typedef CArrayPtrFlat<CAknView> CAknViews; 00114 00115 public: 00116 00121 IMPORT_C void BaseConstructL(TInt aAppUiFlags=EStandardApp); 00122 00126 IMPORT_C virtual ~CAknViewAppUi(); 00127 00133 IMPORT_C void ActivateLocalViewL(TUid aViewId); 00134 00143 IMPORT_C void ActivateLocalViewL(TUid aViewId, 00144 TUid aCustomMessageId, 00145 const TDesC8& aCustomMessage); 00146 00153 IMPORT_C CAknView* View(TUid aView) const; 00154 00160 IMPORT_C void AddViewL(CAknView* aView); // takes ownership of aView 00161 00167 IMPORT_C void RemoveView(TUid aViewId); 00168 00173 IMPORT_C void ProcessCommandL(TInt aCommand); 00174 00178 IMPORT_C void StopDisplayingMenuBar(); 00179 00180 // Avkon view architecture system. Internal use only. 00181 void ViewActivatedL(CAknView* aView, 00182 const TVwsViewId& aPrevViewId, 00183 TUid aCustomMessageId, 00184 const TDesC8& aCustomMessage); 00185 00186 void ViewDeactivated(CAknView* aView); 00187 00196 IMPORT_C void SetSplitViewL( const TUid aView1Id, const TUid aView2Id, const TInt aLeftViewSize ); 00197 00205 IMPORT_C void RemoveSplitViewL( const TUid aViewId ); 00206 00212 IMPORT_C TBool SplitViewActive() const; 00213 00219 IMPORT_C TUid FocusedView() const; 00220 00227 IMPORT_C TBool ViewShown( const TUid aViewId ) const; 00228 00235 TRect ViewRect( const TUid aViewId ) const; 00236 00243 TKeyResponse HandleViewNavigationL( const TKeyEvent& aKeyEvent ); 00244 00245 protected: 00246 00251 IMPORT_C void HandleStatusPaneSizeChange(); 00252 00259 IMPORT_C void HandleForegroundEventL(TBool aForeground); 00260 00268 IMPORT_C void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); 00269 00270 private: 00271 static TInt ActivationCallBack(TAny* aThis); 00272 void ActivationTick(); 00273 void QueueActivationTick(); 00274 00279 CAknViewAppUiExtension* Extension() const; 00280 00286 void ActivateSplitViewL( CViewActivationItem* aItem ); 00287 00294 TAknSplitViewContainer* SplitView( const TUid aViewId ) const; 00295 00296 protected: 00297 00298 // Application view. 00299 CAknView* iView; 00300 00301 // Application views. 00302 CAknViews* iViews; 00303 00304 private: 00305 CAknViewShutter* iShutter; 00306 CAknLocalScreenClearer* iClearer; 00307 CAknViewActivationQueue* iActivationQueue; 00308 CIdle* iActivationTick; 00309 // extension class 00310 CAknViewAppUiExtension* iExtension; 00311 }; 00312 00313 #endif // __AKNVIEWAPPUI_H__