00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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:
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:
00336 IMPORT_C virtual void HandleResourceChange(TInt aType);
00337
00338 protected:
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
00393 static TRect DecoratedControlRect( TInt aControlType,
00394 TBool aArrowsUsed = ETrue );
00395
00402 static TRect DecoratedControlNarrowRect( TInt aControlType );
00403
00404 private:
00405
00414 static TRect DecoratedDefaultControlRect();
00415
00416 public:
00417
00433 static TRect DecoratedTabControlRect( TBool aTopAdjacent,
00434 TBool aArrowsUsed );
00435
00436 private:
00437
00446 static TRect DecoratedVolumeControlRect();
00447
00451 void SizeChangedInNormalLayout();
00452
00456 void SizeChangedInNarrowLayout();
00457
00461 void SizeChangedInWideLayout();
00462
00467 void InitLayoutStyleTimer();
00468
00472 void CancelLayoutStyleTimer();
00473
00478 static TInt LayoutStyleEvent(TAny * aPtr);
00479
00484 void DoLayoutStyleEvent();
00485
00486 void StartTimerL();
00487
00488 void SmallDirectionIndicationL();
00489
00490 static TInt IndicationDrawCallbackL( TAny* aThis );
00491
00496 void CancelTimer();
00497
00518 static TRect NaviArrowRect( TScrollButton aScrollButton,
00519 TBool aNarrowLayout = EFalse,
00520 TRect aNaviRect = TRect( 0,0,0,0 ) );
00521
00522 protected:
00523
00528 CCoeControl* iDecoratedControl;
00529
00533 CAknNavigationControlContainer* iContainer;
00534
00538 MAknNaviDecoratorObserver* iNaviDecoratorObserver;
00539
00540 private:
00541 TBool iNaviArrowsVisible;
00542 TBool iNaviArrowLeftDimmed;
00543 TBool iNaviArrowRightDimmed;
00544 TControlType iControlType;
00545 TPoint iArrowLeftPos;
00546 TSize iArrowLeftSize;
00547 TPoint iArrowRightPos;
00548 TSize iArrowRightSize;
00549
00550 TInt iLayoutFlags;
00551 CPeriodic* iLayoutStyleTimer;
00552
00553 CAknNavigationDecoratorExtension* iExtension;
00554
00555 TInt iSpare;
00556 };
00557
00558 #endif // C_AKNNAVIDE_H