|
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-37E8A48E-09B8-5958-9263-B33EDAE3F7C6" xml:lang="en"><title>UI |
|
13 Control Framework Overview</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section id="GUID-4DB4AA3B-1CC9-4829-9146-B07BBDDEBAC5"><title>Architectural relationships</title> <p>The control framework |
|
15 provides an abstract middle layer between the low-level windowing functionality, |
|
16 provided by the Window Server, and concrete user interface classes provided |
|
17 by Uikon and UI variant-specific libraries. </p> <p>Application developers |
|
18 use the API directly to create their own controls and indirectly through derived |
|
19 classes provided by Uikon and UI variant libraries. </p> <fig id="GUID-DD81BA7E-07D0-53C7-9B42-7BE263CC82D3"> |
|
20 <title> Cone architectural relationships </title> |
|
21 <image href="GUID-63BB9C30-9103-5900-9FD7-5B45FD78A5D7_d0e11541_href.png" placement="inline"/> |
|
22 </fig> </section> |
|
23 <section id="GUID-9A9F72A2-0CA0-488A-91DE-35FD0A88B6CD"><title>Description</title> <p><b>Controls</b> </p> <p>A control is |
|
24 a rectangular area of a window that may respond to user input. Controls have |
|
25 a number of properties that determine their behaviour and their relationships |
|
26 to other controls and windows. </p> <p>A control is represented by the class <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita"><apiname>CCoeControl</apiname></xref>. </p> <p>A <b>simple |
|
27 control</b> is one which contains no other controls. </p> <p>A <b>container |
|
28 control</b> is one which contains one or more controls. A container control |
|
29 is also referred to as a <b>compound control</b>. The contained controls may |
|
30 themselves be container controls. When a control is contained in a container |
|
31 control it is called a <b>component control</b>. A component control is always |
|
32 redrawn when its container control is redrawn. </p> <p>The following diagram |
|
33 shows simple controls in orange and container controls in grey. </p> <fig id="GUID-771A429A-B61E-5C45-83A9-4B9F76C40FB9"> |
|
34 <title> Simple and compound controls </title> |
|
35 <image href="GUID-8B37A2C7-B4DB-5826-B6C2-3C21012EF9EA_d0e11590_href.png" placement="inline"/> |
|
36 </fig> <p><b>Controls and Windows </b> </p> <p>A window may be considered |
|
37 as a transparent layer. Windows are managed by the Window Server and described <xref href="GUID-0C4B86B5-530A-5839-86C1-46E7ABE281E0.dita">elsewhere</xref>. A control |
|
38 provides a means of access to a window - it can be drawn onto the window and |
|
39 can receive input. </p> <p>Each window has a one-to-one relationship with |
|
40 a single control that covers it precisely. This control is referred to as |
|
41 a <b>window-owning control</b>. A window-owning control shares the behavior |
|
42 of its window, in particular the parent-child window relationships which govern |
|
43 the window's position and overlapping behavior. </p> <p>A <b>non-window-owning |
|
44 control</b> typically covers only part of a window. It cannot be moved around |
|
45 on the screen independently of its window, cannot draw outside its window |
|
46 and is always a component control. </p> <p>You might think of a window-owning |
|
47 control as a piece of glass and a non-window-owning control as a sticker on |
|
48 a window-owning control. </p> <p><b>Application User Interface (AppUi) framework</b> </p> <p>The |
|
49 application user interface framework provides support for the distribution |
|
50 of key events to an application's controls. It maintains a control stack to |
|
51 which an application must add all the top-level container controls that it |
|
52 wishes to handle key events, setting a priority for each. When a key event |
|
53 occurs, the framework offers it to each control on the stack in priority order |
|
54 until it is consumed. </p> <p>The application user interface framework is |
|
55 provided by the base class <xref href="GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90.dita"><apiname>CCoeAppUi</apiname></xref>. Uikon and UI variants |
|
56 specialise CCoeAppUi further. Applications derive from the variant AppUi. </p> <p> <xref href="GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90.dita"><apiname>CCoeAppUi</apiname></xref> provides |
|
57 a simplified interface to the <xref href="GUID-830E40D0-7DEE-5EFB-BCC6-EC0AA7FF7A02.dita">View |
|
58 Server</xref> which enables seamless switching between different views across |
|
59 various applications. </p> <p><b>Control Environment (CoeEnv)</b> </p> <p>The |
|
60 Control Environment simplifies the interface to the Window Server and provides |
|
61 an environment for creating controls. It is a single instance (a singleton) |
|
62 of the class <xref href="GUID-12A9389D-363B-3F54-857F-89EE0EDCDF40.dita"><apiname>CCoeEnv</apiname></xref> which encapsulates an active scheduler |
|
63 and active objects for communicating with the window server. <xref href="GUID-12A9389D-363B-3F54-857F-89EE0EDCDF40.dita"><apiname>CCoeEnv</apiname></xref> is |
|
64 created automatically by the framework and a pointer stored in Thread Local |
|
65 Storage (TLS). It is available through <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita#GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160/GUID-BB8AF6C8-F7C8-3478-858A-4E2C68DF1B7A"><apiname>CCoeControl::CoeEnv()</apiname></xref>, <xref href="GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90.dita#GUID-3AC2CDAC-0291-309F-A020-049BC9F2CF90/GUID-6D8B3C54-087B-36C6-81A4-E07E92AA9D72"><apiname>CCoeAppUi::CoeEnv()</apiname></xref> and |
|
66 through its own static function, <xref href="GUID-12A9389D-363B-3F54-857F-89EE0EDCDF40.dita#GUID-12A9389D-363B-3F54-857F-89EE0EDCDF40/GUID-7A9CB8EE-520A-30E2-BA54-5BEFBB56717F"><apiname>CCoeEnv::Static()</apiname></xref>, which |
|
67 is less efficient. </p> <p>The control environment also provides simplified |
|
68 access to drawing functions, fonts, and resource files which are used by most |
|
69 applications. </p> </section> |
|
70 <section id="GUID-060D338D-BADE-46A6-B7B1-DB28F07B39D3"><title>See also</title> <p><xref href="GUID-1C802DBD-1453-5C69-94D5-FB0229C544D6.dita">Uikon |
|
71 Overview</xref> </p> <p><xref href="GUID-830E40D0-7DEE-5EFB-BCC6-EC0AA7FF7A02.dita">View |
|
72 Server Overview</xref> </p> <p><xref href="GUID-0C4B86B5-530A-5839-86C1-46E7ABE281E0.dita">Window |
|
73 Server</xref> </p> <p><xref href="GUID-EEAB5A2F-AD1F-57B9-98AA-20DEEA23C3C2.dita">Asynchronous |
|
74 Programming (active scheduler & active objects)</xref> </p> </section> |
|
75 </conbody></concept> |