UIQ Technology
Symbian OS Library

UIQ 3.1 SDK        UIQ developer portal

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



Location: TextInputServerClient.h
Link against: tisrvc.lib

Class RTextInputServerClient

class RTextInputServerClient : public RSessionBase;

Description

RTextInputServerClient is the client interface to the Text Input server.

UIQ supports two types of input methods: write-anywhere handwriting recognition and in-a-box methods. In-a-box methods, such as the virtual keyboard, are displayed in a box at the bottom of the screen. Additional text input modules may be used in place of the built-in software.

This class is used to turn text input on and off, to load and unload additional text input modules and to reset the text input methods to the default values.

The TextInputServer is an anchoring point for the write-anywhere AnimationDLL , and handles switching between the write-anywhere FEP and the InABox FEP.

Note that this class should only be used for developing a text input engine, for example for handwriting recognition. It is not intended to be used by application developers to set the text input methods for an application. This is normally done by setting the text input capabilities of the application's controls using the class TCoeInputCapabilities .

Derivation

Members

Defined in RTextInputServerClient:
AddSlaveSpriteAnim(), Close(), Connect(), GetInABoxModule(), GetTextInputConfig(), GetWriteAnywhereModule(), LoadNewAnimDll(), PassOnWriteAnywhereParameters(), PassOnWriteAnywhereParametersReply(), RTextInputServerClient(), SetFactorySettingsForTextInputConfig(), SetInABoxModule(), SetTextInputConfig(), SetTextInputObserver(), SetWriteAnywhereModule(), StartNotificationL(), StatusOfInABoxTi(), StatusOfWriteAnywhereTi(), StopNotification(), Version()

Inherited from RHandleBase:
Attributes(), Duplicate(), FullName(), Handle(), HandleInfo(), Name(), SetHandle(), SetHandleNC(), iHandle

Inherited from RSessionBase:
CreateSession(), EAutoAttach, EExplicitAttach, Open(), Send(), SendReceive(), SetReturnedHandle(), ShareAuto(), ShareProtected(), TAttachMode


Construction and destruction


RTextInputServerClient()

IMPORT_C RTextInputServerClient();

Description

RTextInputServerClient() is the default constructor.

[Top]


Member functions


Connect()

IMPORT_C TInt Connect();

Description

Connect() connects the client to the Text Input server.

The Client will attach itself automatically to any open session that is held by the process. To end the session with the server, call Close() before destruction.

NOTE: This function must be called after construction and before any other member function is called.

Return value

TInt

an errorcode. KErrNone if successful, otherwise another of the system-wide error codes.


Close()

IMPORT_C void Close();

Description

Close() ends the session with the Text Input server.

To start a session with the server, call Connect() .


Version()

IMPORT_C TVersion Version() const;

Description

Version() returns the version number of the Text Input server.

The version number is necessary for the client to connect to the server. This is mainly used when opening the connection.

Return value

TVersion

Version specification numbers.


SetWriteAnywhereModule()

Interface status: deprecated

IMPORT_C TInt SetWriteAnywhereModule(const TDesC &aFepModuleName) const;

Description

This method has been deprecated. Use RTextInputServerClient::SetTextInputConfig() instead.

Changes the write-anywhere text input FEP. Replacing one HWR-system with another one is thus possible. This function is mainly used by the TextInput Control Panel Item.

The new FEP is installed, but not if the in-a-box FEP is currently active.

Parameters

const TDesC &aFepModuleName

The full path and filename of the new write-anywhere text input FEP. If an empty descriptor is specified, this sets no write-anywhere FEP.

Return value

TInt

AnErrorcode. KErrNone if successful

See also:


GetWriteAnywhereModule()

Interface status: deprecated

IMPORT_C TInt GetWriteAnywhereModule(TFileName &aFepModuleName) const;

Description

This method has been deprecated. Use RTextInputServerClient::GetTextInputConfig() instead.

GetWriteAnywhereModule() gets the name of the currently installed write-anywhere text input FEP.

Parameters

TFileName &aFepModuleName

On return, contains the full path and filename of the currently installed write-anywhere text input FEP.

Return value

TInt

AnErrorcode. KErrNone if successful.

See also:


SetInABoxModule()

Interface status: deprecated

IMPORT_C TInt SetInABoxModule(const TDesC &aFepModuleName) const;

Description

This method has been deprecated. Use RTextInputServerClient::SetTextInputConfig() instead.

SetInABoxModule() is mainly used by the TextInput Control Panel Item. It changes the in-a-box text input FEP. The new FEP is installed, but not if the write-anywhere FEP is currently active.

Parameters

const TDesC &aFepModuleName

The FEP that replaces the InABox ti method. @ KNullDesC is allowed to install nothing as an InABox Ti method, but this is not recommended. The FepName should be specified with the full path.

Return value

TInt

AnErrorcode. KErrNone if successful.

See also:


GetInABoxModule()

Interface status: deprecated

IMPORT_C TInt GetInABoxModule(TFileName &aFepModuleName) const;

Description

This method has been deprecated. Use RTextInputServerClient::GetTextInputConfig() instead.

GetInABoxModule() returns the name of the currently installed in-a-box text-input method.

Parameters

TFileName &aFepModuleName

On return, contains the filename of the currently installed InABox Ti method

Return value

TInt

AnErrorcode. KErrNone if successful.

See also:


SetTextInputConfig()

IMPORT_C TInt SetTextInputConfig(const TTextInputConfig &aTextInputConfig) const;

Description

SetTextInputConfig() allows switching the primary and secondary text-input module for a specified UI configuration. This function is mainly used by the TextInput Control Panel Item.

This method is used instead of SetInABoxModule() and SetWriteAnywhereModule() which are deprecated.

Parameters

const TTextInputConfig &aTextInputConfig

Contains a UI configuration ID and the associated primary and secondary Ti modules to use for this configuration. KNullDesC is allowed to install nothing as Ti method, but this is not recommended. The Ti modules should be specified with their full path. If UI configuration is 0, the default primary and secondary Ti module is set.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


GetTextInputConfig()

IMPORT_C TInt GetTextInputConfig(TTextInputConfig &aTextInputConfig) const;

Description

GetTextInputConfig() returns the names of the primary and secondary text-input module used for a specified UI configuration. This function is mainly used by the TextInput Control Panel Item.

This method is used instead of GetInABoxModule() and GetWriteAnywhereModule() which are deprecated.

Parameters

TTextInputConfig &aTextInputConfig

Contains a UI configuration ID and the associated primary and secondary Ti modules to use for this configuration. If UI configuration is 0, the default primary and secondary Ti module is returned.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


SetFactorySettingsForTextInputConfig()

IMPORT_C TInt SetFactorySettingsForTextInputConfig(const TInt aConfigId) const;

Description

SetFactorySettingsForTextInputConfig() resets the primary and secondary text-input module for a specified UI configuration to whatever is defined in the resource file of the TextInputServer.

This method is used instead of SetFactorySettingsForInABoxTi() and SetFactorySettingsForWriteAnywhereTi() which are deprecated.

Parameters

const TInt aConfigId

The UI configuration ID for the specified UI configuration.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


StatusOfInABoxTi()

IMPORT_C TInt StatusOfInABoxTi(TBool &aStatusActive) const;

Description

StatusOfInABoxTi() tests whether the in-a-box text input method is active or not. Being active does not necessarily mean that it is also visible.

Use OpenTextInputBox() and CloseTextInputBox() to activate and deactivate the in-a-box text input method.

Parameters

TBool &aStatusActive

Returns whether the in-a-box text input method is active (ETrue ) or not (EFalse ).

Return value

TInt

An Errorcode. KErrNone if successful.


StatusOfWriteAnywhereTi()

IMPORT_C TInt StatusOfWriteAnywhereTi(TBool &aStatusActive) const;

Description

StatusOfWriteAnywhereTi() tests whether write-anywhere handwriting recognition is active or not.

Parameters

TBool &aStatusActive

ETrue if write-anywhere handwriting recognition is active. EFalse if write-anywhere handwriting recognition is not active.

Return value

TInt

An Errorcode. KErrNone if successful, otherwise another of the system-wide error codes.


SetTextInputObserver()

IMPORT_C void SetTextInputObserver(MTextInputObserver *aTextInputObserver);

Description

SetTextInputObserver sets a Notification observer of the Text Input server.

When the client is observing the Text Input server, the observer's HandleTextInputNotification() function is called whenever any important changes occur in the server.

Many of the functions defined in RTextInputServerClient cause notification.

To start observation, StartNotificationL() must be called.

Parameters

MTextInputObserver *aTextInputObserver

The observer object.


StartNotificationL()

IMPORT_C TInt StartNotificationL();

Description

StartNotificationL() starts notification. This enables a client to observe the TextInput server and be informed of important changes.

Return value

TInt

AnErrorcode. KErrNone if successful, otherwise another of the system-wide error codes.


StopNotification()

IMPORT_C void StopNotification();

Description

StopNotification() is called when a client no longer wants to be informed of important changes in the TextInput server.


LoadNewAnimDll()

IMPORT_C TInt LoadNewAnimDll(const TDesC &aHandAnimDllPath, TBool aDrawingWithMask=ETrue) const;

Description

LoadNewAnimDll() loads a write-anywhere animation DLL into the window server.

The animation DLL does drawing and character recognition. The sprite which is drawn by the DLL covers the whole screen. It includes any "slave" sprites that are used.

LoadNewAnimDll() must be called by a write-anywhere FEP during construction. Before loading an animation DLL, any previously loaded animation DLL must first be unloaded (see UnloadActiveAnimDll() ).

"Slave" sprites may be added using AddSlaveSpriteAnim() .

Parameters

const TDesC &aHandAnimDllPath

The path and filename of the animation DLL to load into the window server.

TBool aDrawingWithMask

Sets the animation DLL to use (ETrue ) or not use (EFalse ) a mask. ETrue is the default value. A mask could be used by the animation DLL to draw the line with a border or in different colors.

Return value

TInt

An Errorcode. KErrNone if successful, otherwise another of the system-wide error codes. KErrBadDescriptor is returned if the path is longer than KMaxFileName . KErrAlreadyExists is returned if the same animation DLL is already loaded. This can be used to find out whether AddSlaveSpriteAnim() should be called.


AddSlaveSpriteAnim()

IMPORT_C TInt AddSlaveSpriteAnim(TGulAlignment aCorner, TSize aSize) const;

Description

Using one or more slave sprites, instead of using a single sprite that covers the whole screen all of the time, can significantly improve drawing performance. The smaller slave sprite should contain any static graphics always visible on the screen when handwriting recognition is active, while the large main sprite should only contain the "ink" that is produced when the user writes on the screen.

After the LoadNewAnimDll() method has been called to create the main animation sprite (that covers the whole screen and contains the handwriting recognition engine), AddSlaveSpriteAnim() can be called to create a smaller slave sprite. This allows the large main sprite to be disabled whenever the user is not writing on the screen (the sprite is empty anyway) so only the small slave sprite needs to be updated.

More than one slave sprite can be added by calling the AddSlaveSpriteAnim() method repeatedly. Since a new slave sprite is added each time the AddSlaveSpriteAnim() method is called, it must not be called if the LoadNewAnimDll() method returns KErrAlreadyExists .

Parameters

TGulAlignment aCorner

The vertical and horizontal alignment of the rectangle that contains the sprite.

TSize aSize

The width and height of the rectangle that contains the sprite.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


PassOnWriteAnywhereParameters()

IMPORT_C TInt PassOnWriteAnywhereParameters(TInt anOpCode, TAny *aParameters) const;

Description

Information specific for AnimDll can be sent to the AnimDll . This information can be of any kind (for example, paint color or timer settings). The AnimDll must specify the parameters that are used.

NOTE: Since the parameters are sent over a Client-Server boundary, pointers should not be passed. If pointers are passed, it must be clear that they have no meaning in any other memory space.

Parameters

TInt anOpCode

The Opcode that is sent to the AnimDll to identify the correct function. The Opcode must begin with a value larger or equal to EHwFirstAvailableOp (defined in TTextInputServerHwrOpCodes ).

TAny *aParameters

The parameters that are sent to the AnimDll. Even though a TAny is passed, a descriptor is expected. This is why packaging of the parameters is necessary. The AnimDll has to implement persistency of its parameters. This is not done by the Ti server.

Return value

TInt

An Errorcode. KErrNone if successful.

See also:


PassOnWriteAnywhereParametersReply()

IMPORT_C TInt PassOnWriteAnywhereParametersReply(TInt anOpCode, TAny *aParameters, TInt &aResponse) const;

Description

Information specific for AnimDll can be sent to the AnimDll . This information can be of any kind (for example, paint color or timer settings). The AnimDll must specify the parameters that are used.

NOTE: Since the parameters are sent over a Client-Server boundary, pointers should not be passed. If pointers are passed, it must be clear that they have no meaning in any other memory space. This function allows the AnimDll to give a response.

Parameters

TInt anOpCode

The Opcode that is sent to the AnimDll to identify the correct function. The Opcode must begin with a value larger or equal to EHwFirstAvailableOp (defined in TTextInputServerHwrOpCodes ).

TAny *aParameters

The parameters that are sent to the AnimDll . Even though a TAny is passed, a descriptor is expected. This is why packaging of the parameters is necessary. The AnimDll has to implement persistency of its parameters. This is not done by the Ti server.

TInt &aResponse

The response from the AnimDll .

Return value

TInt

An Errorcode. KErrNone if successful.

See also: