aknnavide.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : aknnavide.h
00004 *  Part of     : UI Framework / AVKON
00005 *  Description : Decorator class for navigation pane controls.
00006 *                The class, for example, decorates navigation pane controls
00007 *                with navi arrows.
00008 *  Version     : %version: tr1s60#22 %
00009 *
00010 *  Copyright © 2002-2007 Nokia.  All rights reserved.
00011 *  This material, including documentation and any related computer
00012 *  programs, is protected by copyright controlled by Nokia.  All
00013 *  rights are reserved.  Copying, including reproducing, storing,
00014 *  adapting or translating, any or all of this material requires the
00015 *  prior written consent of Nokia.  This material also contains
00016 *  confidential information which may not be disclosed to others
00017 *  without the prior written consent of Nokia.
00018 * ============================================================================
00019 */
00020 
00021 #ifndef C_AKNNAVIDE_H
00022 #define C_AKNNAVIDE_H
00023 
00024 #include <akncontrol.h>
00025 #include <coeccntx.h>
00026 #include <e32std.h>
00027 
00028 #include <aknnaviobserver.h>
00029 #include <aknnavi.h>
00030 
00031 class CEikScrollButton;
00032 class CAknTabGroup;
00033 class MAknNaviDecoratorObserver;
00034 class CAknNavigationDecoratorExtension;
00035 
00040 class CAknNavigationDecorator :  public CAknControl,
00041                                  public MCoeControlObserver,
00042                                  public MAknNavigationDecoratorInterface
00043     {
00044 
00045 friend class CAknNavigationControlContainer;
00046 
00047 public:
00048 
00052     enum TScrollButton
00053         {
00055         ELeftButton =  0x0001,
00056 
00058         ERightButton = 0x0002
00059         };
00060 
00064     enum TControlType
00065         {
00067         ENotSpecified,
00068 
00070         ETabGroup,
00071 
00073         ENaviLabel,
00074 
00076         ENaviImage,
00077 
00079         EHintText,
00080 
00082         EEditorIndicator,
00083 
00085         ENaviVolume
00086         };
00087 
00088 public:
00089 
00101     IMPORT_C static CAknNavigationDecorator* NewL(
00102         CAknNavigationControlContainer* aNavigationControlContainer,
00103         CCoeControl* aDecoratedControl,
00104         TControlType aType = ENotSpecified);
00105 
00109     IMPORT_C ~CAknNavigationDecorator();
00110 
00117     IMPORT_C CCoeControl* DecoratedControl();
00118 
00126     IMPORT_C void MakeScrollButtonVisible(TBool aVisible);
00127 
00133     IMPORT_C TBool ScrollButtonVisible() const;
00134 
00144     IMPORT_C void SetScrollButtonDimmed(TScrollButton aButton, TBool aDimmed);
00145 
00153     IMPORT_C TBool IsScrollButtonDimmed(TScrollButton aButton) const;
00154 
00160     IMPORT_C void SetControlType(TControlType aType);
00161 
00167     IMPORT_C TControlType ControlType() const;
00168 
00174     IMPORT_C virtual void SetNaviDecoratorObserver(
00175                         MAknNaviDecoratorObserver* aObserver);
00176 
00182     void SetNaviStack(CAknNavigationControlContainer* aContainer);
00183 
00191     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00192 
00196     enum TAknNaviControlLayoutStyle
00197         {
00199         ENaviControlLayoutNormal = 0x1,
00200 
00202         ENaviControlLayoutNarrow = 0x2,
00203 
00210         ENaviControlLayoutWide   = 0x4
00211         };
00212 
00216     enum TAknNaviControlLayoutMode
00217         {
00223         ENaviControlLayoutModeAutomatic = 0x400,
00224 
00229         ENaviControlLayoutModeForced = 0x800
00230         };
00231 
00232 
00252     IMPORT_C void SetNaviControlLayoutStyle(TAknNaviControlLayoutStyle aStyle);
00253 
00262     IMPORT_C TAknNaviControlLayoutStyle NaviControlLayoutStyle();
00263 
00275     IMPORT_C TBool NaviControlLayoutStyleSupported(TAknNaviControlLayoutStyle
00276                                                    aStyle);
00277 
00287     IMPORT_C void SetNaviControlLayoutMode(TAknNaviControlLayoutMode aMode);
00288 
00299     IMPORT_C TAknNaviControlLayoutMode NaviControlLayoutMode();
00300 
00301 
00302 protected: // from CCoeControl
00303 
00309     IMPORT_C virtual void SizeChanged();
00310 
00318     IMPORT_C virtual TInt CountComponentControls() const;
00319 
00328     IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const;
00329 
00330 public: // from CCoeControl
00336     IMPORT_C virtual void HandleResourceChange(TInt aType);
00337 
00338 protected: // from MCoeControlObserver
00339 
00348     IMPORT_C void HandleControlEventL(CCoeControl* aControl,
00349                                       TCoeEvent aEventType);
00350 
00351 private:
00352 
00356     IMPORT_C void* ExtensionInterface( TUid aInterface );
00357 
00358 private:
00359 
00363     IMPORT_C void ConstructL();
00364 
00365 private:
00366 
00370     IMPORT_C virtual void Draw(const TRect& aRect) const;
00371 
00375     TRect ParentRect();
00376 
00377 public:
00378 
00387     static TRect DecoratedControlRect(TInt aControlType);
00388 
00395     static TRect DecoratedControlNarrowRect(TInt aControlType);
00396 
00397 private:
00398 
00407     static TRect DecoratedDefaultControlRect();
00408 
00409 public:
00410 
00422     static TRect DecoratedTabControlRect( TBool aTopAdjacent );
00423 
00424 private:
00425 
00434     static TRect DecoratedVolumeControlRect();
00435 
00439     void SizeChangedInNormalLayout();
00440 
00444     void SizeChangedInNarrowLayout();
00445 
00449     void SizeChangedInWideLayout();
00450 
00455     void InitLayoutStyleTimer();
00456 
00460     void CancelLayoutStyleTimer();
00461 
00466     static TInt LayoutStyleEvent(TAny * aPtr);
00467 
00472     void DoLayoutStyleEvent();
00473 
00474     void StartTimerL();
00475 
00476     void SmallDirectionIndicationL();
00477 
00478     static TInt IndicationDrawCallbackL( TAny* aThis );
00479 
00484     void CancelTimer();
00485 
00502     static TRect NaviArrowRect( TScrollButton aScrollButton,
00503                                 TRect aNaviRect = TRect( 0,0,0,0 ) );
00504 
00505 protected:
00506 
00511     CCoeControl* iDecoratedControl;
00512 
00516     CAknNavigationControlContainer* iContainer;
00517 
00521     MAknNaviDecoratorObserver* iNaviDecoratorObserver;
00522 
00523 private:
00524     TBool iNaviArrowsVisible;
00525     TBool iNaviArrowLeftDimmed;
00526     TBool iNaviArrowRightDimmed;
00527     TControlType iControlType;
00528     TPoint iArrowLeftPos;
00529     TSize  iArrowLeftSize;
00530     TPoint iArrowRightPos;
00531     TSize  iArrowRightSize;
00532 
00533     TInt iLayoutFlags;
00534     CPeriodic* iLayoutStyleTimer;
00535 
00536     CAknNavigationDecoratorExtension* iExtension;
00537 
00538     TInt iSpare;
00539     };
00540 
00541 // C_AKNNAVIDE_H
00542 #endif

Copyright © Nokia Corporation 2001-2008
Back to top