eiktbar.h

Go to the documentation of this file.
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 
00019 #ifndef __EIKTBAR_H__
00020 #define __EIKTBAR_H__
00021 
00022 #include <eikctgrp.h>
00023 #include <coecobs.h>
00024 #include <eikbtgrp.h>
00025 #include <eikbtgpc.h>
00026 
00027 // Forward declarations
00028 
00029 class MEikCommandObserver;
00030 class TEikButtonCoordinator;
00031 class CEikCommandButton;
00032 class CCoeBrushAndPenContext;
00033 
00046 class CEikToolBar : public CEikControlGroup,
00047                     public MCoeControlObserver,
00048                     public MEikButtonGroup
00049         {
00050 public:
00051 
00056         IMPORT_C ~CEikToolBar();
00057         
00063         IMPORT_C CEikToolBar();
00064         
00101         IMPORT_C void ConstructL( MEikCommandObserver* aCommandObserver,
00102                                   TInt aResourceId,
00103                                   const TRect& aBoundingRect );
00104         
00122         IMPORT_C void StaticConstructL( MEikCommandObserver* aCommandObserver,
00123                                         TInt aResourceId );
00124         
00133         IMPORT_C void SetCommandObserver(MEikCommandObserver* aCommandObserver);
00134         
00142         IMPORT_C void CoordinateButtons( TInt aId,
00143                                          TInt aCount,
00144                                          TEikButtonCoordinator* aCoordinator );
00145         
00153         IMPORT_C void SetButtonStateOn(TInt aId,TBool aState);
00154         
00167         IMPORT_C TBool DelayActivation() const;
00168         
00169 public: 
00181         IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
00182         
00192         IMPORT_C void SetDimmed(TBool aDimmed);
00193         
00203         IMPORT_C void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const;
00204         
00219         IMPORT_C void HandleResourceChange(TInt aType);
00220         
00235         IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00236         
00237 public: 
00248         IMPORT_C void AddControlL(CCoeControl* aControl,TInt aId);
00249         
00258         IMPORT_C void AddControlL(TEikGroupControl& aGroupControl);
00259         
00260 public: // but not exported
00261 
00269         void AddControlTypeL(TInt aType);
00270         
00279         void RemoveControlType(TInt aIndex);
00280         
00289         TBool ControlIsButton(TInt aIndex) const;
00290         
00291 public: 
00308         IMPORT_C void SetBoundingRect(const TRect& aBoundingRect);
00309         
00322         IMPORT_C void ReduceRect(TRect& aBoundingRect) const;
00323         
00324 protected:
00325 
00337         IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
00338         
00339 private:
00340 
00341         CEikCommandButton* ButtonByIndex(TInt aIndex) const;    
00342         void SetCurrentId(TInt aPosition,TInt aId);     
00343         TInt CurrentId(TInt aPosition) const;   
00344         TEikGroupControl& GroupControlByIndex(TInt aIndex) const;       
00345         TInt IndexFromPosition(TInt aPos) const;
00346         
00347 private: 
00349         void SetCommandL( TInt aPosition,
00350                           TInt aCommandId,
00351                           const TDesC* aText,
00352                           const CFbsBitmap* aBitmap,
00353                           const CFbsBitmap* aMask );
00354                           
00355         void SetCommandL(TInt aPosition,TInt aResourceId);
00356         void SetCommandSetL(TInt aResourceId);
00357         void AddCommandL( TInt aPosition,
00358                           TInt aCommandId,
00359                           const TDesC* aText,
00360                           const CFbsBitmap* aBitmap,
00361                           const CFbsBitmap* aMask );
00362         void AddCommandToStackL( TInt aPosition,
00363                                  TInt aCommandId,
00364                                  const TDesC* aText,
00365                                  const CFbsBitmap* aBitmap,
00366                                  const CFbsBitmap* aMask );
00367         void AddCommandToStackL(TInt aPosition,TInt aResourceId);
00368         void AddCommandSetToStackL(TInt aResourceId);
00369         void SetDefaultCommand(TInt aCommandId);
00370         TSize CalcMinimumSizeL(TInt aResourceId);
00371         void RemoveCommandFromStack(TInt aPosition,TInt aCommandId);
00372         TInt CommandPos(TInt aCommandId) const;
00373         void DimCommand(TInt aCommandId,TBool aDimmed);
00374         TBool IsCommandDimmed(TInt aCommandId) const;
00375         void MakeCommandVisible(TInt aCommandId,TBool aVisible);
00376         TBool IsCommandVisible(TInt aCommandId) const;
00377         CCoeControl* AsControl();
00378         const CCoeControl* AsControl() const;
00379         CCoeControl* GroupControlById(TInt aCommandId) const;
00380         CEikCommandButton* GroupControlAsButton(TInt aCommandId) const;
00381         TInt CommandId(TInt aCommandPos) const;
00382         TInt ButtonCount() const;
00383         TUint ButtonGroupFlags() const;
00384 
00385     void SetMSKCommandObserver(MEikCommandObserver* aCommandObserver);
00386     void DimCommandByPosition(TInt aPosition,TBool aDimmed);
00387     TBool IsCommandDimmedByPosition(TInt aPosition) const;
00388     void MakeCommandVisibleByPosition(TInt aPosition,TBool aVisible);
00389     TBool IsCommandVisibleByPosition(TInt aPosition) const;
00390     void AnimateCommandByPosition(TInt aPosition);
00391 
00392 private: 
00393         IMPORT_C void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEvent);
00394         
00395 private:
00396         IMPORT_C void Reserved_2();
00397         
00398 private: 
00400     IMPORT_C void* ExtensionInterface( TUid aInterface );
00401 private:
00402         void BaseConstructL();
00403         TInt ControlCount() const;
00404 private:
00405         TInt                    iToolBarFlags;
00406         MEikCommandObserver*    iCommandObserver;
00407         CCoeBrushAndPenContext* iBrushAndPenContext;
00408         CArrayFix<TInt>*        iControlTypes; 
00409         };
00410 
00411 // __EIKTBAR_H__
00412 #endif

Copyright © Nokia Corporation 2001-2008
Back to top