CEikSecretEditor Class Reference

#include <mw/eikseced.h>

Link against: eikctl.lib

class CEikSecretEditor : public CEikBorderedControl

Inherits from

Protected Attributes
TInt iAscent
TSecEdBuf iBuf
TBool iBufferFull
TInt iCharWidth
TInt iMaxLen
HBufC *iSecCharArr
TInt iSecPos
Public Member Enumerations
enumanonymous { EMaxSecEdBufLength, EMaxSecEdSecArrayLength }
enumTFeatureId { EDisablePenInput, ELaunchPenInputAutomatic, EPartialScreenInput, ELockQuerySCT }
Public Member Functions
CEikSecretEditor()
~CEikSecretEditor()
IMPORT_C voidAknSetAlignment(const CGraphicsContext::TTextAlign &)
IMPORT_C voidAknSetFont(const CFont &)
IMPORT_C const TDesC &Buffer()
virtual IMPORT_C voidConstructFromResourceL(TResourceReader &)
TPoint CursorPos()
IMPORT_C voidEnableCursor(TBool)
IMPORT_C voidEnableSCT(TBool)
virtual IMPORT_C voidFocusChanged(TDrawNow)
virtual IMPORT_C voidGetColorUseListL(CArrayFix< TCoeColorUse > &)
IMPORT_C TIntGetFeature(TInt, TInt &)
IMPORT_C voidGetText(TDes &)
virtual IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
virtual IMPORT_C voidHandleResourceChange(TInt)
virtual IMPORT_C voidInitializeDisplay(TInt)
virtual IMPORT_C TCoeInputCapabilitiesInputCapabilities()
IMPORT_C TIntMaxLength()
virtual IMPORT_C TSizeMinimumSize()
virtual IMPORT_C TKeyResponseOfferKeyEventL(const TKeyEvent &, TEventCode)
IMPORT_C voidReset()
IMPORT_C voidRevealSecretText(TBool)
IMPORT_C voidSetDefaultInputMode(TInt)
IMPORT_C TIntSetFeature(TInt, TInt)
IMPORT_C voidSetMaxLength(TInt)
IMPORT_C voidSetSkinBackgroundControlContextL(MAknsControlContext *)
IMPORT_C voidSetSkinTextColorL(TInt, TInt)
virtual IMPORT_C voidSetText(const TDesC &)
voidStartTimer()
IMPORT_C TBoolSupportsFeature(TInt)
Protected Member Functions
virtual IMPORT_C voidAppendCharacterL(TInt)
voidInsertSecretChar()
virtual IMPORT_C voidSizeChanged()
virtual IMPORT_C voidUpdate()
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize
CEikBorderedControl::iBorder
Inherited Enumerations
CCoeControl:TZoomType
Inherited Functions
CAknControl::CAknControl()
CAknControl::~CAknControl()
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CCoeControl::AccumulatedZoom()const
CCoeControl::ActivateGc()const
CCoeControl::ActivateL()
CCoeControl::BackedUpWindow()const
CCoeControl::Background()const
CCoeControl::CCoeControl()
CCoeControl::CCoeControl(CCoeEnv *)
CCoeControl::CCoeControl(const CCoeControl &)
CCoeControl::CCoeControlArray
CCoeControl::CapturesPointer()const
CCoeControl::ClaimPointerGrab(TBool)
CCoeControl::ClaimPointerGrab(TInt,TBool)
CCoeControl::CloseWindow()
CCoeControl::ComponentArrayExists()const
CCoeControl::ComponentControl(TInt)const
CCoeControl::Components()
CCoeControl::Components()const
CCoeControl::ControlContext()const
CCoeControl::ControlEnv()const
CCoeControl::CopyControlContextFrom(const CCoeControl *)
CCoeControl::CountComponentControls()const
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &)
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &,TDisplayMode)
CCoeControl::CreateWindowL()
CCoeControl::CreateWindowL(RWindowGroup *)
CCoeControl::CreateWindowL(RWindowTreeNode &)
CCoeControl::CreateWindowL(const CCoeControl *)
CCoeControl::CustomGc()const
CCoeControl::DeactivateGc()const
CCoeControl::DrawBackground(const TRect &)const
CCoeControl::DrawDeferred()const
CCoeControl::DrawForeground(const TRect &)const
CCoeControl::DrawNow()const
CCoeControl::DrawNow(const TRect &)const
CCoeControl::DrawableWindow()const
CCoeControl::EnableDragEvents()
CCoeControl::EnableReportControlStateChange(TBool)
CCoeControl::EnableWindowTransparency()
CCoeControl::FindBackground()const
CCoeControl::FindFontProvider()const
CCoeControl::GetColor(TInt,TRgb &)const
CCoeControl::GetGc()const
CCoeControl::GetHelpContext(TCoeHelpContext &)const
CCoeControl::GrabbingComponent()const
CCoeControl::GrabbingComponent(TInt)const
CCoeControl::HandleComponentControlsResourceChange(TInt)
CCoeControl::HandleControlArrayEventL(CCoeControlArray::TEvent,const CCoeControlArray *,CCoeControl *,TInt)
CCoeControl::HandlePointerBufferReadyL()
CCoeControl::HandleRedrawEvent(const TRect &)const
CCoeControl::HitTest()const
CCoeControl::IgnoreEventsUntilNextPointerUp()
CCoeControl::Index(const CCoeControl *)const
CCoeControl::InitComponentArrayL()
CCoeControl::IsActivated()const
CCoeControl::IsBackedUp()const
CCoeControl::IsBeingDestroyed()const
CCoeControl::IsBlank()const
CCoeControl::IsDimmed()const
CCoeControl::IsFocused()const
CCoeControl::IsNonFocusing()const
CCoeControl::IsReadyToDraw()const
CCoeControl::IsVisible()const
CCoeControl::LayoutManager()const
CCoeControl::MakeVisible(TBool)
CCoeControl::MaximumWidth()const
CCoeControl::MopSupplyObject(TTypeUid)
CCoeControl::NotifyFontChange(const CCoeFontProvider *)
CCoeControl::Observer()const
CCoeControl::OverrideColorL(TInt,TRgb)
CCoeControl::OwnsWindow()const
CCoeControl::Parent()
CCoeControl::Parent()const
CCoeControl::Position()const
CCoeControl::PositionChanged()
CCoeControl::PositionRelativeToScreen()const
CCoeControl::PrepareForFocusGainL()
CCoeControl::PrepareForFocusLossL()
CCoeControl::ProcessPointerBufferReadyL()
CCoeControl::ProcessPointerEventL(const TPointerEvent &)
CCoeControl::Rect()const
CCoeControl::RecursivelyMergeInputCapabilities(TCoeInputCapabilities &)const
CCoeControl::RecursivelyMergedInputCapabilities()const
CCoeControl::RefetchPixelMappingL()
CCoeControl::RemoveFromParent()
CCoeControl::ReportEventL(MCoeControlObserver::TCoeEvent)
CCoeControl::RequestRelayout(const CCoeControl *)
CCoeControl::ResetGc()const
CCoeControl::ScreenFont(const TCoeFont &)const
CCoeControl::SetAllowStrayPointers()
CCoeControl::SetBackground(const MCoeControlBackground *)
CCoeControl::SetBlank()
CCoeControl::SetCanDrawOutsideRect()
CCoeControl::SetComponentsToInheritVisibility(TBool)
CCoeControl::SetContainerWindowL(RBackedUpWindow &)
CCoeControl::SetContainerWindowL(RWindow &)
CCoeControl::SetContainerWindowL(const CCoeControl &)
CCoeControl::SetControlContext(MCoeControlContext *)
CCoeControl::SetCornerAndSize(TGulAlignment,const TSize &)
CCoeControl::SetCustomGc(CWindowGc *)
CCoeControl::SetDimmed(TBool)
CCoeControl::SetExtent(const TPoint &,const TSize &)
CCoeControl::SetExtentToWholeScreen()
CCoeControl::SetFocus(TBool,TDrawNow)
CCoeControl::SetFocusing(TBool)
CCoeControl::SetFontProviderL(const CCoeFontProvider &)
CCoeControl::SetGc(CWindowGc *)const
CCoeControl::SetGloballyCapturing(TBool)
CCoeControl::SetHitTest(const MCoeControlHitTest *)
CCoeControl::SetLayoutManagerL(MCoeLayoutManager *)
CCoeControl::SetMaximumWidth(TInt)
CCoeControl::SetMopParent(MObjectProvider *)
CCoeControl::SetNeighbor(CCoeControl *)
CCoeControl::SetNonFocusing()
CCoeControl::SetObserver(MCoeControlObserver *)
CCoeControl::SetParent(CCoeControl *)
CCoeControl::SetPointerCapture(TBool)
CCoeControl::SetPosition(const TPoint &)
CCoeControl::SetRect(const TRect &)
CCoeControl::SetSize(const TSize &)
CCoeControl::SetSizeWithoutNotification(const TSize &)
CCoeControl::SetTextBaselineSpacing(TInt)
CCoeControl::SetUniqueHandle(TInt)
CCoeControl::SetZoomFactorL(TInt,TZoomType)
CCoeControl::Size()const
CCoeControl::SystemGc()const
CCoeControl::TextBaselineOffset(const TSize &)const
CCoeControl::TextDrawer(TInt)const
CCoeControl::UniqueHandle()const
CCoeControl::Window()const
CCoeControl::WriteInternalStateNowL(RWriteStream &)const
CCoeControl::ZoomWithType()const
CCoeControl::operator=(const CCoeControl &)
CCoeControl::~CCoeControl()
CEikBorderedControl::Border()const
CEikBorderedControl::CEikBorderedControl()
CEikBorderedControl::CEikBorderedControl(const TGulBorder &)
CEikBorderedControl::HasBorder()const
CEikBorderedControl::SetAdjacent(TInt)
CEikBorderedControl::SetBorder(TGulBorder::TBorderType)
CEikBorderedControl::SetBorder(TInt)
CEikBorderedControl::WriteInternalStateL(RWriteStream &)const

Detailed Description

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.

Member Attribute Documentation

iAscent

TInt iAscent[protected]

iBuf

TSecEdBuf iBuf[protected]

iBufferFull

TBool iBufferFull[protected]

iCharWidth

TInt iCharWidth[protected]

iMaxLen

TInt iMaxLen[protected]

iSecCharArr

HBufC *iSecCharArr[protected]

iSecPos

TInt iSecPos[protected]

Member Enumeration Documentation

Enum anonymous

EnumeratorValueDescription
EMaxSecEdBufLength32

The maximum number of characters in the displayed text buffer.

EMaxSecEdSecArrayLength255

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.

Enum TFeatureId

Settable features for Secret Editor. See SetFeature().

Since
S60 5.0
EnumeratorValueDescription
EDisablePenInput

Disables VKB. Non-zero (or ETrue) parameter disables VKB, 0 (or EFalse) enables VKB. When disabled, editor doesn't request PenInputServer to start VKB

ELaunchPenInputAutomatic
EPartialScreenInput
ELockQuerySCT

Constructor & Destructor Documentation

CEikSecretEditor ( )

IMPORT_CCEikSecretEditor()

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().

~CEikSecretEditor ( )

IMPORT_C~CEikSecretEditor()

Destructor.

Member Function Documentation

AknSetAlignment ( const CGraphicsContext::TTextAlign & )

IMPORT_C voidAknSetAlignment(const CGraphicsContext::TTextAlign &aAlign)

Sets the alignment of the editor.

ParameterDescription
aAlignThe editor's alignment.

AknSetFont ( const CFont & )

IMPORT_C voidAknSetFont(const CFont &aFont)

Sets the font that is used to draw the text in this editor.

ParameterDescription
aFontA pointer to a CFont object that is used to draw the text in this editor.

AppendCharacterL ( TInt )

IMPORT_C voidAppendCharacterL(TIntaKeyCode)[protected, virtual]

Appends a character to the editor.

ParameterDescription
aKeyCodeThe character to append.

Buffer ( )

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.

ConstructFromResourceL ( TResourceReader & )

IMPORT_C voidConstructFromResourceL(TResourceReader &aReader)[virtual]

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.

panic
EIKCTL 13 If the value read from resource is greater than EMaxSecEdLength.
ParameterDescription
aReaderA resource file reader.

CursorPos ( )

TPoint CursorPos()

EnableCursor ( TBool )

IMPORT_C voidEnableCursor(TBoolaEnable)

EnableSCT ( TBool )

IMPORT_C voidEnableSCT(TBoolaEnable = 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.

Since
3.2
ParameterDescription
aEnableBoolean value for enabling or disabling the special character table.

FocusChanged ( TDrawNow )

IMPORT_C voidFocusChanged(TDrawNowaDrawNow)[virtual]

GetColorUseListL ( CArrayFix< TCoeColorUse > & )

IMPORT_C voidGetColorUseListL(CArrayFix< TCoeColorUse > &aColorUseList)const [virtual]

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.

Since
ER5U
ParameterDescription
aColorUseListOn return, the colour list.

GetFeature ( TInt, TInt & )

IMPORT_C TIntGetFeature(TIntaFeatureId,
TInt &aFeatureParam
)const

Used to getting feature statuses.

Since
S60 5.0
ParameterDescription
aFeatureIdThe feature id, see TFeatureId
aFeatureParamOn 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

GetText ( TDes & )

IMPORT_C voidGetText(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.

ParameterDescription
aTextOn 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.

HandlePointerEventL ( const TPointerEvent & )

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

From CCoeControl.

Handles pointer events.

ParameterDescription
aPointerEventThe pointer event.

HandleResourceChange ( TInt )

IMPORT_C voidHandleResourceChange(TIntaType)[virtual]

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.

Since
ER5U
ParameterDescription
aTypeA message UID value.

InitializeDisplay ( TInt )

IMPORT_C voidInitializeDisplay(TIntaNumberOfChars)[virtual]

Set the initial display of the secret editor. Calling this routine doesn't affect the actual character buffer.

InputCapabilities ( )

IMPORT_C TCoeInputCapabilitiesInputCapabilities()const [virtual]

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.

InsertSecretChar ( )

voidInsertSecretChar()[protected]

MaxLength ( )

IMPORT_C TIntMaxLength()const

Returns the current maximum length of the internal buffer.

Returns: the current maximum length of the internal buffer.

MinimumSize ( )

IMPORT_C TSizeMinimumSize()[virtual]

Reimplemented from CCoeControl::MinimumSize()

Gets the editor's minimum size in pixels.

Overrides CCoeControl::MinimumSize().

Returns: The editor's minimum size in pixels.

OfferKeyEventL ( const TKeyEvent &, TEventCode )

IMPORT_C TKeyResponseOfferKeyEventL(const TKeyEvent &aKeyEvent,
TEventCodeaType
)[virtual]

Responds to key presses.

Overrides CCoeControl::OfferKeyEventL().

ParameterDescription
aKeyEventThe key event.
aTypeNot used.

Returns: Indicates whether or not the key event was consumed.

Reset ( )

IMPORT_C voidReset()

Clears the editor's text string removing any trace of it from memory.

RevealSecretText ( TBool )

IMPORT_C voidRevealSecretText(TBoolaReveal)

Method to reveal (or hide) the currently input editor contents.

ParameterDescription
aReveal- if ETrue, reveals the contents; if EFalse hides them.

SetDefaultInputMode ( TInt )

IMPORT_C voidSetDefaultInputMode(TIntaInputMode)

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).

Since
2.1
ParameterDescription
aInputModeDefault input mode in the secret editor. Only EAknEditorNumericInputMode and EAknEditorSecretAlphaInputMode are supported.

SetFeature ( TInt, TInt )

IMPORT_C TIntSetFeature(TIntaFeatureId,
TIntaFeatureParam
)

Used for setting various flag-like features to the editor.

Since
S60 5.0
ParameterDescription
aFeatureIdThe feature id, see TFeatureId
aFeatureParamThe feature parameter. This is usually enabled or disabled. For more info, see the feature documentation in TFeatureId.

Returns: KErrNone if the feature modification succeeded

SetMaxLength ( TInt )

IMPORT_C voidSetMaxLength(TIntaMaxLength)

Set the maximum length of the editor.

This is the maximum number of characters which may be entered by the user into the editor.

panic
EIKCTL 13 If aMaxLength is greater than EMaxSecEdLength.
ParameterDescription
aMaxLengthThe maximum number of characters which may be entered.

SetSkinBackgroundControlContextL ( MAknsControlContext * )

IMPORT_C voidSetSkinBackgroundControlContextL(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.

Since
2.0
ParameterDescription
aContextThe background control context used to draw the background of this editor or NULL. Ownership is not transferred.

SetSkinTextColorL ( TInt, TInt )

IMPORT_C voidSetSkinTextColorL(TIntaAknSkinIDForTextColor,
TIntaAknSkinIdForBgColor =  KErrNotFound
)

Sets the colors for text and background as skin IDs.

Since
3.0
ParameterDescription
aAknSkinIDForTextColorID for text color.

SetText ( const TDesC & )

IMPORT_C voidSetText(const TDesC &aText)[virtual]

Set the contents of the character buffer.

ParameterDescription
aTextThe text to be set as the contents of the character buffer.

SizeChanged ( )

IMPORT_C voidSizeChanged()[protected, virtual]

Reimplemented from CCoeControl::SizeChanged()

Responds to changes to the size and position of the contents of this control.

Overrides CCoeControl::SizeChanged().

StartTimer ( )

voidStartTimer()

SupportsFeature ( TInt )

IMPORT_C TBoolSupportsFeature(TIntaFeatureId)const

Used for checking if the editor supports a feature. For features, see TFeatureId.

Since
S60 5.0

Returns: ETrue if the feature is supported

Update ( )

IMPORT_C voidUpdate()[protected, virtual]

Updates and redraws the editor.