Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Base class for legacy Uikon buttons
19 #if !defined(__EIKBUTB_H__)
22 #if !defined(__EIKBCTRL_H__)
26 #if !defined(__UIKON_HRH__)
34 class TEikButtonCoordinator;
37 * Possible button behaviours
41 EEikButtonStaysClear=EEikButStaysClear,
42 EEikButtonStaysSet=EEikButStaysSet,
43 EEikButtonLatches=EEikButLatches,
44 EEikButtonReportsOnPointerDown=EEikButReportOnPointerDown
48 * Base class for button controls
50 * This class defines behavior available to all button classes.
55 class CEikButtonBase : public CEikBorderedControl
61 IMPORT_C CEikButtonBase();
66 IMPORT_C ~CEikButtonBase();
71 * States that the button can be in.
80 public: // new functions
84 * @return The state of the button
86 IMPORT_C TState State() const;
89 * Set the state of the button.
91 * @param aState The state the button is to be set to.
93 IMPORT_C void SetState(TState aState);
96 * Cause the button to animate. The appearance changes to the "pressed in" state. Subsequent
97 * behaviour depends upon the SetBehavior setting
99 IMPORT_C virtual void Animate();
102 * Sets the coordinator for the button.
104 * @param aButCoord The coordinator to set for these button
106 IMPORT_C void SetCoordinator(TEikButtonCoordinator* aButCoord);
109 * Sets the button’s behaviour. A button can be made to stay set or stay clear. It can also be made a latching button.
111 * @param aBehavior Behaviour to use
113 IMPORT_C void SetBehavior(TButtonBehavior aBehavior);
116 * Sets the control to ignore the next pointer up event
118 IMPORT_C void SetIgnoreNextPointerUp();
122 * The draw state of the button.
126 EDrawClear =SLafButtonBase::EDrawClear,
127 EDrawSet =SLafButtonBase::EDrawSet,
128 EDrawIndeterminate =SLafButtonBase::EDrawIndeterminate,
129 EDrawClearPressed =SLafButtonBase::EDrawClearPressed,
130 EDrawSetPressed =SLafButtonBase::EDrawSetPressed,
131 EDrawIndeterminatePressed =SLafButtonBase::EDrawIndeterminatePressed
134 protected: // new functions
136 * Set whether the control should report on pointer down
138 IMPORT_C void SetReportOnPointerDown();
141 * Access the draw state defined in SLafButtonBase
143 * @return The draw state of the control
145 IMPORT_C TDrawState DrawState() const;
148 * Returns whether the button is currently pressed.
150 * @return EFalse if the button is not pressed
152 IMPORT_C TBool IsPressed() const;
155 * Sets the button to be tri-state
157 IMPORT_C void SetAllowTristate();
160 * Transfers the draw state to the referenced button
162 * @param aTargetButton button to transfer the
164 IMPORT_C void CopyDrawStateTo(CEikButtonBase* aTargetButton) const;
166 public: // from CCoeControl
170 * Obtain the color use list for this control
172 * @param aColorUseList Output; upon non-leaving return, constains the color use list
174 IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const;
179 * Perform necessary operations when resource changes. This includes layout switches, or other events
180 * that affect appearance.
182 * @param aType Type of resouce changed
184 IMPORT_C virtual void HandleResourceChange(TInt aType); // not available before Release 005u
189 * Serialize the control's state. For testing
191 * @param aWriteStream Stream to write to.
193 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
195 private: // from CCoeControl
196 IMPORT_C void Reserved_2();
198 private: // new functions
200 * Called but button framework when the state of the control has changed
202 IMPORT_C virtual void StateChanged();
203 IMPORT_C virtual void Reserved_3();
209 * A pointer event is being routed to this control for handling
211 * @param aPointerEvent Wserv pointer event
213 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
218 * A key event is being being given to the control for handling
220 * @param aKeyEvent Key event code
221 * @param aType Type of event (i.e.. EEventKey, EEventKeyUp, EEventKeyDown)
222 * @return EKeyWasConsumed or EKeyWasNotConsumed
224 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
229 * Interface used by the FEP or others to determine what type of input the control requires.
231 * @return A value indicating what input is required.
233 IMPORT_C TCoeInputCapabilities InputCapabilities() const;
239 * Interface for extending virtual functionality of CAknControl
241 IMPORT_C void* ExtensionInterface( TUid aInterface );
243 private: // internal use only
244 TBool ClickCompleted();
247 enum { EIgnoreNextPointerUp=0x1000 };
251 * Flags for the button class hierarchy
257 * Button co-ordinator associated with this button
259 TEikButtonCoordinator* iButCoord;
265 * Button coordinator class
267 * This class performs simple coordination functions on a set of buttons. It ensures that only
268 * one button of those sharing a coordinator is set at once.
273 class TEikButtonCoordinator
279 IMPORT_C TEikButtonCoordinator();
282 * Set the current chosen button to the passed-in object.
283 * Any previously selected button is set to the Clear state and re-drawn.
285 * @param aChosenButton Button to set as the new chosen button.
287 IMPORT_C void SetChosenButton(CEikButtonBase* aChosenButton);
291 * Records the currently chosen button associated with this co-ordinator object.
293 CEikButtonBase* iChosenButton;
296 #endif // __EIKBUTB_H__