class CAknButton : public CAknControl |
Generic button class.
Protected Member Functions | |
---|---|
CAknButton(const TInt) | |
IMPORT_C TInt | ChangeState(TBool) |
IMPORT_C void | ConstructL() |
IMPORT_C void | ConstructL(CGulIcon *, CGulIcon *, CGulIcon *, CGulIcon *, const TDesC &, const TDesC &, const TInt) |
IMPORT_C void | ConstructL(const TDesC &, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TInt, const TDesC &, const TDesC &, const TInt, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &, const TAknsItemID &) |
IMPORT_C void * | ExtensionInterface(TUid) |
IMPORT_C void | FocusChanged(TDrawNow) |
IMPORT_C const CGulIcon * | GetCurrentIcon() |
IMPORT_C const TDesC & | GetCurrentText() |
IMPORT_C void | HideHelp() |
IMPORT_C void | ShowHelpL() |
IMPORT_C void | SizeChanged() |
Private Member Functions | |
---|---|
void | CalculateDefaultMargins() |
TInt | CalculateLuminance(const TRgb &) |
TRect | ContentRect() |
void | ConvertColorsForOutlineEffect(TRgb &, TRgb &) |
void | ConvertTextToVisualAndClip() |
void | CreatePressedDownFrameL() |
IMPORT_C void | Draw(const TRect &) |
void | DrawIconButton(CWindowGc &) |
void | DrawText(CWindowGc &, TRect &) |
void | DrawTextAndIconButton(CWindowGc &) |
void | DrawTextButton(CWindowGc &) |
CAknButtonExtension * | Extension() |
void | GetTextColors(TRgb &, TRgb &) |
TBool | NeedsRedrawWhenPressed() |
TInt | ReportKeyRepeatL(TAny *) |
TBool | RequestExit() |
TInt | ScaleIcons() |
void | SetFrameIDs() |
void | SetFrameRects() |
void | SetStateIndexL(TInt) |
TAknsItemID | SkinIID(const TInt) |
void | StartKeyRepeatTimerL() |
void | StartLongPressTimerL() |
void | StopKeyRepeatTimer() |
void | StopLongPressTimer() |
TRgb | TextColor() |
void | UpdateTooltipPosition() |
Public Member Enumerations | |
---|---|
enum | TAlignment { ECenter, ETop, EBottom, ERight, ELeft } |
enum | TButtonEvent { ELongPressEvent = 100, ELongPressEndedEvent } |
enum | TTextAndIconAlignment { EIconBeforeText, EIconAfterText, EIconUnderText, EIconOverText, EOverlay } |
enum | TTooltipPosition { EPositionTop = 1, EPositionBottom, EPositionLeft, EPositionRight } |
Inherited Enumerations | |
---|---|
CCoeControl:TZoomType |
Private Attributes | |
---|---|
CAknButtonExtension * | iExtension |
Inherited Attributes | |
---|---|
CCoeControl::iCoeEnv | |
CCoeControl::iContext | |
CCoeControl::iPosition | |
CCoeControl::iSize |
IMPORT_C | CAknButton | ( | const TInt | aFlags | ) | [protected] |
C++ constructor for the one state button.
const TInt aFlags | The flags for the button |
IMPORT_C void | AddStateL | ( | CGulIcon * | aIcon, |
CGulIcon * | aDimmedIcon, | |||
CGulIcon * | aPressedIcon, | |||
CGulIcon * | aHoverIcon, | |||
const TDesC & | aText, | |||
const TDesC & | aHelpText, | |||
const TInt | aStateFlags | |||
) | [virtual] |
Adds one more state for the button to the end of state array.
CGulIcon * aIcon | The icon object containing a bitmap and a mask (if there is one) for the button. |
CGulIcon * aDimmedIcon | The icon object containing a bitmap and a mask (if there is one) for the dimmed case. |
CGulIcon * aPressedIcon | The icon object containing a bitmap and a mask (if there is one) for the case when button is pressed. |
CGulIcon * aHoverIcon | The icon object containingg a bitmap and a mask for the case when the pointer is hovering over the button. |
const TDesC & aText | is the text. |
const TDesC & aHelpText | is the text for the tooltip. |
const TInt aStateFlags | The flags for the state. |
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 | |||
) | [virtual] |
Adds one more state for the button.
const TDesC & aFilePath | The path to the file which contains icons. |
const TInt aBmpId | The bitmap ID for the normal state icon. |
const TInt aMaskId | The mask ID for the normal state icon. |
const TInt aDimmedBmpId | The bitmap ID for the dimmed state icon. |
const TInt aDimmedMaskId | The mask ID for the dimmed state icon. |
const TInt aPressedBmpId | The bitmap ID for the pressed down state. |
const TInt aPressedMaskId | The mask ID for the pressed down state. |
const TInt aHoverBmpId | The bitmap ID for the hover state. |
const TInt aHoverMaskId | The mask ID for the hover state. |
const TDesC & aText | is the text. |
const TDesC & aHelpText | is the text for the tooltip. |
const TInt aStateFlags | The flags for the state. |
const TAknsItemID & aId | Item ID of the masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed. |
const TAknsItemID & aDimmedId | Item ID of the dimmed masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed. |
const TAknsItemID & aPressedId | Item ID of the pressed masked bitmap to be created for skin specific icon. Use KAknsIIDNone when it is not needed. |
const TAknsItemID & aHoverId | Item ID of the hover state masked bitmap to be created for skin specific icon. |
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.
CGulIcon * aIcon | The icon object containing a bitmap and a mask (if there is one) for the button. |
CGulIcon * aDimmedIcon | The icon object containing a bitmap and a mask (if there is one) for the dimmed case. |
CGulIcon * aPressedIcon | The icon object containing a bitmap and a mask (if there is one) for the case when button is pressed. |
CGulIcon * aHoverIcon | The icon object containingg a bitmap and a mask for the case when the pointer is hovering over the button. |
const TDesC & aText | is the text. |
const TDesC & aHelpText | is the text for the tooltip. |
const TInt aStateFlags | The flags for the state. |
const TInt aCommandId | Command to be attached with the state. |
IMPORT_C TInt | ButtonFlags | ( | ) | const |
TInt | CalculateLuminance | ( | const TRgb & | aColor | ) | const [private] |
Calculates color's luminance.
const TRgb & aColor |
IMPORT_C TInt | ChangeState | ( | TBool | aDrawNow | ) | [protected] |
Changes the state of the button to the next one.
TBool aDrawNow |
IMPORT_C void | ConstructFromResourceL | ( | TResourceReader & | aReader | ) | [virtual] |
Constructs controls from a resource file.
TResourceReader & aReader | The resource reader, with which to access the control's resource values. |
IMPORT_C void | ConstructFromResourceL | ( | const TInt | aResourceId | ) |
Constructs controls from a resource file.
const TInt aResourceId | The ID for this component's resource. |
IMPORT_C void | ConstructL | ( | CGulIcon * | aIcon, |
CGulIcon * | aDimmedIcon, | |||
CGulIcon * | aPressedIcon, | |||
CGulIcon * | aHoverIcon, | |||
const TDesC & | aText, | |||
const TDesC & | aHelpText, | |||
const TInt | aStateFlags | |||
) | [protected] |
Symbian 2nd phase constructor.
CGulIcon * aIcon | The icon for the normal state. Takes ownership. |
CGulIcon * aDimmedIcon | The icon for the dimmed state. Takes ownership. |
CGulIcon * aPressedIcon | The icon for the pressed down. Takes ownership. |
CGulIcon * aHoverIcon | The icon for the hover state. |
const TDesC & aText | The text inside the button. |
const TDesC & aHelpText | The text for the tooltip. |
const TInt aStateFlags | The flags for the first state. |
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 | |||
) | [protected] |
Symbian 2nd phase constructor.
const TDesC & aFilePath | The path to the file which contains icons. |
const TInt aBmpId | The bitmap ID for the normal state icon. |
const TInt aMaskId | The mask ID for the normal state icon. |
const TInt aDimmedBmpId | The bitmap ID for the dimmed state icon. |
const TInt aDimmedMaskId | The mask ID for the dimmed state icon. |
const TInt aPressedBmpId | The bitmap ID for the pressed down state. |
const TInt aPressedMaskId | The mask ID for the pressed down state. |
const TInt aHoverBmpId | The bitmap ID for the hover state icon. |
const TInt aHoverMaskId | The mask ID for the hover state icon. |
const TDesC & aText | The text inside the button. |
const TDesC & aHelpText | The text for the tooltip. |
const TInt aStateFlags | The flags for the first state. |
const TAknsItemID & aId = KAknsIIDNone | Item ID of the masked bitmap to be created for skin specific icon. |
const TAknsItemID & aDimmedId = KAknsIIDNone | Item ID of the dimmed masked bitmap to be created for skin specific icon. |
const TAknsItemID & aPressedId = KAknsIIDNone | Item ID of the pressed masked bitmap to be created for skin specific icon. |
const TAknsItemID & aHoverId = KAknsIIDNone | Item ID of the masked hover bitmap to be created for skin specific icon. |
TRect | ContentRect | ( | ) | const [private] |
Gets the rectangele reserved for button content excluding frame.
void | ConvertColorsForOutlineEffect | ( | TRgb & | aFillColor, |
TRgb & | aOutlineColor | |||
) | const [private] |
Converts outline color, if fill color is too similar to outline color
fill color outline color
void | ConvertTextToVisualAndClip | ( | ) | const [private] |
Converts text to visual and clips it. This is called when there are possible changes in visual text.
void | CreatePressedDownFrameL | ( | ) | [private] |
Generates the pressed down bitmaps if flag KAknButtonPressedDownFrame is set and button has no frame
IMPORT_C void | DisablePictographs | ( | ) |
Disables pictograph drawing in the button text. Only effective in Japanese variant. By default, it is disabled.
IMPORT_C void | Draw | ( | const TRect & | aRect | ) | const [private, virtual] |
From CCoeControl. Draws the control. Called by window server.
const TRect & aRect |
void | DrawIconButton | ( | CWindowGc & | aGc | ) | const [private] |
Continues drawing of the button which has only an icon in it.
CWindowGc & aGc |
void | DrawText | ( | CWindowGc & | aGc, |
TRect & | aTextRect | |||
) | const [private] |
Continues drawing of the button which has text. Called from DrawTextButton and DrawTextAndIconButton
void | DrawTextAndIconButton | ( | CWindowGc & | aGc | ) | const [private] |
Continues drawing of the button which has both text and icon.
CWindowGc & aGc |
void | DrawTextButton | ( | CWindowGc & | aGc | ) | const [private] |
Continues drawing of the button which has only text.
CWindowGc & aGc |
IMPORT_C void | EnableFeedback | ( | TBool | aEnable | ) |
Enables or disables tactile feedback for button. By default it is enabled. Should be used to temporarily prevent updating of tactile feedback area for performance reasons when button is moved constantly.
TBool aEnable |
IMPORT_C void | EnablePictographsL | ( | CAknPictographInterface & | aInterface | ) |
Enables pictograph drawing in the button text. Only effective in Japanese variant. By default, it is disabled.
CAknPictographInterface & aInterface | Used pictograph interface owned by the caller. |
CAknButtonExtension * | Extension | ( | ) | const [private] |
Asserts that extension class object exists.
IMPORT_C void * | ExtensionInterface | ( | TUid | aInterface | ) | [protected, virtual] |
For future extensions
TUid aInterface | The ID for the extension interface. |
IMPORT_C void | FocusChanged | ( | TDrawNow | aDrawNow | ) | [protected, virtual] |
This function is called whenever a control gains or loses focus.
TDrawNow aDrawNow | Contains the value that was passed to it by SetFocus(). |
IMPORT_C const CGulIcon * | GetCurrentIcon | ( | ) | const [protected] |
Returns icon for the current state.
IMPORT_C const TDesC & | GetCurrentText | ( | ) | const [protected] |
Returns the text, which will be displayed inside the button for the current state.
void | GetTextColors | ( | TRgb & | aPenColor, |
TRgb & | aBrushColor | |||
) | const [private] |
Gets text colors
pen color brush color
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
Handles pointer events.
const TPointerEvent & aPointerEvent | The pointer event. |
IMPORT_C void | HandleResourceChange | ( | TInt | aType | ) | [virtual] |
Handles a change to the control's resources.
TInt aType | is a message UID value. |
void | HideTooltipWhenAppFaded | ( | TBool | aHide | ) |
Sets tooltip to hide or show itself when background faded.
TBool aHide | should be ETrue if hiding, EFalse if showing |
TBool | HitAreaContainsL | ( | const TPoint & | aPoint, |
TBool | aCheckHitArea | |||
) | const |
Check if point is within buttons visible area, when KAknButtonHitTest flag is enabled
IMPORT_C TBool | IsDimmed | ( | ) | const |
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().
IMPORT_C void | MakeVisible | ( | TBool | aVisible | ) | [virtual] |
Sets this control as visible or invisible.
TBool aVisible | ETrue to make the control visible, EFalse to make it invisible. |
IMPORT_C TSize | MinimumSize | ( | ) | [virtual] |
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.
TBool | NeedsRedrawWhenPressed | ( | ) | const [private] |
Checks whether button needs redrawing when it is pressed or released.
IMPORT_C CAknButton * | NewL | ( | TResourceReader & | aReader | ) | [static] |
Two-phased constructor. Constructs the button from resources.
TResourceReader & aReader | is the resource reader with which to access the control's resource values. |
IMPORT_C CAknButton * | NewL | ( | const TInt | aResourceId | ) | [static] |
Two-phased constructor. Constructs the button from resources.
const TInt aResourceId | is the ID for this component's resource. |
IMPORT_C CAknButton * | NewL | ( | CGulIcon * | aIcon, |
CGulIcon * | aDimmedIcon, | |||
CGulIcon * | aPressedIcon, | |||
CGulIcon * | aHoverIcon, | |||
const TDesC & | aText, | |||
const TDesC & | aHelpText, | |||
const TInt | aButtonFlags, | |||
const TInt | aStateFlags | |||
) | [static] |
Two-phased constructor. Constructs one state button.
CGulIcon * aIcon | The icon for the normal state. Takes ownership. |
CGulIcon * aDimmedIcon | The icon for the dimmed state. Takes ownership. |
CGulIcon * aPressedIcon | The icon for the pressed down. Takes ownership. |
CGulIcon * aHoverIcon | The icon for the hover state. Takes ownership. |
const TDesC & aText | The text inside the button. |
const TDesC & aHelpText | The text for the tooltip. |
const TInt aButtonFlags | The flags for the button. |
const TInt aStateFlags | The flags for the first state. |
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 | |||
) | [static] |
Two-phased constructor. Constructs one state button.
const TDesC & aFilePath | The path to the file which contains icons. |
const TInt aBmpId | The bitmap ID for the normal state icon. |
const TInt aMaskId | The mask ID for the normal state icon. |
const TInt aDimmedBmpId | The bitmap ID for the dimmed state icon. |
const TInt aDimmedMaskId | The mask ID for the dimmed state icon. |
const TInt aPressedBmpId | The bitmap ID for the pressed down state. |
const TInt aPressedMaskId | The mask ID for the pressed down state. |
const TInt aHoverBmpId | The bitmap ID for the hover state. |
const TInt aHoverMaskId | The mask ID for the hover state. |
const TDesC & aText | The text inside the button. |
const TDesC & aHelpText | The text for the tooltip. |
const TInt aButtonFlags | The flags for the button. |
const TInt aStateFlags | The flags for the first state. |
const TAknsItemID & aId = KAknsIIDNone | Item ID of the masked bitmap to be created for skin specific icon. |
const TAknsItemID & aDimmedId = KAknsIIDNone | Item ID of the dimmed masked bitmap to be created for skin specific icon. |
const TAknsItemID & aPressedId = KAknsIIDNone | Item ID of the pressed masked bitmap to be created for skin specific icon. |
const TAknsItemID & aHoverId = KAknsIIDNone | Item ID of the masked hover bitmap to be created for skin specific icon. |
IMPORT_C CAknButton * | NewLC | ( | TResourceReader & | aReader | ) | [static] |
Two-phased constructor. Constructs the button from resources.
TResourceReader & aReader | is the resource reader with which to access the control's resource values. |
IMPORT_C CAknButton * | NewLC | ( | const TInt | aResourceId | ) | [static] |
Two-phased constructor. Constructs the button from resources.
const TInt aResourceId | is the ID for this component's resource. |
IMPORT_C CAknButton * | NewLC | ( | CGulIcon * | aIcon, |
CGulIcon * | aDimmedIcon, | |||
CGulIcon * | aPressedIcon, | |||
CGulIcon * | aHoverIcon, | |||
const TDesC & | aText, | |||
const TDesC & | aHelpText, | |||
const TInt | aFlags, | |||
const TInt | aStateFlags | |||
) | [static] |
Two-phased constructor. Constructs one state button.
CGulIcon * aIcon | The icon for the normal state. Takes ownership. |
CGulIcon * aDimmedIcon | The icon for the dimmed state. Takes ownership. |
CGulIcon * aPressedIcon | The icon for the pressed down. Takes ownership. |
CGulIcon * aHoverIcon | The icon for the hover state. Takes ownership. |
const TDesC & aText | The text inside the button. |
const TDesC & aHelpText | The text for the tooltip. |
const TInt aFlags | |
const TInt aStateFlags | The flags for the first state. |
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 | |||
) | [static] |
Two-phased constructor. Constructs one state button.
const TDesC & aFilePath | The path to the file which contains icons. |
const TInt aBmpId | The bitmap ID for the normal state icon. |
const TInt aMaskId | The mask ID for the normal state icon. |
const TInt aDimmedBmpId | The bitmap ID for the dimmed state icon. |
const TInt aDimmedMaskId | The mask ID for the dimmed state icon. |
const TInt aPressedBmpId | The bitmap ID for the pressed down state. |
const TInt aPressedMaskId | The mask ID for the pressed down state. |
const TInt aHoverBmpId | The bitmap ID for the hover state. |
const TInt aHoverMaskId | The mask ID for the hover state. |
const TDesC & aText | The text inside the button. |
const TDesC & aHelpText | The text for the tooltip. |
const TInt aButtonFlags | The flags for the button. |
const TInt aStateFlags | The flags for the first state. |
const TAknsItemID & aId = KAknsIIDNone | Item ID of the masked bitmap to be created for skin specific icon. |
const TAknsItemID & aDimmedId = KAknsIIDNone | Item ID of the dimmed masked bitmap to be created for skin specific icon. |
const TAknsItemID & aPressedId = KAknsIIDNone | Item ID of the pressed masked bitmap to be created for skin specific icon. |
const TAknsItemID & aHoverId = KAknsIIDNone | Item ID of the hover state masked bitmap to be created for skin specific icon. |
IMPORT_C TKeyResponse | OfferKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
Handles key events.
const TKeyEvent & aKeyEvent | The key event. |
TEventCode aType | The type of key event: EEventKey, EEventKeyUp or EEventKeyDown. |
IMPORT_C void | PositionChanged | ( | ) | [virtual] |
Responds to changes in the position of a control.
IMPORT_C void | PrepareForFocusGainL | ( | ) | [virtual] |
Prepares the control for gaining focus. Must be used before calling SetFocus() function in case when help note should be shown.
IMPORT_C void | PrepareForFocusLossL | ( | ) | [virtual] |
This function is called by the dialog framework immediately before it removes keyboard focus from a control within a dialog. Currently has empty implementation.
void | RegisterResourceProvider | ( | CAknResourceProvider * | aProvider | ) |
Registers resource provider.
CAknResourceProvider * aProvider | New resource provider. |
void | RemoveCurrentState | ( | ) |
Removes the currently active state from the button, and sets the current state to the previous one.
TInt | ReportKeyRepeatL | ( | TAny * | aThis | ) | [private, static] |
Called after timeout is over.
TAny * aThis |
TBool | RequestExit | ( | ) | const [private] |
Checks whether toolbar should send an EEventRequestExit event to command observe on button up event.
IMPORT_C void | SetBackgroundIds | ( | const TAknsItemID & | aBackgroundId, |
const TAknsItemID & | aLatchedBackgroundId, | |||
const TAknsItemID & | aDimmedBackgroundId, | |||
const TAknsItemID & | aPressedBackgroundId, | |||
const TAknsItemID & | aLatchedDimmedBackgroundId | |||
) |
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.
const TAknsItemID & aBackgroundId | The item ID of the entire frame. |
const TAknsItemID & aLatchedBackgroundId | The item ID of the background for the button in latched state. |
const TAknsItemID & aDimmedBackgroundId | The item ID of the background for the button in dimmed state. |
const TAknsItemID & aPressedBackgroundId | The item ID of the background for the button in pressed state. |
const TAknsItemID & aLatchedDimmedBackgroundId | The item ID of the background for the button in latched and dimmed state. |
IMPORT_C void | SetButtonFlags | ( | const TInt | aFlags | ) |
Sets the button flags.
const TInt aFlags | which can be combination of: KAknButtonTextLeft, KAknButtonSizeFitText, KAknButtonNoFrame, KAknButtonKeyRepeat, KAknButtonReportOnKeyDown, KAknButtonNoFramePressEvent, KAknButtonRequestExitOnButtonUpEvent, KAknButtonReportOnLongPress. |
IMPORT_C void | SetCurrentState | ( | const TInt | aStateIndex, |
const TBool | aDrawNow | |||
) | [virtual] |
Sets button state.
IMPORT_C void | SetDimmed | ( | TBool | aDimmed | ) | [virtual] |
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().
TBool aDimmed | is ETrue to dim the button, EFalse to set the button as not dimmed. |
IMPORT_C void | SetDimmedHelpTextL | ( | const TDesC & | aHelpText | ) |
Sets the help text for dimmed button.
const TDesC & aHelpText | The text inside the tooltip. |
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. 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.
const TAknsItemID & aFrameId | The item ID of the entire frame. |
const TAknsItemID & aCenterId | The item ID of the center part of the frame. |
const TAknsItemID & aLatchedFrameId | The item ID of the entire frame for button in latched state. |
const TAknsItemID & aLatchedCenterId | The item ID of the center part of the frame for button in latched state. |
const TAknsItemID & aDimmedFrameId | The item ID of the entire frame for a button in dimmed state. |
const TAknsItemID & aDimmedCenterId | The item ID of the center part of the frame for a button in dimmed state. |
const TAknsItemID & aPressedFrameId | The item ID of the entire frame for a button in pressed state. |
const TAknsItemID & aPressedCenterId | is the item ID of the center part of the frame for a button in pressed state. |
const TAknsItemID & aLatchedDimmedFrameId | The item ID of the entire frame for a button in latched and dimmed state. |
const TAknsItemID & aLatchedDimmedCenterId | The item ID of the center part of the frame for a button in latched and dimmed state. |
void | SetFrameIDs | ( | ) | const [private] |
Sets frame IDs for background context. This is called when there are possible changes in frame ids.
void | SetFrameRects | ( | ) | [private] |
Sets frame rects for background context. This is called when button's size changes
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 | SetHighlightRect | ( | const TRect & | aRect | ) |
It will change the default highlight rectangle around the focused button.
const TRect & aRect | The highlight rectangle. |
IMPORT_C void | SetIconHorizontalAlignment | ( | const CAknButton::TAlignment | aHorizontalAlignment | ) |
Sets the horizontal alignment for the icon inside the button. By default it will be centered.
const CAknButton::TAlignment aHorizontalAlignment | The horizontal alignment for the icon. |
IMPORT_C void | SetIconScaleMode | ( | const TScaleMode | aScaleMode | ) |
Sets the scale mode for the icon inside the button. The default is EAspectRatioNotPreserved.
const TScaleMode aScaleMode | The scale mode. |
IMPORT_C TInt | SetIconSize | ( | const TSize & | aSize | ) |
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.
const TSize & aSize | New icon size. |
IMPORT_C void | SetIconVerticalAlignment | ( | const CAknButton::TAlignment | aVerticalAlignment | ) |
Sets the vertical alignment for the icon inside the button. By default it will be centered.
const CAknButton::TAlignment aVerticalAlignment | The vertical alignment for the icon. |
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. 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.
const TInt aLongPressInterval | The time interval in milliseconds, after which the long press event should be reported. The default value is 800 milliseconds. |
IMPORT_C void | SetMargins | ( | const TMargins8 & | aMargins | ) |
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.
const TMargins8 & aMargins | New marginals. |
IMPORT_C void | SetRequestExit | ( | const TBool | aRequestExit | ) |
Sets whether button should send an EEventRequestExit event to command observer on button up event.
const TBool aRequestExit | ETrue if button should request exit. |
void | SetStateIndexL | ( | TInt | aNewIndex | ) | [private] |
Sets new state index
TInt aNewIndex | New state index |
IMPORT_C void | SetTextAndIconAlignment | ( | const CAknButton::TTextAndIconAlignment | aAlignment | ) |
Sets the icon and text alignment for a button having both
const CAknButton::TTextAndIconAlignment aAlignment |
IMPORT_C void | SetTextColorIds | ( | const TAknsItemID & | aTextColorTableId, |
const TInt | aTextColorIndex | |||
) |
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.
const TAknsItemID & aTextColorTableId | Id for the color table |
const TInt aTextColorIndex | Index of the color inside color table. |
IMPORT_C void | SetTextFont | ( | const CFont * | aFont | ) |
Sets some specific text font.
const CFont * aFont | The font, which should be used for the text inside the text button. |
IMPORT_C void | SetTextHorizontalAlignment | ( | const CGraphicsContext::TTextAlign | aHorizontalAlignment | ) |
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.
const CGraphicsContext::TTextAlign aHorizontalAlignment | The horizontal alignment for the text. |
IMPORT_C void | SetTextUnderlineStyle | ( | TFontUnderline | aUnderlineStyle | ) |
Sets the text underline style for the text inside the button. By default no underline is used.
TFontUnderline aUnderlineStyle | The style of underline. |
IMPORT_C void | SetTextVerticalAlignment | ( | const CAknButton::TAlignment | aVerticalAlignment | ) |
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.
const CAknButton::TAlignment aVerticalAlignment | The vertical alignment for the text. |
IMPORT_C void | SetTooltipPosition | ( | const TTooltipPosition | aPosition | ) |
Sets the tooltip position.
const TTooltipPosition aPosition | The position of the tooltip. |
IMPORT_C void | SizeChanged | ( | ) | [protected, virtual] |
Responds to size changes to sets the size and position of the contents of this control.
TAknsItemID | SkinIID | ( | const TInt | aIndex | ) | const [private] |
Returns the ID of specified skin item.
const TInt aIndex |
IMPORT_C CAknButtonState * | State | ( | const TInt | aStateIndex | ) | const |
Returns the state of the button under specified index.
const TInt aStateIndex | The index for the state. |
void | UseMaskedDraw | ( | TBool | aMaskedDraw | ) |
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.
TBool aMaskedDraw | ETrue to use additional mask. |
TBool | UsesDefaultMargins | ( | ) | const |
Checks if the button uses default margins.
EIconBeforeText | |
EIconAfterText | |
EIconUnderText | |
EIconOverText | |
EOverlay |
CAknsFrameBackgroundControlContext * | iBgContext | [protected] |
CGraphicsContext::TTextAlign | iHorizontalAlignment | [protected] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.