Link against: eikcoctl.lib
#include <AknButton.h>
Inherits CAknControl.
Inherited by CAknToolbarExtension.
Public Types |
|
enum | TAlignment { ECenter, ETop, EBottom, ERight, ELeft } |
enum | TTooltipPosition { EPositionTop = 1, EPositionBottom, EPositionLeft, EPositionRight } |
enum | TTextAndIconAlignment { EIconBeforeText, EIconAfterText, EIconUnderText, EIconOverText, EOverlay } |
enum | TButtonEvent { ELongPressEvent = 100, ELongPressEndedEvent } |
Public Member Functions |
|
virtual IMPORT_C | ~CAknButton () |
Destructor. |
|
IMPORT_C void | ActivateL () |
Sets control as ready to be drawn. |
|
IMPORT_C void | ConstructFromResourceL (TResourceReader &aReader) |
Constructs controls from a resource file. |
|
IMPORT_C void | HandleResourceChange (TInt aType) |
Handles a change to the control's resources. |
|
IMPORT_C TSize | MinimumSize () |
Returns the control's minimum required size. |
|
IMPORT_C void | SetDimmed (TBool aDimmed) |
Sets button dimmed. |
|
IMPORT_C TKeyResponse | OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType) |
Handles key events. |
|
IMPORT_C void | MakeVisible (TBool aVisible) |
Sets this control as visible or invisible. |
|
IMPORT_C void | PrepareForFocusLossL () |
This function is called by the dialog framework immediately before it removes keyboard focus from a control within a dialog.
|
|
IMPORT_C void | PrepareForFocusGainL () |
Prepares the control for gaining focus. |
|
IMPORT_C void | HandlePointerEventL (const TPointerEvent &aPointerEvent) |
Handles pointer events. |
|
virtual IMPORT_C void | PositionChanged () |
Responds to changes in the position of a control. |
|
IMPORT_C void | ConstructFromResourceL (const TInt aResourceId) |
Constructs controls from a resource file. |
|
virtual IMPORT_C void | SetCurrentState (const TInt aStateIndex, const TBool aDrawNow) |
Sets button state. |
|
virtual IMPORT_C void | AddStateL (CGulIcon *aIcon, CGulIcon *aDimmedIcon, CGulIcon *aPressedIcon, CGulIcon *aHoverIcon, const TDesC &aText, const TDesC &aHelpText, const TInt aStateFlags) |
Adds one more state for the button to the end of state array. |
|
virtual IMPORT_C void | AddStateL (const TDesC &aFilePath, const TInt aBmpId, const TInt aMaskId, const TInt aDimmedBmpId, const TInt aDimmedMaskId, const TInt aPressedBmpId, const TInt aPressedMaskId, const TInt aHoverBmpId, const TInt aHoverMaskId, const TDesC &aText, const TDesC &aHelpText, const TInt aStateFlags, const TAknsItemID &aId, const TAknsItemID &aDimmedId, const TAknsItemID &aPressedId, const TAknsItemID &aHoverId) |
Adds one more state for the button. |
|
void | AddStateL (CGulIcon *aIcon, CGulIcon *aDimmedIcon, CGulIcon *aPressedIcon, CGulIcon *aHoverIcon, const TDesC &aText, const TDesC &aHelpText, const TInt aStateFlags, const TInt aCommandId) |
Adds one more state for the button to the end of state array. |
|
IMPORT_C void | SetButtonFlags (const TInt aFlags) |
Sets the button flags. |
|
IMPORT_C void | SetFrameAndCenterIds (const TAknsItemID &aFrameId, const TAknsItemID &aCenterId, const TAknsItemID &aLatchedFrameId, const TAknsItemID &aLatchedCenterId, const TAknsItemID &aDimmedFrameId, const TAknsItemID &aDimmedCenterId, const TAknsItemID &aPressedFrameId, const TAknsItemID &aPressedCenterId, const TAknsItemID &aLatchedDimmedFrameId, const TAknsItemID &aLatchedDimmedCenterId) |
Sets specified frame IDs. |
|
IMPORT_C void | SetBackgroundIds (const TAknsItemID &aBackgroundId, const TAknsItemID &aLatchedBackgroundId, const TAknsItemID &aDimmedBackgroundId, const TAknsItemID &aPressedBackgroundId, const TAknsItemID &aLatchedDimmedBackgroundId) |
Sets specified background IDs. |
|
IMPORT_C void | SetTextFont (const CFont *aFont) |
Sets some specific text font. |
|
IMPORT_C void | SetTextColorIds (const TAknsItemID &aTextColorTableId, const TInt aTextColorIndex) |
Sets the color table and color index for the button text. |
|
IMPORT_C void | SetTextHorizontalAlignment (const CGraphicsContext::TTextAlign aHorizontalAlignment) |
Sets the horizontal alignment for the text inside the button. |
|
IMPORT_C void | SetTextVerticalAlignment (const CAknButton::TAlignment aVerticalAlignment) |
Sets the vertical alignment for the text inside the button. |
|
IMPORT_C void | SetTextAndIconAlignment (const CAknButton::TTextAndIconAlignment aAlignment) |
Sets the icon and text alignment for a button having both. |
|
IMPORT_C void | SetTextUnderlineStyle (TFontUnderline aUnderlineStyle) |
Sets the text underline style for the text inside the button. |
|
IMPORT_C void | SetIconScaleMode (const TScaleMode aScaleMode) |
Sets the scale mode for the icon inside the button. |
|
IMPORT_C void | SetIconHorizontalAlignment (const CAknButton::TAlignment aHorizontalAlignment) |
Sets the horizontal alignment for the icon inside the button. |
|
IMPORT_C void | SetIconVerticalAlignment (const CAknButton::TAlignment aVerticalAlignment) |
Sets the vertical alignment for the icon inside the button. |
|
IMPORT_C void | SetHelpNoteTimeouts (const TInt aBeforeTimeout, const TInt aInViewTimeout) |
Sets the delay before the help text is shown and also specifies the time for how long help text is visible. |
|
IMPORT_C void | SetKeyRepeatInterval (const TInt aKeyRepeatDelay, const TInt aKeyRepeatInterval) |
Sets the interval for key repeat. |
|
IMPORT_C void | SetLongPressInterval (const TInt aLongPressInterval) |
Sets the interval for long press. |
|
IMPORT_C TInt | StateIndex () const |
Returns the index of the button state. |
|
IMPORT_C void | EnablePictographsL (CAknPictographInterface &aInterface) |
Enables pictograph drawing in the button text. |
|
IMPORT_C void | DisablePictographs () |
Disables pictograph drawing in the button text. |
|
IMPORT_C void | SetHighlightRect (const TRect &aRect) |
It will change the default highlight rectangle around the focused button. |
|
IMPORT_C TRect | HighlightRect () const |
Gets the highlight rectangle around the button. |
|
IMPORT_C void | SetTooltipPosition (const TTooltipPosition aPosition) |
Sets the tooltip position. |
|
IMPORT_C void | SetRequestExit (const TBool aRequestExit) |
Sets whether button should send an EEventRequestExit event to command observer on button up event. |
|
IMPORT_C TBool | IsDimmed () const |
Tests if the control is dimmed. |
|
IMPORT_C void | SetDimmedHelpTextL (const TDesC &aHelpText) |
Sets the help text for dimmed button. |
|
TBool | HitAreaContainsL (const TPoint &aPoint, TBool aCheckHitArea) const |
Check if point is within buttons visible area, when KAknButtonHitTest flag is enabled. |
|
IMPORT_C CAknButtonState * | State () const |
Returns the current state of the button. |
|
IMPORT_C CAknButtonState * | State (const TInt aStateIndex) const |
Returns the state of the button under specified index. |
|
IMPORT_C TInt | ButtonFlags () const |
Returns the flags of button. |
|
IMPORT_C void | SetMargins (const TMargins8 &aMargins) |
Sets button's margins. |
|
IMPORT_C TInt | SetIconSize (const TSize &aSize) |
Sets icon size for the button. |
|
TBool | UsesDefaultMargins () const |
Checks if the button uses default margins. |
|
void | HideTooltipWhenAppFaded (TBool aHide) |
Sets tooltip to hide or show itself when background faded. |
|
void | CheckHitArea () |
IMPORT_C void | ResetState () |
Resets button to unpressed state. |
|
void | UseMaskedDraw (TBool aMaskedDraw) |
Sets button to use additional masks during drawing. |
|
void | RegisterResourceProvider (CAknResourceProvider *aProvider) |
Registers resource provider. |
|
void | UnregisterResourceProvider () |
Unregisters resource provider. |
|
CAknsFrameBackgroundControlContext * | BgContext () |
void | RemoveCurrentState () |
Removes the currently active state from the button, and sets the current state to the previous one. |
|
TRect | TouchArea () const |
Returns the button touchable area. |
|
Static Public Member Functions |
|
static IMPORT_C CAknButton * | NewL () |
Two-phased constructor. |
|
static IMPORT_C CAknButton * | NewLC () |
Two-phased constructor. |
|
static IMPORT_C CAknButton * | NewL (TResourceReader &aReader) |
Two-phased constructor. |
|
static IMPORT_C CAknButton * | NewLC (TResourceReader &aReader) |
Two-phased constructor. |
|
static IMPORT_C CAknButton * | NewL (const TInt aResourceId) |
Two-phased constructor. |
|
static IMPORT_C CAknButton * | NewLC (const TInt aResourceId) |
Two-phased constructor. |
|
static IMPORT_C CAknButton * | NewL (CGulIcon *aIcon, CGulIcon *aDimmedIcon, CGulIcon *aPressedIcon, CGulIcon *aHoverIcon, const TDesC &aText, const TDesC &aHelpText, const TInt aButtonFlags, const TInt aStateFlags) |
Two-phased constructor. |
|
static IMPORT_C CAknButton * | NewLC (CGulIcon *aIcon, CGulIcon *aDimmedIcon, CGulIcon *aPressedIcon, CGulIcon *aHoverIcon, const TDesC &aText, const TDesC &aHelpText, const TInt aFlags, const TInt aStateFlags) |
Two-phased constructor. |
|
static IMPORT_C CAknButton * | NewL (const TDesC &aFilePath, const TInt aBmpId, const TInt aMaskId, const TInt aDimmedBmpId, const TInt aDimmedMaskId, const TInt aPressedBmpId, const TInt aPressedMaskId, const TInt aHoverBmpId, const TInt aHoverMaskId, const TDesC &aText, const TDesC &aHelpText, const TInt aButtonFlags, const TInt aStateFlags, const TAknsItemID &aId=KAknsIIDNone, const TAknsItemID &aDimmedId=KAknsIIDNone, const TAknsItemID &aPressedId=KAknsIIDNone, const TAknsItemID &aHoverId=KAknsIIDNone) |
Two-phased constructor. |
|
static IMPORT_C CAknButton * | NewLC (const TDesC &aFilePath, const TInt aBmpId, const TInt aMaskId, const TInt aDimmedBmpId, const TInt aDimmedMaskId, const TInt aPressedBmpId, const TInt aPressedMaskId, const TInt aHoverBmpId, const TInt aHoverMaskId, const TDesC &aText, const TDesC &aHelpText, const TInt aButtonFlags, const TInt aStateFlags, const TAknsItemID &aId=KAknsIIDNone, const TAknsItemID &aDimmedId=KAknsIIDNone, const TAknsItemID &aPressedId=KAknsIIDNone, const TAknsItemID &aHoverId=KAknsIIDNone) |
Two-phased constructor. |
|
Protected Member Functions |
|
IMPORT_C | CAknButton (const TInt aFlags) |
C++ constructor for the one state button. |
|
IMPORT_C void | ConstructL () |
Symbian 2nd phase constructor. |
|
IMPORT_C void | ConstructL (CGulIcon *aIcon, CGulIcon *aDimmedIcon, CGulIcon *aPressedIcon, CGulIcon *aHoverIcon, const TDesC &aText, const TDesC &aHelpText, const TInt aStateFlags) |
Symbian 2nd phase constructor. |
|
IMPORT_C void | ConstructL (const TDesC &aFilePath, const TInt aBmpId, const TInt aMaskId, const TInt aDimmedBmpId, const TInt aDimmedMaskId, const TInt aPressedBmpId, const TInt aPressedMaskId, const TInt aHoverBmpId, const TInt aHoverMaskId, const TDesC &aText, const TDesC &aHelpText, const TInt aStateFlags, const TAknsItemID &aId=KAknsIIDNone, const TAknsItemID &aDimmedId=KAknsIIDNone, const TAknsItemID &aPressedId=KAknsIIDNone, const TAknsItemID &aHoverId=KAknsIIDNone) |
Symbian 2nd phase constructor. |
|
IMPORT_C void | SizeChanged () |
Responds to size changes to sets the size and position of the contents of this control. |
|
IMPORT_C void | FocusChanged (TDrawNow aDrawNow) |
This function is called whenever a control gains or loses focus. |
|
IMPORT_C void * | ExtensionInterface (TUid aInterface) |
For future extensions. |
|
IMPORT_C TInt | ChangeState (TBool aDrawNow) |
Changes the state of the button to the next one. |
|
IMPORT_C const TDesC & | GetCurrentText () const |
Returns the text, which will be displayed inside the button for the current state. |
|
IMPORT_C const CGulIcon * | GetCurrentIcon () const |
Returns icon for the current state. |
|
IMPORT_C void | ShowHelpL () |
Shows help text for a certain period of time. |
|
IMPORT_C void | HideHelp () |
Hides help text after certain interval. |
|
Protected Attributes |
|
CArrayPtrFlat< CAknButtonState > * | iStates |
TInt | iFlags |
TInt | iStateIndex |
TBool | iButtonPressed |
TInt | iNumberOfDragEvents |
TBool | iKeyDownReported |
CAknsFrameBackgroundControlContext * | iBgContext |
TRect | iHighlightRect |
const CFont * | iFont |
TAlignment | iVerticalAlignment |
CGraphicsContext::TTextAlign | iHorizontalAlignment |
TAknsItemID | iTextColorTableId |
TInt | iTextColorIndex |
TScaleMode | iScaleMode |
TInt | iHelpNoteWaitInterval |
TInt | iHelpNoteInViewInterval |
CAknInfoPopupNoteController * | iHelpNote |
HBufC * | iDimmedHelpText |
TBool | iShowHelp |
CPeriodic * | iKeyRepeatTimer |
TInt | iKeyRepeatDelay |
TInt | iKeyRepeatInterval |
|
|
|
|
|
Destructor. |
|
C++ constructor for the one state button.
|
|
Sets control as ready to be drawn. |
|
Adds one more state for the button to the end of state array.
|
|
Adds one more state for the button.
|
|
Adds one more state for the button to the end of state array.
|
|
|
Returns the flags of button. The flags are defined in eikon.hrh.
|
|
Changes the state of the button to the next one.
|
|
|
Constructs controls from a resource file.
|
|
Constructs controls from a resource file.
Reimplemented in CAknToolbarExtension. |
|
Symbian 2nd phase constructor.
|
|
Symbian 2nd phase constructor.
|
|
Symbian 2nd phase constructor. |
|
Disables pictograph drawing in the button text. Only effective in Japanese variant. By default, it is disabled. |
|
Enables pictograph drawing in the button text. Only effective in Japanese variant. By default, it is disabled.
|
|
For future extensions.
Reimplemented from CAknControl. |
|
This function is called whenever a control gains or loses focus.
|
|
Returns icon for the current state. |
|
Returns the text, which will be displayed inside the button for the current state. |
|
Handles pointer events.
|
|
Handles a change to the control's resources.
Reimplemented in CAknToolbarExtension. |
|
Hides help text after certain interval. |
|
Sets tooltip to hide or show itself when background faded.
|
|
Gets the highlight rectangle around the button.
|
|
Check if point is within buttons visible area, when KAknButtonHitTest flag is enabled.
|
|
Tests if the control is dimmed. This function overrides the function declared in CCoeControl, and returns the value which is set and unset using CAknButton::SetDimmed().
|
|
Sets this control as visible or invisible.
Reimplemented in CAknToolbarExtension. |
|
Returns the control's minimum required size. It does not include the size of the highlight. However, it includes current margins. Use HighlightRect() function to get highlight rectangle for the focused button.
|
|
Two-phased constructor. Constructs one state button.
|
|
Two-phased constructor. Constructs one state button.
|
|
Two-phased constructor. Constructs the button from resources.
Reimplemented in CAknToolbarExtension. |
|
Two-phased constructor. Constructs the button from resources.
|
|
Two-phased constructor. Constructs an empty button. Reimplemented in CAknToolbarExtension. |
|
Two-phased constructor. Constructs one state button.
|
|
Two-phased constructor. Constructs one state button.
|
|
Two-phased constructor. Constructs the button from resources.
Reimplemented in CAknToolbarExtension. |
|
Two-phased constructor. Constructs the button from resources.
|
|
Two-phased constructor. Constructs an empty button. |
|
Handles key events.
Reimplemented in CAknToolbarExtension. |
|
Responds to changes in the position of a control. |
|
Prepares the control for gaining focus. Must be used before calling SetFocus() function in case when help note should be shown. |
|
This function is called by the dialog framework immediately before it removes keyboard focus from a control within a dialog. Currently has empty implementation. |
|
Registers resource provider.
|
|
Removes the currently active state from the button, and sets the current state to the previous one. |
|
Resets button to unpressed state.
|
|
Sets specified background IDs. Can be used when default frame is not suitable and the backgound is composed of only single image instead of frame and center. SetFrameAndCenterIds() function can also be used for this purpose by giving the same backround ID for both frame and center. This allows also some of the states to be composed of frames and the others from single backgound images. Use KAknsIIDNone value in case when some backgound drawing is not needed or KAknsIIDDefault when the default button frame should be used.
|
|
Sets the button flags.
|
|
Sets button state.
|
|
Sets button dimmed. Does not redraw the button. Note: This function does not affect the flag set with function CCoeControl::SetDimmed(), since button needs to get pointer events, even if it is dimmed. The value of the flag can be enquired using CAknButotn::IsDimmed().
|
|
Sets the help text for dimmed button.
|
|
Sets specified frame IDs. Can be used when default frame is not suitable. Use KAknsIIDNone value in case when some frame or center drawing is not needed or KAknsIIDDefault when the default button frame should be used.
|
|
Sets the delay before the help text is shown and also specifies the time for how long help text is visible.
|
|
It will change the default highlight rectangle around the focused button.
|
|
Sets the horizontal alignment for the icon inside the button. By default it will be centered.
|
|
Sets the scale mode for the icon inside the button. The default is EAspectRatioNotPreserved.
|
|
Sets icon size for the button. Calling this function overrides the default size that is scaled automatically depending on the current screen layout. If this function is called then the caller is responsible for updating icon size whenever the layout changes.
|
|
Sets the vertical alignment for the icon inside the button. By default it will be centered.
|
|
Sets the interval for key repeat.
|
|
Sets the interval for long press. When KAknButtonReportOnLongPress flag is set for the button, button will notify observer with KAknButtonLongPressEvent as the event type, after button has been pressed for the specified time.
|
|
Sets button's margins. These define the free area inside the button where content is placed. Note that calling this function overrides default margins that are scaled automatically depending on the current screen layout. If this function is called then the caller is responsible for updating margins whenever the layout changes.
|
|
Sets whether button should send an EEventRequestExit event to command observer on button up event.
|
|
Sets the icon and text alignment for a button having both.
|
|
Sets the color table and color index for the button text. It will be used on button drawing, if color of the text shouldn't be taken from text layout.
|
|
Sets some specific text font.
|
|
Sets the horizontal alignment for the text inside the button. It will be used, if alignment shouldn't be taken from text layout. By default it will be centered.
|
|
Sets the text underline style for the text inside the button. By default no underline is used.
|
|
Sets the vertical alignment for the text inside the button. It will be used if alignment shouldn't be taken from text layout. By default it will be centered.
|
|
Sets the tooltip position.
|
|
Shows help text for a certain period of time. |
|
Responds to size changes to sets the size and position of the contents of this control. |
|
Returns the state of the button under specified index.
|
|
Returns the current state of the button.
|
|
Returns the index of the button state. |
|
Returns the button touchable area.
|
|
Unregisters resource provider. |
|
Sets button to use additional masks during drawing. Calling this method forces button to bypass the normal drawing routine i.e. method DrawMaskedL is executed instead of Draw.
|
|
Checks if the button uses default margins.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|