aknview.h

Go to the documentation of this file.
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 
00239         IMPORT_C virtual void DoActivateL(const TVwsViewId& aPrevViewId,
00240                                           TUid aCustomMessageId,
00241                                           const TDesC8& aCustomMessage) = 0;
00242 
00247         virtual void DoDeactivate() = 0;
00248 
00249 protected: // From MCoeView.
00250 
00259         IMPORT_C void ViewActivatedL(const TVwsViewId& aPrevViewId,
00260                                      TUid aCustomMessageId,
00261                                      const TDesC8& aCustomMessage);
00262 
00268         IMPORT_C void ViewDeactivated();
00269 
00274         IMPORT_C TVwsViewIdAndMessage ViewScreenDeviceChangedL();
00275 
00276 protected: // from MObjectProvider
00277 
00288         IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
00289 
00295         IMPORT_C MObjectProvider* MopNext();
00296 
00297 protected: // From MEikMenuObserver.
00298 
00307         IMPORT_C virtual void SetEmphasis(CCoeControl* aMenuControl,
00308                                           TBool aEmphasis);
00309 
00315         IMPORT_C virtual void HandleForegroundEventL(TBool aForeground);
00316 
00317 private: // internal functions
00318         void ConstructMenuAndCbaL(TBool aVisible);
00319 
00324         CAknViewExtension* Extension() const;
00325         
00326 public: // new functions
00327 
00332         IMPORT_C CAknToolbar* Toolbar() const;
00333         
00338         IMPORT_C void StopDisplayingToolbar();
00339     
00346     IMPORT_C TBool ToolbarShownOnViewActivation() const; 
00347  
00354     IMPORT_C void ShowToolbarOnViewActivation( TBool aVisible ); 
00355 
00363     void SaveToolbarStatus( TBool aVisible, TBool aFocused ); 
00364                 
00365 protected:  // Data
00366         // The follow object is not owned by this class. iCoeEnv is protected in 
00367         // keeping with @c CCoeAppUi & @c CCoeControl
00368         CCoeEnv* iCoeEnv;
00369 
00370 private:
00371         CAknViewAppUi* iAppUi;
00372 
00373         // @c SAknViewInfo is the C++ image of resource structure AVKON_VIEW
00374         struct SAknViewInfo
00375                 {
00376         public:
00377         TUint8 iVersion;    // resource struct version
00378                 TInt iHotKeys;          // resource id
00379                 TInt iMenu;                     // resource id
00380                 TInt iCba;                      // resource id
00381         TInt iToolbar;      // resource id
00382         TInt iExtension;    // resource id
00383                 };
00384 
00385         // The following member data are owned by this class
00386         SAknViewInfo iViewInfo;
00387         CEikMenuBar* iMenu;
00388         CEikButtonGroupContainer* iCba;
00389         TBitFlags iFlags;
00390     CAknViewExtension* iExtension;
00391         };
00392 
00393 // AKNVIEW_H
00394 #endif

Copyright © Nokia Corporation 2001-2008
Back to top