1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/eikbtpan.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,134 @@
1.4 +/*
1.5 +* Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#if !defined(__EIKBTPAN_H__)
1.23 +#define __EIKBTPAN_H__
1.24 +
1.25 +#if !defined(__EIKBTGRP_H__)
1.26 +#include <eikbtgrp.h>
1.27 +#endif
1.28 +
1.29 +#include <AknControl.h>
1.30 +
1.31 +#if !defined(__COECOBS_H__)
1.32 +#include <coecobs.h>
1.33 +#endif
1.34 +
1.35 +#if !defined(__EIKLBBUT_H__)
1.36 +#include <eiklbbut.h>
1.37 +#endif
1.38 +
1.39 +#include <eikctgrp.h>
1.40 +
1.41 +class MEikCommandObserver;
1.42 +
1.43 +/**
1.44 + * @internal
1.45 + * Internal to Symbian
1.46 + */
1.47 +class CEikButtonPanel : public CAknControl, public MCoeControlObserver, public MEikButtonGroup
1.48 + {
1.49 +public: // new functions
1.50 + IMPORT_C CEikButtonPanel();
1.51 + IMPORT_C ~CEikButtonPanel();
1.52 + IMPORT_C void ConstructL();
1.53 + IMPORT_C void AddButtonL(CEikLabeledButton* aButton,TInt aId);
1.54 + IMPORT_C void AddButtonL(CEikLabeledButton* aButton,TInt aId, TInt aRow);
1.55 + IMPORT_C void SetHorizontal();
1.56 + IMPORT_C TInt ButtonId(CCoeControl* aControl) const;
1.57 + IMPORT_C CEikCommandButtonBase* ButtonById(TInt aButtonId) const;
1.58 + IMPORT_C CEikLabeledButton* LabeledButtonById(TInt aButtonId) const;
1.59 + IMPORT_C void MakeButtonVisible(TInt aButtonId,TBool aVisible);
1.60 + IMPORT_C CEikCommandButtonBase* ButtonForKey(TInt aChar,TInt& aButtonId) const;
1.61 + IMPORT_C void ResetMinimumSize();
1.62 + IMPORT_C void SetMinButtonWidth(TInt aWidth);
1.63 + IMPORT_C void SetCommandObserver(MEikCommandObserver* aCommandObserver);
1.64 + void UpdateHotKeyL(TInt aCommandId,CEikLabeledButton::TFlags aFlags,TInt aKeyCode);
1.65 +public: // from CCoeControl
1.66 + IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
1.67 + IMPORT_C TSize MinimumSize();
1.68 + IMPORT_C void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; // not available before Release 005u
1.69 + IMPORT_C void HandleResourceChange(TInt aType); // not available before Release 005u
1.70 + IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
1.71 + IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
1.72 +protected: // from CCoeControl
1.73 + IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
1.74 +public: // from MCoeControlObserver
1.75 + IMPORT_C void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
1.76 +private: // from MEikButtonGroup
1.77 + void SetCommandL(TInt aPosition,TInt aCommandId,const TDesC* aText,const CFbsBitmap* aBitmap,const CFbsBitmap* aMask);
1.78 + void SetCommandL(TInt aPosition,TInt aResourceId);
1.79 + void SetCommandSetL(TInt aResourceId);
1.80 + void AddCommandL(TInt aPosition,TInt aCommandId,const TDesC* aText,const CFbsBitmap* aBitmap,const CFbsBitmap* aMask);
1.81 + void AddCommandToStackL(TInt aPosition,TInt aCommandId,const TDesC* aText,const CFbsBitmap* aBitmap,const CFbsBitmap* aMask);
1.82 + void AddCommandToStackL(TInt aPosition,TInt aResourceId);
1.83 + void AddCommandSetToStackL(TInt aResourceId);
1.84 + void SetDefaultCommand(TInt aCommandId);
1.85 + TSize CalcMinimumSizeL(TInt aResourceId);
1.86 + void RemoveCommandFromStack(TInt aPosition,TInt aCommandId);
1.87 + TInt CommandPos(TInt aCommandId) const;
1.88 + void DimCommand(TInt aCommandId,TBool aDimmed);
1.89 + TBool IsCommandDimmed(TInt aCommandId) const;
1.90 + void MakeCommandVisible(TInt aCommandId,TBool aVisible);
1.91 + TBool IsCommandVisible(TInt aCommandId) const;
1.92 + CCoeControl* AsControl();
1.93 + const CCoeControl* AsControl() const;
1.94 + void SetBoundingRect(const TRect& aBoundingRect);
1.95 + void ReduceRect(TRect& aBoundingRect) const;
1.96 + CCoeControl* GroupControlById(TInt aCommandId) const;
1.97 + CEikCommandButton* GroupControlAsButton(TInt aCommandId) const;
1.98 + TInt CommandId(TInt aCommandPos) const;
1.99 + TInt ButtonCount() const;
1.100 + TUint ButtonGroupFlags() const;
1.101 +
1.102 + void SetMSKCommandObserver(MEikCommandObserver* aCommandObserver);
1.103 + void DimCommandByPosition(TInt aPosition,TBool aDimmed);
1.104 + TBool IsCommandDimmedByPosition(TInt aPosition) const;
1.105 + void MakeCommandVisibleByPosition(TInt aPosition,TBool aVisible);
1.106 + TBool IsCommandVisibleByPosition(TInt aPosition) const;
1.107 + void AnimateCommandByPosition(TInt aPosition);
1.108 +private: // from CCoeControl
1.109 + IMPORT_C void ActivateL();
1.110 + IMPORT_C TInt CountComponentControls() const;
1.111 + IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
1.112 + IMPORT_C void SizeChanged();
1.113 + IMPORT_C void Reserved_2();
1.114 +private:
1.115 + /**
1.116 + * From CAknControl
1.117 + */
1.118 + IMPORT_C void* ExtensionInterface( TUid aInterface );
1.119 +private: // new functions
1.120 + TInt RelativePosition(TInt aCommandPos, TInt& aGroupIndex) const;
1.121 + TBool ButtonsConsumedKeyL(TInt aCode);
1.122 + void AppendNewLineL();
1.123 + CEikLabeledButton* LabeledButtonByPosition(TInt aPosition, TInt& aGroupIndex) const;
1.124 + CEikLabeledButton* LabeledButtonByPosition(TInt aPosition) const;
1.125 + void AdjustMarginsToFit(TInt8& aLeftBorder, TInt8& aRightBorder, TInt& aGapBetweenButtons);
1.126 + void SetButtonWidths();
1.127 +private:
1.128 + CArrayPtrFlat<CEikControlGroup>* iControlGroups;
1.129 + TSize iMinSize;
1.130 + TInt iButWidth;
1.131 + TInt iMinButWidth;
1.132 + TInt iCount; // for efficiency
1.133 + MEikCommandObserver* iCommandObserver;
1.134 + TInt iSpare;
1.135 + };
1.136 +
1.137 +#endif