Symbian3/SDK/Source/GUID-DAC32BB9-C0EB-42FF-A596-C2F1A90A4BD7.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?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-79751C55-C0D9-4511-9147-8E6CB95AA610"><title>Controller-view hierarchy in traditional and Symbian architectures</title><image href="GUID-46040A24-92C3-4B0B-88CC-BDD8DDA8F27C_d0e41397_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="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita"><apiname>CCoeControl</apiname></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="GUID-11967EBB-7439-3775-B287-7560ECA0AF1F.dita"><apiname>CAknView</apiname></xref>,
which is derived directly from <xref href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.dita"><apiname>CBase</apiname></xref> and not from <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita"><apiname>CCoeControl</apiname></xref>.
This means the <xref href="GUID-11967EBB-7439-3775-B287-7560ECA0AF1F.dita"><apiname>CAknView</apiname></xref>-derived views are not controls. <xref href="GUID-11967EBB-7439-3775-B287-7560ECA0AF1F.dita"><apiname>CAknView</apiname></xref>-derived
views need to contain <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita"><apiname>CCoeControl</apiname></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>