Symbian3/SDK/Source/GUID-DAC32BB9-C0EB-42FF-A596-C2F1A90A4BD7.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     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-DAC32BB9-C0EB-42FF-A596-C2F1A90A4BD7" xml:lang="en"><title>Views</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    13 <p>The term <i>view</i> refers to the <xref href="GUID-BDDDF68F-F7C3-43AF-8B6C-C77C701FD2A9.dita">MVC
       
    14 design</xref> (Model-View-Controller) component that has the following attributes:</p>
       
    15 <ul>
       
    16 <li><p>displays the application state known by the application</p>
       
    17 </li>
       
    18 <li><p>receives user input</p></li>
       
    19 <li><p>is owned by the <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">UI
       
    20 controller</xref></p></li>
       
    21 <li><p>observes application state changes either directly or through
       
    22 the UI controller and updates the screen accordingly</p></li>
       
    23 </ul>
       
    24 <p>In practice, views are collections of interface elements, such as controls,
       
    25 menus, command button areas (CBAs), key events, that make up one top-level
       
    26 window in an application. Applications may have one or more views. If an application
       
    27 has more than one view and if the status pane behavior is organized in this
       
    28 manner, then each view in an application can have its own tab. Applications
       
    29 can have only a single view active at any one time. The current view is the
       
    30 view that interacts with the user, receiving events and menu choices as if
       
    31 it were the only set of UI elements.</p>
       
    32 <p>Multiple view architectures are widely used in application development
       
    33 on the Symbian platform. Multiple view architectures:</p>
       
    34 <ul>
       
    35 <li><p>provide developers with an efficient way to build multiple
       
    36 views within an application and switch between them easily and simply. </p>
       
    37 </li>
       
    38 <li><p>allow applications to bundle their user interface requirements
       
    39 into a single element (a view). The view architecture then provides the capability
       
    40 to switch quickly between the views.</p></li>
       
    41 <li><p>allow applications to take advantage of object orientation
       
    42 to encapsulate code, keeping it simple and clear. </p></li>
       
    43 <li><p>provide the ability for one application to activate the view
       
    44 of another. This is particularly useful when you want to use an existing display
       
    45 or editing capability without going to the expense of integrating a component
       
    46 into your application. </p></li>
       
    47 <li><p>allow applications to register views, with one view being
       
    48 active in each running application at any one time. It does not dictate what
       
    49 a view is; however, it does provide support for a view being a display page
       
    50 on the screen</p></li>
       
    51 </ul>
       
    52 <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_d0e46954_href.png"/></fig>
       
    53 <p>In practice, the view concept varies depending upon your chosen architecture
       
    54 approach: </p>
       
    55 <section id="GUID-53125010-FFC7-422E-9EE5-A42427031F10"><title>Traditional architecture
       
    56 views</title>
       
    57 <p>In a traditional architecture, the view is derived from <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita"><apiname>CCoeControl</apiname></xref>,
       
    58 which typically constructs a top-level window-owning control that draws itself
       
    59 and contains other controls.</p>
       
    60 <p>For more information on views in tradition architecture approaches,
       
    61 see <xref href="GUID-B5DE1C86-2B16-4B22-887F-7079E54A8ED6.dita">Traditional
       
    62 Symbian UI application architecture</xref>.</p>
       
    63 </section>
       
    64 <section id="GUID-B473202D-9682-4EBA-83F2-8391DB2B56D9"><title>Symbian architecture
       
    65 views</title>
       
    66 <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
       
    67 the view that draws itself and contains other controls. For example, view
       
    68 controllers can be used to specify CBAs that are specific to specific views.</p>
       
    69 <p>In a Symbian architecture, the view controller is derived from <xref href="GUID-11967EBB-7439-3775-B287-7560ECA0AF1F.dita"><apiname>CAknView</apiname></xref>,
       
    70 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>.
       
    71 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
       
    72 views need to contain <xref href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.dita"><apiname>CCoeControl</apiname></xref>-derived classes to provide
       
    73 visual representation on the display.</p>
       
    74 <p>For more information on views in Symbian architecture approaches, see <xref href="GUID-68B999C2-0993-4804-9624-42C3D88BE5C7.dita">View
       
    75 architecture</xref>.</p>
       
    76 </section>
       
    77 <section id="GUID-C9AA9483-424E-4626-8335-5F70FE246E1D"><title>Dialog architecture
       
    78 views</title>
       
    79 <p>In dialog architectures, views are implemented in modeless dialog boxes.
       
    80 Multiple views can be constructed using nested dialogs or a tabbed dialog
       
    81 pane.</p>
       
    82 <p>For more information on views in dialog architecture approaches, see <xref href="GUID-DD88DD7B-E246-4BF2-B537-5C677728CC49.dita">Dialog
       
    83 architecture</xref>.</p>
       
    84 </section>
       
    85 </conbody></concept>