#include <mw/eikseced.h>
class CEikSecretEditor : public CEikBorderedControl |
Protected Attributes | |
---|---|
TInt | iAscent |
TSecEdBuf | iBuf |
TBool | iBufferFull |
TInt | iCharWidth |
TInt | iMaxLen |
HBufC * | iSecCharArr |
TInt | iSecPos |
Public Member Enumerations | |
---|---|
enum | anonymous { EMaxSecEdBufLength, EMaxSecEdSecArrayLength } |
enum | TFeatureId { EDisablePenInput, ELaunchPenInputAutomatic, EPartialScreenInput, ELockQuerySCT } |
Protected Member Functions | |
---|---|
virtual IMPORT_C void | AppendCharacterL(TInt) |
void | InsertSecretChar() |
virtual IMPORT_C void | SizeChanged() |
virtual IMPORT_C void | Update() |
Inherited Attributes | |
---|---|
CCoeControl::iCoeEnv | |
CCoeControl::iContext | |
CCoeControl::iPosition | |
CCoeControl::iSize | |
CEikBorderedControl::iBorder |
Inherited Enumerations | |
---|---|
CCoeControl:TZoomType |
A single line text editor which displays an asterisk for every character entered.
The editor is suitable for editing confidential information such as a password. You can paste to the editor but no other clipboard functions are available.
The editor has an associated resource struct SECRETED and control factory identifier EEikCtSecretEd.
Enumerator | Value | Description |
---|---|---|
EMaxSecEdBufLength | 32 |
The maximum number of characters in the displayed text buffer. |
EMaxSecEdSecArrayLength | 255 |
Indicates the maximum number of characters which may be entered into the editor. Editors additionally have a maximum length, see SetMaxLength(), which must not exceed this value. |
IMPORT_C | CEikSecretEditor | ( | ) |
Default constructor.
This constructs a editor with a border type of TGulBorder::ESingleGray.
This function should be used as the first stage in two stage construction, followed by a call to either ConstructFromResourceL() or SetMaxLength().
IMPORT_C void | AknSetAlignment | ( | const CGraphicsContext::TTextAlign & | aAlign | ) |
Sets the alignment of the editor.
Parameter | Description |
---|---|
aAlign | The editor's alignment. |
IMPORT_C void | AknSetFont | ( | const CFont & | aFont | ) |
Sets the font that is used to draw the text in this editor.
Parameter | Description |
---|---|
aFont | A pointer to a CFont object that is used to draw the text in this editor. |
IMPORT_C void | AppendCharacterL | ( | TInt | aKeyCode | ) | [protected, virtual] |
Appends a character to the editor.
Parameter | Description |
---|---|
aKeyCode | The character to append. |
IMPORT_C const TDesC & | Buffer | ( | ) | const |
Access method for getting at the buffer without copying out from it.
Returns: Non-modifiable descriptor reference to the contained buffer.
IMPORT_C void | ConstructFromResourceL | ( | TResourceReader & | aReader | ) | [virtual] |
Reimplemented from CCoeControl::ConstructFromResourceL(TResourceReader &)
Second-phase construction from a resource file.
This function reads the number of characters which may be entered by the user into the editor from a SECRETED resource. You should call either this function or SetMaxLength() before drawing the editor and offering key events, otherwise the editor will not accept text input.
Parameter | Description |
---|---|
aReader | A resource file reader. |
IMPORT_C void | EnableSCT | ( | TBool | aEnable = ETrue | ) |
Method for enabling/disabling special character table from the secret editor. By default the SCT is enabled in the secret editors. ConstructFromResourceL need to be called before this method.
Parameter | Description |
---|---|
aEnable | Boolean value for enabling or disabling the special character table. |
IMPORT_C void | FocusChanged | ( | TDrawNow | aDrawNow | ) | [virtual] |
Reimplemented from CCoeControl::FocusChanged(TDrawNow)
IMPORT_C void | GetColorUseListL | ( | CArrayFix< TCoeColorUse > & | aColorUseList | ) | const [virtual] |
Reimplemented from CEikBorderedControl::GetColorUseListL(CArrayFix< TCoeColorUse > &)const
Gets the list of logical colours used to draw the editor.
Overrides CCoeControl::GetColorUseListL().
Gets the list of logical colors employed in the drawing of the control, paired with an explanation of how they are used. Appends the list to aColorUseList.
Parameter | Description |
---|---|
aColorUseList | On return, the colour list. |
Used to getting feature statuses.
Parameter | Description |
---|---|
aFeatureId | The feature id, see TFeatureId |
aFeatureParam | On return, the parameter for the feature (usually non-zero for an enabled feature and zero for disabled) |
Returns: KErrNone if the feature is supported and fetching its value succeeded
IMPORT_C void | GetText | ( | TDes & | aText | ) | const |
Gets the editor's text string.
This may be called from the container class when the model data should be updated according to the text contained in the editor.
Parameter | Description |
---|---|
aText | On return, the editor's text. This is what is stored in memory, not what is displayed. This descriptor must be capable of holding the maxlength of the internal buffer. |
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
Reimplemented from CEikBorderedControl::HandlePointerEventL(const TPointerEvent &)
From CCoeControl.
Handles pointer events.
Parameter | Description |
---|---|
aPointerEvent | The pointer event. |
IMPORT_C void | HandleResourceChange | ( | TInt | aType | ) | [virtual] |
Reimplemented from CEikBorderedControl::HandleResourceChange(TInt)
Handles a change to the editor's resources.
The types of resources handled are those which are shared across the environment, e.g. colours or fonts.
Calls CEikBorderedControl::HandleResourceChange().
Handles a change to the control's resources of type aType which are shared across the environment, e.g. colors or fonts.
Parameter | Description |
---|---|
aType | A message UID value. |
IMPORT_C void | InitializeDisplay | ( | TInt | aNumberOfChars | ) | [virtual] |
Set the initial display of the secret editor. Calling this routine doesn't affect the actual character buffer.
IMPORT_C TCoeInputCapabilities | InputCapabilities | ( | ) | const [virtual] |
Reimplemented from CCoeControl::InputCapabilities()const
Gets the editor's input capabilities.
Overrides CCoeControl::InputCapabilities().
If this function is overrided in a subclass, the subclass should obtain this class' InputCapabilities' object provider through TCoeInputCapabilities::ObjectProvider() and set that as a part of the subclass' InputCapabilities object provider chain to ensure maximum functionality.
Returns: The editor's input capabilities. The ESecretText and ENavigation flags are set.
IMPORT_C TInt | MaxLength | ( | ) | const |
Returns the current maximum length of the internal buffer.
Returns: the current maximum length of the internal buffer.
IMPORT_C TSize | MinimumSize | ( | ) | [virtual] |
Reimplemented from CCoeControl::MinimumSize()
Gets the editor's minimum size in pixels.
Overrides CCoeControl::MinimumSize().
Returns: The editor's minimum size in pixels.
IMPORT_C TKeyResponse | OfferKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
Reimplemented from CCoeControl::OfferKeyEventL(const TKeyEvent &,TEventCode)
Responds to key presses.
Overrides CCoeControl::OfferKeyEventL().
Parameter | Description |
---|---|
aKeyEvent | The key event. |
aType | Not used. |
Returns: Indicates whether or not the key event was consumed.
IMPORT_C void | Reset | ( | ) |
Clears the editor's text string removing any trace of it from memory.
IMPORT_C void | RevealSecretText | ( | TBool | aReveal | ) |
Method to reveal (or hide) the currently input editor contents.
Parameter | Description |
---|---|
aReveal | - if ETrue, reveals the contents; if EFalse hides them. |
IMPORT_C void | SetDefaultInputMode | ( | TInt | aInputMode | ) |
Changes default and current input mode of a secret editor. By default input mode in the secret editor is alpha input mode (EAknEditorSecretAlphaInputMode). By using this method the default input mode can be changed to numeric input mode (EAknEditorNumericInputMode).
Parameter | Description |
---|---|
aInputMode | Default input mode in the secret editor. Only EAknEditorNumericInputMode and EAknEditorSecretAlphaInputMode are supported. |
Used for setting various flag-like features to the editor.
Parameter | Description |
---|---|
aFeatureId | The feature id, see TFeatureId |
aFeatureParam | The feature parameter. This is usually enabled or disabled. For more info, see the feature documentation in TFeatureId. |
Returns: KErrNone if the feature modification succeeded
IMPORT_C void | SetMaxLength | ( | TInt | aMaxLength | ) |
Set the maximum length of the editor.
This is the maximum number of characters which may be entered by the user into the editor.
Parameter | Description |
---|---|
aMaxLength | The maximum number of characters which may be entered. |
IMPORT_C void | SetSkinBackgroundControlContextL | ( | MAknsControlContext * | aContext | ) |
Set the skin control context to be used with this secret editor. If this method is not called, the control context available through MOP (if any) is used. If NULL control context is specified, no control context is used at all.
Parameter | Description |
---|---|
aContext | The background control context used to draw the background of this editor or NULL. Ownership is not transferred. |
IMPORT_C void | SetSkinTextColorL | ( | TInt | aAknSkinIDForTextColor, |
TInt | aAknSkinIdForBgColor = KErrNotFound | |||
) |
Sets the colors for text and background as skin IDs.
Parameter | Description |
---|---|
aAknSkinIDForTextColor | ID for text color. |
IMPORT_C void | SetText | ( | const TDesC & | aText | ) | [virtual] |
Set the contents of the character buffer.
Parameter | Description |
---|---|
aText | The text to be set as the contents of the character buffer. |
IMPORT_C void | SizeChanged | ( | ) | [protected, virtual] |
Reimplemented from CCoeControl::SizeChanged()
Responds to changes to the size and position of the contents of this control.
Overrides CCoeControl::SizeChanged().