00001 /* 00002 * ============================================================================ 00003 * Name : AknView.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 // AknView.h 00021 // 00022 // Copyright (c) 1997-2001 Symbian Ltd. All rights reserved. 00023 // 00024 00025 #ifndef AKNVIEW_H 00026 #define AKNVIEW_H 00027 00028 // INCLUDES 00029 #include <babitflags.h> 00030 #include <coecntrl.h> 00031 #include <eikmobs.h> 00032 #include <coeaui.h> 00033 #include <coeview.h> 00034 #include <eikdef.h> 00035 #include <coemop.h> 00036 00037 // FORWARD DECLARATIONS 00038 class CAknViewAppUi; 00039 class CEikStatusPane; 00040 class CEikButtonGroupContainer; 00041 class CAknControlStack; 00042 class CAknViewExtension; 00043 class CAknToolbar; 00044 00045 // CLASS DECLARATION 00046 00052 class CAknView : public CBase, public MCoeView, public MEikMenuObserver, 00053 public MObjectProvider 00054 { 00055 public: 00056 00060 IMPORT_C CAknView(); 00061 00065 IMPORT_C ~CAknView(); 00066 00074 IMPORT_C void BaseConstructL(TInt aResId=0); 00075 00082 IMPORT_C void ConstructMenuAndCbaEarlyL(); 00083 00089 IMPORT_C void ActivateViewL(const TVwsViewId& aViewId); 00090 00099 IMPORT_C void ActivateViewL(const TVwsViewId& aViewId, 00100 TUid aCustomMessageId, 00101 const TDesC8& aCustomMessage); 00102 00107 IMPORT_C virtual TUid Id() const =0; 00108 00114 IMPORT_C virtual void HandleStatusPaneSizeChange(); 00115 00120 IMPORT_C TVwsViewId ViewId() const; 00121 00129 IMPORT_C virtual void ProcessCommandL(TInt aCommand); 00130 00136 IMPORT_C virtual void HandleCommandL(TInt aCommand); 00137 00143 IMPORT_C virtual CEikMenuBar* MenuBar() const; 00144 00152 IMPORT_C TRect ClientRect() const; 00153 00159 IMPORT_C void StopDisplayingMenuBar(); 00160 00165 IMPORT_C TBool IsForeground() const; 00166 00172 IMPORT_C virtual void HandleViewRectChange(); 00173 00180 IMPORT_C virtual void Redraw() const; 00181 00182 00187 IMPORT_C virtual void AknViewActivatedL(const TVwsViewId& aPrevViewId, 00188 TUid aCustomMessageId, 00189 const TDesC8& aCustomMessage); 00190 00196 void AknViewDeactivated(); 00197 00201 void ProcessForegroundEventL(TBool aForeground); 00202 00203 private: // formerly from @c MTopSetMember<CEikMenuBar> 00204 IMPORT_C virtual void Reserved_MtsmPosition(); 00205 IMPORT_C virtual void Reserved_MtsmObject(); 00206 00207 protected: 00208 00213 IMPORT_C CAknViewAppUi* AppUi() const; 00214 00219 IMPORT_C CEikStatusPane* StatusPane() const; 00220 00227 IMPORT_C CEikButtonGroupContainer* Cba() const; 00228 00237 IMPORT_C virtual void DoActivateL(const TVwsViewId& aPrevViewId, 00238 TUid aCustomMessageId, 00239 const TDesC8& aCustomMessage) = 0; 00240 00245 virtual void DoDeactivate() = 0; 00246 00247 protected: // From MCoeView. 00248 00257 IMPORT_C void ViewActivatedL(const TVwsViewId& aPrevViewId, 00258 TUid aCustomMessageId, 00259 const TDesC8& aCustomMessage); 00260 00266 IMPORT_C void ViewDeactivated(); 00267 00272 IMPORT_C TVwsViewIdAndMessage ViewScreenDeviceChangedL(); 00273 00274 protected: // from MObjectProvider 00275 00286 IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId); 00287 00293 IMPORT_C MObjectProvider* MopNext(); 00294 00295 protected: // From MEikMenuObserver. 00296 00305 IMPORT_C virtual void SetEmphasis(CCoeControl* aMenuControl, 00306 TBool aEmphasis); 00307 00313 IMPORT_C virtual void HandleForegroundEventL(TBool aForeground); 00314 00315 private: // internal functions 00316 void ConstructMenuAndCbaL(TBool aVisible); 00317 00322 CAknViewExtension* Extension() const; 00323 00324 public: // new functions 00325 00330 IMPORT_C CAknToolbar* Toolbar() const; 00331 00336 IMPORT_C void StopDisplayingToolbar(); 00337 00338 00339 00340 00341 protected: // Data 00342 // The follow object is not owned by this class. iCoeEnv is protected in 00343 // keeping with @c CCoeAppUi & @c CCoeControl 00344 CCoeEnv* iCoeEnv; 00345 00346 private: 00347 CAknViewAppUi* iAppUi; 00348 00349 // @c SAknViewInfo is the C++ image of resource structure AVKON_VIEW 00350 struct SAknViewInfo 00351 { 00352 public: 00353 TUint8 iVersion; // resource struct version 00354 TInt iHotKeys; // resource id 00355 TInt iMenu; // resource id 00356 TInt iCba; // resource id 00357 TInt iToolbar; // resource id 00358 TInt iExtension; // resource id 00359 }; 00360 00361 // The following member data are owned by this class 00362 SAknViewInfo iViewInfo; 00363 CEikMenuBar* iMenu; 00364 CEikButtonGroupContainer* iCba; 00365 TBitFlags iFlags; 00366 CAknViewExtension* iExtension; 00367 }; 00368 00369 // AKNVIEW_H 00370 #endif