UIQ Technology
Symbian OS Library

UIQ 3.1 SDK        UIQ developer portal

[Index] [Spacer] [Previous] [Next]



Location: EIKEDWIN.H
Link against: eikcoctl.lib

Class CEikEdwin

class CEikEdwin : public CEikBorderedControl, public MEikScrollBarObserver, public CTextView::MObserver, public MEditObserver, public MQikCommandListOwner, public MQikCommandHandler, public MQikControlStreamInterface, public MQikTextRepresentationInterface;

Description

Base class for controls that display and allow manipulation of text.

The properties of a particular Edwin object can be set using bitwise flags, which are defined in member enums (see TFlags for example).Edwins support Front End Processors if present on the target machine, and so are a highly effective way of getting textual data from the user. The text currently being composed by the user is called the composition text.

Derivation

  • MObjectProvider - An interface that allows an object to be part of a network of object providers
  • CBase - Base class for all classes to be instantiated on the heap
  • Members

    Defined in CEikEdwin:
    ActivateL(), AddEdwinObserverL(), AvgCharsPerLine(), AvgLinesInViewRect(), BaseConstructL(), Border(), CEikEdwin(), CEikEdwin(), CEikEdwin_Reserved_1(), CalculateHeight(), CalculateWidth(), CanUndo(), CancelFepTransaction(), CancelInsertCharFormat(), CancelSelectionL(), CheckNotReadOnlyL(), CheckRemovePictures(), CheckValidityOfChars(), ClearSelectionL(), ClearUndo(), ClipboardL(), ComponentControl(), ConstructFromResourceL(), ConstructL(), CopyDocumentContentL(), CopyToStoreL(), CountComponentControls(), CountWords(), CreateCustomDrawL(), CreateLayoutL(), CreatePreAllocatedScrollBarFrameL(), CreateScrollBarFrameL(), CreateTextAndLayoutL(), CreateTextViewL(), CursorPos(), DeleteContentL(), DeleteHighlightL(), DeleteL(), DisplayFindTextNotFound(), Draw(), DrawContents(), EAllowPictures, EAllowUndo, EAlwaysShowSelection, EChunkPara, EChunkWord, ECopy, ECopyText, ECursorWrapOff, ECursorWrapOn, ECursorWrapUpOff, ECustomWrap, ECut, EDisableAutoCurEnd, EDisableSkinning, EDisplayOnly, EDoesNotOwnText, EDragDouble, EEnableAutoSelection, EEnd, EFindAgain, EFindCaseSensitive, EFindDirectionUp, EFindWholeWord, EHotKeyBold, EHotKeyCopy, EHotKeyCut, EHotKeyEditObject, EHotKeyFind, EHotKeyFont, EHotKeyFormatObject, EHotKeyInsertChar, EHotKeyInsertObject, EHotKeyItalic, EHotKeyPaste, EHotKeySelectAll, EHotKeyUnderline, EHotKeyUndo, EIgnoreVirtualCursor, EInclusiveSizeFixed, EJustAutoCurEnd, EKeepDocument, ELeftDownInViewRect, ELineCursor, ENoAutoSelection, ENoBusyMessage, ENoClipboard, ENoCursorWrap, ENoCursorWrapUp, ENoCustomDraw, ENoHorizScrolling, ENoLineOrParaBreaks, ENoTextParsers, ENoWrap, ENumericCharacters, EOnlyASCIIChars, EOwnsText, EOwnsWindow, EPaste, EReadOnly, EReadOnlyFile, EResizable, ERichText, ESegmentedStorage, EStart, EUseText, EUserSuppliedText, EWidthInPixels, EditObserver(), FindL(), FindNextVisualStartOfWordL(), FindTextL(), FocusChanged(), ForceScrollBarUpdateL(), FormatTextL(), GetColorUseListL(), GetFindText(), GetHelpContext(), GetText(), GetTextInHBufL(), GetWordInfo(), HandleCommandL(), HandleControlArrayEventL(), HandlePointerBufferReadyL(), HandlePointerEventL(), HandleResourceChange(), HandleScrollEventL(), HandleSizeChangedL(), HandleTextChangedL(), HandleTextPastedL(), HasBorder(), IdleL(), InputCapabilities(), InsertDeleteCharsL(), InsertFieldL(), InsertFromTextFileL(), IsReadOnly(), IsSkinningDisabled(), LayoutWidth(), LineCursorWidth(), LowerPartialFormattingLength(), MakeVisible(), MapCommandHandler(), Margins(), MaximumHeight(), MinimumHeight(), MinimumSize(), MopSupplyObject(), MoveCursorL(), MoveCursorToChunkStartL(), MoveDisplayL(), NonPrintingCharsVisibility(), NotifyInvalidOperationOnReadOnlyL(), NotifyNewDocumentL(), NotifyNewFormatL(), OfferKeyEventL(), OkToDeleteSelectionL(), OnReformatL(), OnlyASCIIChars(), PasteFromStoreL(), PlaceDataOnClipboardL(), PositionChanged(), PrepareForFocusGainL(), PrepareForFocusLossL(), ReceiveDataOverIrL(), RemoveEdwinObserver(), ReplaceAllL(), ReplaceL(), ReportEdwinEventL(), RequestRelayout(), RestoreUserDataL(), RunCharMapDialogL(), ScrollBarFrame(), SelectAllL(), Selection(), SelectionLength(), SendDataOverIrL(), SetAdjacent(), SetAllowPictures(), SetAllowUndo(), SetAmountToFormatL(), SetAvgCharsPerLine(), SetAvgLinesInViewRect(), SetBackgroundColorL(), SetBorder(), SetBorder(), SetBorderViewMargins(), SetContainerWindowL(), SetContainerWindowL(), SetControlValueObserver(), SetCursorPosL(), SetCursorVisibilityL(), SetCursorWrap(), SetDimmed(), SetDocumentContentL(), SetDocumentOwnership(), SetEdwinClipboardObserverL(), SetEdwinObserver(), SetEdwinSizeObserver(), SetInputCapabilitiesL(), SetLayoutManagerL(), SetLineCursorDetailsL(), SetMaximumHeight(), SetMinimumHeight(), SetNeighbor(), SetNonPrintingCharsVisibility(), SetNumberOfLinesL(), SetOnlyASCIIChars(), SetParent(), SetPasteFromIrStore(), SetPreferredWidthInChars(), SetReadOnly(), SetResizableL(), SetRightWrapGutter(), SetSelectionL(), SetTextBaselineSpacing(), SetTextL(), SetTextLimit(), SetUndoBufferL(), SetUndoableText(), SetWordDelimiters(), SetWordWrapL(), SetWysiwygModeOff(), SetWysiwygModeOn(), SetZoomFactorL(), SizeChanged(), StoreUserDataL(), SupportsUndo(), TChunkSize, TClipboardFunc, TEdwinCursorWrapValues, TEdwinHotKeys, TEikEdwinFlags, TEnd, TFindFlags, TFlags, TOwnershipType, TSetContent, Text(), TextBaselineOffset(), TextLayout(), TextLength(), TextLimit(), TextRepresentationL(), TextView(), TrappedDraw(), TrappedSizeChanged(), UndoL(), UpdateAllFieldsL(), UpdateCommandsAfterNavigationChange(), UpdateCommandsAfterStateChange(), UpdateCurrentFieldL(), UpdateLayoutWidth(), UpdateScrollBarsL(), UpperFullFormattingLength(), WriteInternalStateL(), iEdwinInternalFlags, iEdwinUserFlags, iLastPointerDocPos, iLayout, iMargins, iNumberOfLines, iText, iTextLimit, iTextView, iUndoStore, iZoomFactor, ~CEikEdwin()

    Inherited from CBase:
    Delete(), Extension_(), operator new()

    Inherited from CCoeControl:
    AccumulatedZoom(), ActivateGc(), BackedUpWindow(), Background(), CapturesPointer(), ClaimPointerGrab(), CloseWindow(), ComponentArrayExists(), Components(), ControlContext(), ControlEnv(), CopyControlContextFrom(), CreateBackedUpWindowL(), CreateWindowL(), DeactivateGc(), DrawBackground(), DrawDeferred(), DrawForeground(), DrawNow(), DrawableWindow(), EAbsoluteZoom, ERelativeZoom, EnableDragEvents(), FindBackground(), FindFontProvider(), GetColor(), GetGc(), GetTextDrawer(), GrabbingComponent(), HandleComponentControlsResourceChange(), HandleRedrawEvent(), HitTest(), IgnoreEventsUntilNextPointerUp(), Index(), InitComponentArrayL(), IsActivated(), IsBackedUp(), IsBeingDestroyed(), IsBlank(), IsDimmed(), IsFocused(), IsNonFocusing(), IsReadyToDraw(), IsVisible(), LayoutManager(), MaximumWidth(), MopNext(), Observer(), OverrideColorL(), OwnsWindow(), Parent(), Position(), PositionRelativeToScreen(), Rect(), RecursivelyMergedInputCapabilities(), ReportEventL(), Reserved_2(), ResetGc(), ScreenFont(), SetAllowStrayPointers(), SetBackground(), SetBlank(), SetCanDrawOutsideRect(), SetComponentsToInheritVisibility(), SetControlContext(), SetCornerAndSize(), SetExtent(), SetExtentToWholeScreen(), SetFocus(), SetFocusing(), SetFontProviderL(), SetGc(), SetGloballyCapturing(), SetHitTest(), SetMaximumWidth(), SetMopParent(), SetNonFocusing(), SetObserver(), SetPointerCapture(), SetPosition(), SetRect(), SetSize(), SetSizeWithoutNotification(), SetUniqueHandle(), Size(), SystemGc(), TZoomType, TextDrawer(), UniqueHandle(), Window(), ZoomWithType(), iCoeEnv, iContext, iPosition, iSize

    Inherited from CEikBorderedControl:
    iBorder

    Inherited from MEikBorderedControl:
    ETypeId, anonymous

    Inherited from MObjectProvider:
    MObjectProvider_Reserved1(), MObjectProvider_Reserved2(), MopGetObject(), MopGetObjectNoChaining()

    Inherited from MQikCommandHandler:
    HandleAttemptDimmedSelectionL()


    Construction and destruction


    ~CEikEdwin()

    IMPORT_C ~CEikEdwin();

    Description

    Deletes objects and frees resources owned by this object.

    The Edwins editable text is freed if the EKeepDocument flag is not set.


    CEikEdwin()

    IMPORT_C CEikEdwin();

    Description

    Default constructor.

    Creates a new Edwin, FEP support for the new editor will not be present if there is insufficient memory.


    CEikEdwin()

    IMPORT_C CEikEdwin(const TGulBorder &aBorder);

    Description

    Creates a new Edwin, specifying the border to use.

    As with the default constructor, FEP support for the new editor will not be present if there is insufficient memory.

    Parameters

    const TGulBorder &aBorder


    ConstructL()

    IMPORT_C void ConstructL(TInt aEdwinFlags=0, TInt aWidthInChars=0, TInt aTextLimit=0, TInt aNumberOfLines=0);

    Description

    Completes construction of a new Edwin, initialising its heap-stored members from the supplied arguments.

    This function will leave if any of the pointer members being constructed leave.

    Parameters

    TInt aEdwinFlags

    TInt aWidthInChars

    TInt aTextLimit

    TInt aNumberOfLines

    [Top]


    Member functions


    SetEdwinObserver()

    IMPORT_C void SetEdwinObserver(MEikEdwinObserver *aEdwinObserver);

    Description

    Sets the Edwin observer.

    The Edwins observer will be called back with control events associated with the Edwin.

    Parameters

    MEikEdwinObserver *aEdwinObserver


    AddEdwinObserverL()

    IMPORT_C void AddEdwinObserverL(MEikEdwinObserver *aEdwinObserver);

    Description

    Adds an observer of standard Edwin events to the list of observers, creating the list if necessary.

    May be called any number of times and is independent of calls to SetEdwinObserver .

    Parameters

    MEikEdwinObserver *aEdwinObserver


    RemoveEdwinObserver()

    IMPORT_C void RemoveEdwinObserver(MEikEdwinObserver *aEdwinObserver);

    Description

    Removes the specified observer from the list of observers.

    Does nothing if aEdwinObserver is not an observer.

    Parameters

    MEikEdwinObserver *aEdwinObserver


    SetContainerWindowL()

    IMPORT_C void SetContainerWindowL();

    Description

    Sets the containing window for the Edwin.


    SetDocumentContentL()

    IMPORT_C void SetDocumentContentL(CGlobalText &aText, TSetContent aContent=CEikEdwin::ECopyText);

    Description

    Sets the Edwins editable content.

    Before calling this function you must get the iText pointer as iText is replaced by aText . You must also free the memory by deleting the previous iText contents.

    Parameters

    CGlobalText &aText

    TSetContent aContent


    OfferKeyEventL()

    virtual IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);

    Description

    Handles key events.

    Parameters

    const TKeyEvent &aKeyEvent

    TEventCode aType

    Return value

    TKeyResponse

    " TKeyResponse " A suitable response code.


    FocusChanged()

    virtual IMPORT_C void FocusChanged(TDrawNow aDrawNow);

    Description

    Responds to focus-changed events.

    Parameters

    TDrawNow aDrawNow


    ActivateL()

    virtual IMPORT_C void ActivateL();

    Description

    Sets the Edwin as ready for drawing.


    ConstructFromResourceL()

    virtual IMPORT_C void ConstructFromResourceL(TResourceReader &aReader);

    Description

    Completes the construction of a new Edwin.

    This function initialises the heap-stored members from an EDWIN resource and will leave if any of the pointer members being constructed leave.

    Parameters

    TResourceReader &aReader


    HandlePointerEventL()

    virtual IMPORT_C void HandlePointerEventL(const TPointerEvent &aPointerEvent);

    Description

    Handles pointer events.

    Parameters

    const TPointerEvent &aPointerEvent


    MinimumSize()

    virtual IMPORT_C TSize MinimumSize();

    Description

    Gets the minimum size of this Edwin for automatic-layout control contexts such as dialogs.

    Return value

    TSize

    " TSize " Minimum size for the control.


    Draw()

    virtual IMPORT_C void Draw(const TRect &aRect) const;

    Description

    Draws the control on request.

    Parameters

    const TRect &aRect


    SetDimmed()

    virtual IMPORT_C void SetDimmed(TBool aDimmed);

    Description

    Dims or undims the Edwin.

    Parameters

    TBool aDimmed


    SetContainerWindowL()

    virtual IMPORT_C void SetContainerWindowL(const CCoeControl &aParent);

    Description

    Sets the containing window for the Edwin by copying it from the specified parent.

    Parameters

    const CCoeControl &aParent


    GetColorUseListL()

    virtual IMPORT_C void GetColorUseListL(CArrayFix< TCoeColorUse > &aColorUseList) const;

    Description

    Gets the list of logical colours employed in the drawing of the control, paired with an explanation of how they are used.

    Appends the list to aColorUseList .

    Parameters

    CArrayFix< TCoeColorUse > &aColorUseList


    HandleResourceChange()

    virtual IMPORT_C void HandleResourceChange(TInt aType);

    Description

    Handles a change to Edwins resources which are shared across the environment.

    Colours or fonts for example.

    Parameters

    TInt aType


    InputCapabilities()

    virtual IMPORT_C TCoeInputCapabilities InputCapabilities() const;

    Description

    Gets the control's input capabilities. From CCoeControl .

    Return value

    TCoeInputCapabilities

    The control's input capabilities.

    See also:


    SetInputCapabilitiesL()

    IMPORT_C void SetInputCapabilitiesL(const TCoeInputCapabilities &aInputCapabilities);

    Description

    Sets the Edwins input capabilities.

    Parameters

    const TCoeInputCapabilities &aInputCapabilities


    WriteInternalStateL()

    virtual IMPORT_C void WriteInternalStateL(RWriteStream &aWriteStream) const;

    Description

    Writes the internal state of the control and its components to aStream. Does nothing in release mode. Designed to be overidden and base called by subclasses.

    Parameters

    RWriteStream &aWriteStream


    PrepareForFocusGainL()

    virtual IMPORT_C void PrepareForFocusGainL();

    Description

    Notifier called upon before the control gains focus.


    PrepareForFocusLossL()

    virtual IMPORT_C void PrepareForFocusLossL();

    Description

    Notifier called upon before the control loses focus.


    HandleScrollEventL()

    virtual IMPORT_C void HandleScrollEventL(CEikScrollBar *aScrollBar, TEikScrollEvent aEventType);

    Description

    Handles scroll bar events passed by this Edwins scroll bars.

    Parameters

    CEikScrollBar *aScrollBar

    TEikScrollEvent aEventType


    OnReformatL()

    virtual IMPORT_C void OnReformatL(const CTextView *aTextView);

    Description

    Responds to text height change.

    Reports the event EEventSizeChanging to the Edwin observer when the text view height changes. This function checks the new height is within the minimum and maximum Edwin height limits and redraws the Edwin within those limits.

    Parameters

    const CTextView *aTextView


    MapCommandHandler()

    virtual IMPORT_C MQikCommandHandler *MapCommandHandler(CQikCommand &aCommand);

    Description

    From MQikCommandListOwner

    Parameters

    CQikCommand &aCommand

    Return value

    MQikCommandHandler *


    HandleCommandL()

    virtual IMPORT_C void HandleCommandL(CQikCommand &aCommand);

    Description

    From MQikCommandHandler

    Parameters

    CQikCommand &aCommand


    StoreUserDataL()

    virtual IMPORT_C void StoreUserDataL(RWriteStream &aWriteStream) const;

    Description

    Method to store the current user data of the control

    Parameters

    RWriteStream &aWriteStream

    The RWriteStream where the user data is written


    RestoreUserDataL()

    virtual IMPORT_C void RestoreUserDataL(RReadStream &aReadStream);

    Description

    Method to restore saved user data of the control

    Parameters

    RReadStream &aReadStream


    TextRepresentationL()

    virtual IMPORT_C HBufC *TextRepresentationL() const;

    Description

    Method to get the textual representation of the control.

    Return value

    HBufC *

    A HBufC* containing the textual representation of the control.


    SetControlValueObserver()

    virtual IMPORT_C void SetControlValueObserver(MQikControlValueObserver *aObserver);

    Description

    This method is used to set the control value observer that shall later be notified of control value changes.

    Parameters

    MQikControlValueObserver *aObserver


    SetNumberOfLinesL()

    IMPORT_C void SetNumberOfLinesL(TInt aMaxNumberOfLines);

    Description

    Sets the number of lines visible on screen. For resizable Edwins (that grow and shrink as the user types), 0 (zero) means no maximum number of lines. For non-resizable Edwins 0 (zero) has the same effect as 1 (one).

    Parameters

    TInt aMaxNumberOfLines


    SetResizableL()

    IMPORT_C void SetResizableL(TBool aGrowingAsYouType);

    Description

    Set EResizable to enable the the edwin to grow with the text up to iMaxNumberOfLines

    Parameters

    TBool aGrowingAsYouType


    TextLength()

    IMPORT_C TInt TextLength() const;

    Description

    Gets the number of characters in the document.

    Return value

    TInt

    " TInt " The number of characters in the document.


    CursorPos()

    IMPORT_C TInt CursorPos() const;

    Description

    Gets the cursors position within the document.

    Return value

    TInt

    " TInt " The cursors position within the document.


    SelectionLength()

    IMPORT_C TInt SelectionLength() const;

    Description

    Gets the number of characters including non-printing characters within the selection.

    Return value

    TInt

    " TInt " The number of characters within the selection


    Selection()

    IMPORT_C TCursorSelection Selection() const;

    Description

    Gets the cursor selection.

    If no text view is associated to the Edwin this returns TCursorSelection(0,0) .

    Return value

    TCursorSelection

    " TCursorSelection " The current selection.


    ClearSelectionL()

    IMPORT_C void ClearSelectionL();

    Description

    Removes the selection and any composition text.

    The cursor position is unaffected. If there is no selected region, this function has no effect.


    SetSelectionL()

    IMPORT_C void SetSelectionL(TInt aCursorPos, TInt aAnchorPos);

    Description

    Sets the text selection.

    Highlights the selected area and makes the new cursor position visible. Any previous selection is cancelled. This function also updates the scroll bar thumbs if present.

    Parameters

    TInt aCursorPos

    TInt aAnchorPos


    SetCursorPosL()

    IMPORT_C void SetCursorPosL(TInt aCursorPos, TBool aSelect);

    Description

    Sets the cursors position within the document.

    If the new position is not visible the text is scrolled so that the line containing the cursor is visible. This function also updates the scroll bar thumbs if present.

    Parameters

    TInt aCursorPos

    TBool aSelect


    SelectAllL()

    IMPORT_C void SelectAllL();

    Description

    Selects the entire document.


    CalculateWidth()

    Interface status: deprecated

    IMPORT_C void CalculateWidth(TInt aWidthInChars);

    Description

    Recalculates and sets the screen width of an Edwin from the specified number of character widths.

    Note that calling this method will change the width of the control. If the Edwin only allows editing of numbers, the width of the zero character (0 ) is used; otherwise CFont::MaxNormalCharWidthInPixels() is used. If the EWidthInPixels flag has been set, the aWidthInChars argument is measured in pixels, not characters.

    This method has been deprecated. Do not use.

    Parameters

    TInt aWidthInChars


    SetPreferredWidthInChars()

    IMPORT_C void SetPreferredWidthInChars(TInt aWidthInChars);

    Description

    Sets the preferred width of the control based on mean character width of the font used.

    If the Edwin only allows editing of numbers, the width of the zero character (0 ) is used; otherwise CFont::MaxNormalCharWidthInPixels() is used.

    Parameters

    TInt aWidthInChars


    GetText()

    IMPORT_C void GetText(TDes &aDes) const;

    Description

    Copies the entire documents content into a descriptor.

    It is the caller's responsibility to provide a large enough buffer.

    Parameters

    TDes &aDes


    GetTextInHBufL()

    IMPORT_C HBufC *GetTextInHBufL() const;

    Description

    Gets a new buffer containing a copy of the whole text document.

    Return value

    HBufC *

    " HBufC* " A new copy of the document text.


    SetTextL()

    IMPORT_C void SetTextL(const TDesC *aDes);

    Description

    Sets the document text of this Edwin from the contents of a descriptor.

    This function removes any pictures, any invalid characters and cancels any previous selection.

    Parameters

    const TDesC *aDes

    Panic codes

    EEikPanicEdwinTextLongerThanLimit

    DEBUG_BUILDS: The descriptor is longer than the textlimit of the edwin. RELEASE_BUILDS: Does not panic but will truncate the string to the textlimit length.


    ClipboardL()

    IMPORT_C void ClipboardL(TClipboardFunc aClipboardFunc);

    Description

    Handles cut, copy and paste commands.

    This function also reports a change of state of the control to the observer when necessary.

    Parameters

    TClipboardFunc aClipboardFunc


    InsertFieldL()

    IMPORT_C void InsertFieldL(CTextField *aField, TUid aFieldType);

    Description

    Inserts a field at the current cursor position.

    If a selection was made the field replaces that selection.

    Parameters

    CTextField *aField

    TUid aFieldType


    UpdateAllFieldsL()

    IMPORT_C void UpdateAllFieldsL();

    Description

    Updates all the fields in the document.


    UpdateCurrentFieldL()

    IMPORT_C void UpdateCurrentFieldL();

    Description

    Updates any text field at the current cursor position.

    Updating involves calculating the new value for the field, and replacing the fields existing text content with the new text.This function does nothing if the cursor is not within a text field.


    CountWords()

    IMPORT_C TInt CountWords();

    Description

    Counts and returns the number of words in the document.

    Retur