Symbian3/SDK/Source/GUID-DAC32BB9-C0EB-42FF-A596-C2F1A90A4BD7.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-DAC32BB9-C0EB-42FF-A596-C2F1A90A4BD7" xml:lang="en"><title>Views</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>The term <i>view</i> refers to the <xref href="GUID-BDDDF68F-F7C3-43AF-8B6C-C77C701FD2A9.dita">MVC
design</xref> (Model-View-Controller) component that has the following attributes:</p>
<ul>
<li><p>displays the application state known by the application</p>
</li>
<li><p>receives user input</p></li>
<li><p>is owned by the <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI
controller</xref></p></li>
<li><p>observes application state changes either directly or through
the UI controller and updates the screen accordingly</p></li>
</ul>
<p>In practice, views are collections of interface elements, such as controls,
menus, command button areas (CBAs), key events, that make up one top-level
window in an application. Applications may have one or more views. If an application
has more than one view and if the status pane behavior is organized in this
manner, then each view in an application can have its own tab. Applications
can have only a single view active at any one time. The current view is the
view that interacts with the user, receiving events and menu choices as if
it were the only set of UI elements.</p>
<p>Multiple view architectures are widely used in application development
on the Symbian platform. Multiple view architectures:</p>
<ul>
<li><p>provide developers with an efficient way to build multiple
views within an application and switch between them easily and simply. </p>
</li>
<li><p>allow applications to bundle their user interface requirements
into a single element (a view). The view architecture then provides the capability
to switch quickly between the views.</p></li>
<li><p>allow applications to take advantage of object orientation
to encapsulate code, keeping it simple and clear. </p></li>
<li><p>provide the ability for one application to activate the view
of another. This is particularly useful when you want to use an existing display
or editing capability without going to the expense of integrating a component
into your application. </p></li>
<li><p>allow applications to register views, with one view being
active in each running application at any one time. It does not dictate what
a view is; however, it does provide support for a view being a display page
on the screen</p></li>
</ul>
<fig id="GUID-DD277261-3BF3-4F60-87BC-3ABC709C1E09"><title>Controller-view hierarchy in traditional and Symbian architectures</title><image href="GUID-5F5F9DF5-E08E-47F9-B35C-E07180524864_d0e43117_href.png"/></fig>
<p>In practice, the view concept varies depending upon your chosen architecture
approach: </p>
<section id="GUID-53125010-FFC7-422E-9EE5-A42427031F10"><title>Traditional architecture
views</title>
<p>In a traditional architecture, the view is derived from <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Control_Environment/CCoeControlClass.html" format="application/java-archive"><parmname>CCoeControl</parmname></xref>, which typically constructs a top-level
window-owning control that draws itself and contains other controls.</p>
<p>For more information on views in tradition architecture approaches,
see <xref href="GUID-B5DE1C86-2B16-4B22-887F-7079E54A8ED6.dita">Traditional
Symbian UI application architecture</xref>.</p>
</section>
<section id="GUID-B473202D-9682-4EBA-83F2-8391DB2B56D9"><title>Symbian architecture
views</title>
<p>In Symbian view architecture, a view controller is added between the <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI controller</xref> and
the view that draws itself and contains other controls. For example, view
controllers can be used to specify CBAs that are specific to specific views.</p>
<p>In a Symbian architecture, the view controller is derived from <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknView.html" format="application/java-archive"><parmname>CAknView</parmname></xref>,
which is derived directly from <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Kernel_Architecture_2/CBaseClass.html#%3a%3aCBase" format="application/java-archive"><parmname>CBase</parmname></xref> and
not from <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Control_Environment/CCoeControlClass.html" format="application/java-archive"><parmname>CCoeControl</parmname></xref>. This means the <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknView.html" format="application/java-archive"><parmname>CAknView</parmname></xref>-derived
views are not controls. <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknView.html" format="application/java-archive"><parmname>CAknView</parmname></xref>-derived
views need to contain <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Control_Environment/CCoeControlClass.html" format="application/java-archive"><parmname>CCoeControl</parmname></xref>-derived
classes to provide visual representation on the display.</p>
<p>For more information on views in Symbian architecture approaches,
see <xref href="GUID-68B999C2-0993-4804-9624-42C3D88BE5C7.dita">View
architecture</xref>.</p>
</section>
<section id="GUID-C9AA9483-424E-4626-8335-5F70FE246E1D"><title>Dialog architecture
views</title>
<p>In dialog architectures, views are implemented in modeless dialog boxes.
Multiple views can be constructed using nested dialogs or a tabbed dialog
pane.</p>
<p>For more information on views in dialog architecture approaches, see <xref href="GUID-DD88DD7B-E246-4BF2-B537-5C677728CC49.dita">Dialog
architecture</xref>.</p>
</section>
</conbody></concept>