00001 /* 00002 * ============================================================================ 00003 * Name : eiktbar.h 00004 * Part of : S60 UI Framework / EikCoCtl 00005 * Description : Class declaration for EIKON toolbar control. 00006 * Version : %version: 1 % 00007 * 00008 * Copyright © 2002-2006 Nokia. All rights reserved. 00009 * This material, including documentation and any related computer 00010 * programs, is protected by copyright controlled by Nokia. All 00011 * rights are reserved. Copying, including reproducing, storing, 00012 * adapting or translating, any or all of this material requires the 00013 * prior written consent of Nokia. This material also contains 00014 * confidential information which may not be disclosed to others 00015 * without the prior written consent of Nokia. 00016 * ============================================================================ 00017 */ 00018 // Copyright (c) 1997-1999 Symbian Ltd. All rights reserved. 00019 00020 #ifndef __EIKTBAR_H__ 00021 #define __EIKTBAR_H__ 00022 00023 #include <eikctgrp.h> 00024 #include <coecobs.h> 00025 #include <eikbtgrp.h> 00026 #include <eikbtgpc.h> 00027 00028 // Forward declarations 00029 00030 class MEikCommandObserver; 00031 class TEikButtonCoordinator; 00032 class CEikCommandButton; 00033 class CCoeBrushAndPenContext; 00034 00047 class CEikToolBar : public CEikControlGroup, 00048 public MCoeControlObserver, 00049 public MEikButtonGroup 00050 { 00051 public: 00052 00057 IMPORT_C ~CEikToolBar(); 00058 00064 IMPORT_C CEikToolBar(); 00065 00102 IMPORT_C void ConstructL( MEikCommandObserver* aCommandObserver, 00103 TInt aResourceId, 00104 const TRect& aBoundingRect ); 00105 00123 IMPORT_C void StaticConstructL( MEikCommandObserver* aCommandObserver, 00124 TInt aResourceId ); 00125 00134 IMPORT_C void SetCommandObserver(MEikCommandObserver* aCommandObserver); 00135 00143 IMPORT_C void CoordinateButtons( TInt aId, 00144 TInt aCount, 00145 TEikButtonCoordinator* aCoordinator ); 00146 00154 IMPORT_C void SetButtonStateOn(TInt aId,TBool aState); 00155 00168 IMPORT_C TBool DelayActivation() const; 00169 00170 public: 00182 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader); 00183 00193 IMPORT_C void SetDimmed(TBool aDimmed); 00194 00204 IMPORT_C void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; 00205 00220 IMPORT_C void HandleResourceChange(TInt aType); 00221 00236 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 00237 00238 public: 00249 IMPORT_C void AddControlL(CCoeControl* aControl,TInt aId); 00250 00259 IMPORT_C void AddControlL(TEikGroupControl& aGroupControl); 00260 00261 public: // but not exported 00262 00270 void AddControlTypeL(TInt aType); 00271 00280 void RemoveControlType(TInt aIndex); 00281 00290 TBool ControlIsButton(TInt aIndex) const; 00291 00292 public: 00309 IMPORT_C void SetBoundingRect(const TRect& aBoundingRect); 00310 00323 IMPORT_C void ReduceRect(TRect& aBoundingRect) const; 00324 00325 protected: 00326 00338 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const; 00339 00340 private: 00341 00342 CEikCommandButton* ButtonByIndex(TInt aIndex) const; 00343 void SetCurrentId(TInt aPosition,TInt aId); 00344 TInt CurrentId(TInt aPosition) const; 00345 TEikGroupControl& GroupControlByIndex(TInt aIndex) const; 00346 TInt IndexFromPosition(TInt aPos) const; 00347 00348 private: 00350 void SetCommandL( TInt aPosition, 00351 TInt aCommandId, 00352 const TDesC* aText, 00353 const CFbsBitmap* aBitmap, 00354 const CFbsBitmap* aMask ); 00355 00356 void SetCommandL(TInt aPosition,TInt aResourceId); 00357 void SetCommandSetL(TInt aResourceId); 00358 void AddCommandL( TInt aPosition, 00359 TInt aCommandId, 00360 const TDesC* aText, 00361 const CFbsBitmap* aBitmap, 00362 const CFbsBitmap* aMask ); 00363 void AddCommandToStackL( TInt aPosition, 00364 TInt aCommandId, 00365 const TDesC* aText, 00366 const CFbsBitmap* aBitmap, 00367 const CFbsBitmap* aMask ); 00368 void AddCommandToStackL(TInt aPosition,TInt aResourceId); 00369 void AddCommandSetToStackL(TInt aResourceId); 00370 void SetDefaultCommand(TInt aCommandId); 00371 TSize CalcMinimumSizeL(TInt aResourceId); 00372 void RemoveCommandFromStack(TInt aPosition,TInt aCommandId); 00373 TInt CommandPos(TInt aCommandId) const; 00374 void DimCommand(TInt aCommandId,TBool aDimmed); 00375 TBool IsCommandDimmed(TInt aCommandId) const; 00376 void MakeCommandVisible(TInt aCommandId,TBool aVisible); 00377 TBool IsCommandVisible(TInt aCommandId) const; 00378 CCoeControl* AsControl(); 00379 const CCoeControl* AsControl() const; 00380 CCoeControl* GroupControlById(TInt aCommandId) const; 00381 CEikCommandButton* GroupControlAsButton(TInt aCommandId) const; 00382 TInt CommandId(TInt aCommandPos) const; 00383 TInt ButtonCount() const; 00384 TUint ButtonGroupFlags() const; 00385 00386 void SetMSKCommandObserver(MEikCommandObserver* aCommandObserver); 00387 void DimCommandByPosition(TInt aPosition,TBool aDimmed); 00388 TBool IsCommandDimmedByPosition(TInt aPosition) const; 00389 void MakeCommandVisibleByPosition(TInt aPosition,TBool aVisible); 00390 TBool IsCommandVisibleByPosition(TInt aPosition) const; 00391 void AnimateCommandByPosition(TInt aPosition); 00392 00393 private: 00394 IMPORT_C void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEvent); 00395 00396 private: 00397 IMPORT_C void Reserved_2(); 00398 00399 private: 00401 IMPORT_C void* ExtensionInterface( TUid aInterface ); 00402 private: 00403 void BaseConstructL(); 00404 TInt ControlCount() const; 00405 private: 00406 TInt iToolBarFlags; 00407 MEikCommandObserver* iCommandObserver; 00408 CCoeBrushAndPenContext* iBrushAndPenContext; 00409 CArrayFix<TInt>* iControlTypes; 00410 }; 00411 00412 // __EIKTBAR_H__ 00413 #endif