1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-31A28040-6C8E-5C65-A697-04B30B441686-GENID-1-8-1-3-1-1-9-1-4-1-11-1" xml:lang="en"><title>FEP |
|
13 References</title><shortdesc>This topic introduces miscellaneous guidelines to write a FEP.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section id="GUID-7881D352-F261-4064-8684-6CA76A184257-GENID-1-8-1-3-1-1-9-1-4-1-11-1-3-1"><title> Handling the |
|
15 start of a transaction</title><p>Although applications do not need to be FEP-aware |
|
16 in order to work with FEPs, a situation can occur in some applications in |
|
17 which the user interface can be improved by the application making use of |
|
18 a FEPBASE API to communicate with the FEP above it, if there is one. </p> <p>If |
|
19 no FEP is present, the expected behaviour in some UIs when the user presses |
|
20 a key is for the application to do two things: firstly, it moves focus to |
|
21 a previously non-focused text editor control (possibly, although not necessarily, |
|
22 by launching a dialog), and secondly, it 'seeds' that text editor control |
|
23 with the character associated with that key. If there is a FEP, by default |
|
24 (in other words, without the application being FEP-aware) the focus change |
|
25 would only happen when the FEP outputs text to the application. However, if |
|
26 the FEP is designed to allow the user to compose a fairly large block of text |
|
27 to send to the application (as would be likely in a Japanese FEP), it would |
|
28 be better if the focus change occurred when the user starts composing their |
|
29 text in the FEP. In order for this to happen, the application needs to be |
|
30 FEP-aware, albeit in a fairly trivial way. The way the FEP notifies the application |
|
31 that it is starting a transaction is by calling <codeph>CCoeEnv</codeph> ’s |
|
32 member function <codeph>ForEachFepObserverCall()</codeph> (<codeph>CCoeEnv</codeph> is |
|
33 defined in <filepath>epoc32\include\COEMAIN.H</filepath>), passing in the |
|
34 address of the non-member function <codeph>FepObserverHandleStartOfTransactionL()</codeph> (defined |
|
35 in <filepath>epoc32\include\FEPBASE.H</filepath>). It is important to note |
|
36 that this function should only be called as the last C++ statement executed |
|
37 when handling an event. The reason for this that it may take a considerable |
|
38 amount of time to return (for example, it may launch a dialog and only return |
|
39 when the dialog has been exited). </p> </section> |
|
40 <section id="GUID-C32902E0-39A8-493E-9E7F-D48DEE4717CA-GENID-1-8-1-3-1-1-9-1-4-1-11-1-3-2"><title>Text cursors</title><p>If |
|
41 a non-inline-editing FEP has a composition window into which the user types, |
|
42 that window should not use a 'real' text cursor (in other words, a cursor |
|
43 which is set and unset using <codeph>RWindowGroup</codeph> ’s <codeph>SetTextCursor()</codeph> and <codeph>CancelTextCursor()</codeph> member |
|
44 functions). The reason is that the window server only allows a single text |
|
45 cursor for the whole system at any one time. If the FEP’s target control is |
|
46 a text editor, it should use the window server’s text cursor itself, so the |
|
47 FEP should not use it. To solve this problem, the text cursor in the FEP’s |
|
48 composition window can be simulated with a sprite. The class <codeph>CTstInsertionPoint</codeph> in |
|
49 TFEP1 provides an example of this. </p></section> |
|
50 <section id="GUID-5F7D9BFA-F74A-47FE-B589-A4EF49AFB901-GENID-1-8-1-3-1-1-9-1-4-1-11-1-3-3"><title>Shortcut keys</title><p>As |
|
51 FEPs get first refusal of all key events, there is a risk that FEPs can intercept |
|
52 shortcut keys (if the UI supports them) which are intended for the application |
|
53 to handle. To define a convention for FEP shortcut keys is non-trivial as |
|
54 different UIs use different modifier keys and have different policies on using |
|
55 them. Matters are simplified greatly if a product has a dedicated on/off key |
|
56 for FEPs as this may be used in combination with other keys to carry out different |
|
57 functions, as well as on its own to turn the FEP on and off. FEP authors should |
|
58 consult the documentation for their target UI. </p></section> |
|
59 </conbody></concept> |
|