PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFXEditProperty
Class to edit the property of the native BREW text input control.
#include <SFXEditProperty.h.hpp>
class SFXEditProperty;
<link linkend="sec.macro.core.typedef.SFMTYPEDEFCLASS">SFMTYPEDEFCLASS</link>(SFXEditProperty)

Collaboration diagram

 Collaboration diagram of SFXEditPropertyClass

Description

SFXEditProperty is the class to edit the property of the native BREW text input control (i.e., BREW API ITextCtl and BREW API IMenuCtl).

SFZSingleEditLabelControl, SFZSingleEditBoxControl, SFZMultipleEditLabelControl, or SFZMultipleEditBoxControl uses this class in SFYSingleEditWidget or SFYMultipleEditWidget which is its child resopnder.

In SophiaFramework UNIVERSE, processing of the text input control of the standard BREW is encapsulated into the SFXBaseEditor, SFXEditor, and SFXEditProperty classes. It is enough that the same one kind of code has only to be programmed regardless of BREW SDK version, simulator, and device.

Reference

SFXEditor | SFZSingleEditLabelControl | SFZSingleEditBoxControl | SFYSingleEditWidget | SFZMultipleEditLabelControl | SFZMultipleEditBoxControl | SFYMultipleEditWidget | BREW API ITextCtl | BREW API IMenuCtl | BREW API AEETextInputMode

Member

Constructor/Destructor
SFXEditProperty( Void )
Constructor of the SFXEditProperty class.
~SFXEditProperty( Void )
Destructor of the SFXEditProperty class.
Public Functions
AEETextInputMode GetInputMode( Void )
Get the input mode of the text input control of the standard BREW.
UInt16 GetMaximumLength( Void )
Get the maximum text size supported by the text input control of the standard BREW.
Bool GetPasswordMode( Void )
Get the password mode of the text input control of the standard BREW.
SFXWideStringConstRef GetText( Void )
Get the string set in the text input control of the standard BREW.
Void SetInputMode( AEETextInputMode param )
Set the input mode of the text input control of the standard BREW.
SFCError SetMaximumLength( UInt16 param )
Set the maximum text size supported by the text input control of the standard BREW.
Void SetPasswordMode( Bool param )
Set the password mode of the text input control of the standard BREW.
SFCError SetText( SFXWideStringConstRef param )
Set the specified string into the text input control of the standard BREW.

SFXEditProperty::SFXEditProperty
Constructor of the SFXEditProperty class.
[ public, explicit ]
SFXEditProperty(Void);

Description

This constructor performs the initializations as follows:

  1. Set the maximum text size supported by the text input control to "SINT16_MAXIMUM - 1".
  2. Set the input mode of the text input control to AEE_TM_CURRENT.
  3. Set the password mode of the text input control to "false".

Reference

SFXEditProperty::SetMaximumLength | SFXEditProperty::SetInputMode | SFXEditProperty::SetPasswordMode | SFXEditProperty::SetText


SFXEditProperty::~SFXEditProperty
Destructor of the SFXEditProperty class.
[ public ]
~SFXEditor(Void);

SFXEditProperty::GetInputMode
Get the input mode of the text input control of the standard BREW.
[ public, const ]
AEETextInputMode GetInputMode(Void);

Return value

Input mode of native BREW text input control

Description

This function gets the input mode of the text input control of the standard BREW set with the SFXEditProperty::SetInputMode function. For more details, see ITEXTCTL_GetInputMode() and AEETextInputMode of the BREW reference.

Reference

SFXEditProperty::SetInputMode | BREW API ITEXTCTL_GetInputMode | BREW API AEETextInputMode


SFXEditProperty::GetMaximumLength
Get the maximum text size supported by the text input control of the standard BREW.
[ public, const ]
UInt16 GetMaximumLength(Void);

Return value

Maximum text size supported by the native BREW text input control

Description

This function gets the maximum text size supported by the text input control of the standard BREW set with the SFXEditProperty::SetMaximumLength function. For more details, see ITEXTCTL_SetMaxSize() of the BREW reference.

Reference

SFXEditProperty::SetMaximumLength | BREW API ITEXTCTL_SetMaxSize


SFXEditProperty::GetPasswordMode
Get the password mode of the text input control of the standard BREW.
[ public, const ]
Bool GetPasswordMode(Void);

Return value

  • If the password mode is active: true
  • Otherwise: false

Description

This function gets the password mode of the text input control of the standard BREW set with the SFXEditProperty::SetPasswordMode function. For more details, see ITEXTCTL_SetProperties() and AEE ITextCtl's Properties of the BREW reference.

Reference

SFXEditProperty::SetPasswordMode | BREW API ITEXTCTL_SetProperties | BREW API AEE ITextCtl's Properties


SFXEditProperty::GetText
Get the string set in the text input control of the standard BREW.
[ public, const ]
SFXWideStringConstRef GetText(Void);

Return value

String set in the text input control of the standard BREW

Description

For more details, see ITEXTCTL_GetText() of the BREW reference.

Reference

SFXEditProperty::SetText | BREW API ITEXTCTL_GetText


SFXEditProperty::SetInputMode
Set the input mode of the text input control of the standard BREW.
[ public ]
Void SetInputMode(
    AEETextInputMode param   // input mode
);

Description

This function sets the input mode of the text input control of the standard BREW. For more details, see ITEXTCTL_SetInputMode() and AEETextInputMode of the BREW reference.

Default: AEE_TM_CURRENT(currently active input mode)

Example

The below is the usage example in the implementation of the SFYSingleEditWidget::SetInputMode function.

class SFYSingleEditWidget : public SFYWidget {
    private:

        ...

 SFXEditProperty  _property;

        ...

};


/*public */Void SFYSingleEditWidget::SetInputMode(AEETextInputMode param)
{
    if (param != _property.GetInputMode()) {

        _property.SetInputMode(param);
        Invalidate();
    }

    return;
}// SFYSingleEditWidget::SetInputMode //

Reference

SFXEditProperty::GetInputMode | BREW API ITEXTCTL_SetInputMode | BREW API AEETextInputMode


SFXEditProperty::SetMaximumLength
Set the maximum text size supported by the text input control of the standard BREW.
[ public ]
SFCError SetMaximumLength(
    UInt16 param   // maximum text size to be specified
);

Description

This function sets the maximum text size supported by the text input control of the standard BREW. For more details, see ITEXTCTL_SetMaxSize() of the BREW reference.

Default: SINT16_MAXIMUM - 1

Example

The below is the usage example in the implementation of the SFYSingleEditWidget::Edit function.

class SFYSingleEditWidget : public SFYWidget {
    private:

        ...

 SFXBaseEditorPtr _editor;
 SFXEditProperty  _property;

        ...

};

// function which transfer to text input control
/*public */SFCError SFYSingleEditWidget::Edit(Void)
{
    SFCError  error(SFERR_NO_ERROR);

    // set maximum length of text to text input control
    if ((error = _property.SetMaximumLength(_maximum)) == SFERR_NO_ERROR) {

        // set initial text to text input control
        if ((error = _property.SetText(_text)) == SFERR_NO_ERROR) {

            // boot up text input control(ITextCtl included in standard BREW)
            // OnEditor is callback function that will be called immediately after text input control finishes
            error = _editor->Open(XALLBACK_INTERNAL(OnEditor));
        }
    }

    return error;
}// SFYSingleEditWidget::Edit //

Reference

SFXEditProperty::GetMaximumLength | SFXEditProperty::SetText | BREW API ITEXTCTL_SetMaxSize


SFXEditProperty::SetPasswordMode
Set the password mode of the text input control of the standard BREW.
[ public ]
Void SetPasswordMode(
    Bool param   // password mode(true if the input string should be dispalyed as "***", otherwise false)
);

Description

If the argument is "true", the property value of the text input control of the standard BREW will be set with TP_PASSWORD. In this setting, all the input characters are displayed with the "*" character. The actual string is correctly managed in the BREW buffer. For more details, see ITEXTCTL_SetProperties() and AEE ITextCtl's Properties of the BREW reference.

Default: false

Example

The below is the usage example in the implementation of the SFYSingleEditWidget::SetPasswordMode function.

class SFYSingleEditWidget : public SFYWidget {
    private:

        ...

 SFXEditProperty  _property;

        ...

};

/*public */SFCError SFYSingleEditWidget::SetPasswordMode(Bool param)
{
    SFCError  error(SFERR_NO_ERROR);

    if (param != _property.GetPasswordMode()) {

        if ((error = SetWidgetText(_text, param)) == SFERR_NO_ERROR) {

            _property.SetPasswordMode(param);
            Invalidate();
        }
    }

    return error;
}// SFYSingleEditWidget::SetPasswordMode //

Reference

SFXEditProperty::GetPasswordMode | BREW API ITEXTCTL_SetProperties | BREW API AEE ITextCtl Properties


SFXEditProperty::SetText
Set the specified string into the text input control of the standard BREW.
[ public ]
SFCError SetText(
    SFXWideStringConstRef param   // string
);

Description

This function sets the specified string, whose length is upto the number set with the SFXEditProperty::SetMaximumLength function, into the text input control of the standard BREW. For more details, see ITEXTCTL_SetText() of the BREW reference.

Example

class SFYSingleEditWidget : public SFYWidget {
    private:

        ...

 SFXBaseEditorPtr _editor;
 SFXEditProperty  _property;

        ...

};

// function which transfer to text input control
/*public */SFCError SFYSingleEditWidget::Edit(Void)
{
    SFCError  error(SFERR_NO_ERROR);

    // set maximum length of text to text input control
    if ((error = _property.SetMaximumLength(_maximum)) == SFERR_NO_ERROR) {

        // set initial text to text input control
        if ((error = _property.SetText(_text)) == SFERR_NO_ERROR) {

            // boot up text input control(ITextCtl included in standard BREW)
            // OnEditor is callback function that will be called immediately after text input control finishes
            error = _editor->Open(XALLBACK_INTERNAL(OnEditor));
        }
    }

    return error;
}// SFYSingleEditWidget::Edit //

Reference

SFXEditProperty::GetText | SFXEditProperty::SetMaximumLength | BREW API ITEXTCTL_SetText