aknviewappui.h

Go to the documentation of this file.
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     
00241     IMPORT_C void EnableLocalScreenClearer( TBool aEnable = ETrue );
00242         
00249     TRect ViewRect( const TUid aViewId ) const;
00250         
00257     TKeyResponse HandleViewNavigationL( const TKeyEvent& aKeyEvent );
00258         
00259 protected:
00260         
00265         IMPORT_C void HandleStatusPaneSizeChange();
00266 
00273         IMPORT_C void HandleForegroundEventL(TBool aForeground);
00274 
00282     IMPORT_C void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
00283         
00284 private:
00285         static TInt ActivationCallBack(TAny* aThis);
00286         void ActivationTick();
00287         void QueueActivationTick();
00288 
00293     CAknViewAppUiExtension* Extension() const;
00294 
00300     void ActivateSplitViewL( CViewActivationItem* aItem );
00301         
00308     TAknSplitViewContainer* SplitView( const TUid aViewId ) const;
00309         
00310 protected:
00311         
00312     // Application view.
00313     CAknView* iView;
00314         
00315     // Application views.
00316     CAknViews* iViews;
00317 
00318 private:
00319     CAknViewShutter* iShutter;
00320     CAknLocalScreenClearer* iClearer;
00321     CAknViewActivationQueue* iActivationQueue;
00322     CIdle* iActivationTick;
00323     // extension class
00324     CAknViewAppUiExtension* iExtension;
00325     };
00326 
00327 // __AKNVIEWAPPUI_H__
00328 #endif

Copyright © Nokia Corporation 2001-2008
Back to top