psln/Inc/PslnBaseView.h
changeset 37 89c890c70182
parent 34 6b5204869ed5
child 45 667edd0b8678
equal deleted inserted replaced
34:6b5204869ed5 37:89c890c70182
     1 /*
       
     2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Psln application base view class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_PSLNBASEVIEW_H
       
    20 #define C_PSLNBASEVIEW_H
       
    21 
       
    22 #include <aknview.h>
       
    23 #include <eikclb.h>
       
    24 
       
    25 #include "psln.hrh"
       
    26 #include "PslnConst.h"
       
    27 
       
    28 class CPslnBaseContainer;
       
    29 class CPslnUi;
       
    30 class CPslnModel;
       
    31 class CAknNavigationDecorator;
       
    32 
       
    33 /**
       
    34 *  CPslnBaseView base view class.
       
    35 *
       
    36 */
       
    37 class CPslnBaseView : public CAknView, public MEikListBoxObserver
       
    38     {
       
    39     public: // Constructors and destructor
       
    40 
       
    41         /**
       
    42         * C++ default constructor
       
    43         */
       
    44         CPslnBaseView();
       
    45 
       
    46         /**
       
    47         * Destructor.
       
    48         */
       
    49         ~CPslnBaseView();
       
    50 
       
    51     protected:
       
    52 
       
    53         /**
       
    54         * From MEikListBoxObserver.
       
    55         * Handles listbox events.
       
    56         * @param aListBox Listbox where the event occurred.
       
    57         * @param aEventType Event type.
       
    58         */
       
    59         void HandleListBoxEventL( CEikListBox* aListBox,
       
    60             TListBoxEvent aEventType );
       
    61 
       
    62         /**
       
    63         * From CAknView.
       
    64         * Called when view is activated.
       
    65         * @param aPrevViewId previous view id.
       
    66         * @param aCustomMessageId custom message id.
       
    67         * @param aCustomMessage custom message content.
       
    68         */
       
    69         void DoActivateL(
       
    70             const TVwsViewId& aPrevViewId,
       
    71             TUid aCustomMessageId,
       
    72             const TDesC8& aCustomMessage );
       
    73 
       
    74         /**
       
    75         * From CAknView.
       
    76         * Called when view is deactivated.
       
    77         */
       
    78         void DoDeactivate();
       
    79 
       
    80         /**
       
    81         * Creates container for this view.
       
    82         */
       
    83         virtual void CreateContainerL();
       
    84 
       
    85         /**
       
    86         * Creates a new container for this view.
       
    87         * Sub-class should implement this, as this is called by this
       
    88         * base class from DoActivateL.
       
    89         */
       
    90         virtual void NewContainerL() = 0;
       
    91 
       
    92         /**
       
    93         * Sets navi pane for the view.
       
    94         */
       
    95         virtual void SetNaviPaneL();
       
    96 
       
    97         /**
       
    98         * Called by HandleListBoxEventL.
       
    99         * Handles list box selections.
       
   100         */
       
   101         virtual void HandleListBoxSelectionL() = 0;
       
   102                 
       
   103         /**
       
   104         * Called by HandleListBoxEventL.
       
   105         * Handles list box item highlight events.
       
   106         */
       
   107         virtual void HandleListBoxItemHighlightL() = 0;
       
   108 
       
   109         /**
       
   110         * Adds given resource text as MSK to CBA.
       
   111         *
       
   112         * @param aResourceId middle softkey label.
       
   113         * @param aCommandId command that should be performed when MSK
       
   114         *        is pressed.
       
   115         * @since S60 v3.1
       
   116         */
       
   117         virtual void SetMiddleSoftKeyLabelL(
       
   118             const TInt aResourceId,
       
   119             const TInt aCommandId );
       
   120 
       
   121         /**
       
   122         * From MEikMenuObserver.
       
   123         * Changes MenuPane dynamically.
       
   124         */
       
   125         virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   126 
       
   127         /**
       
   128         * Sets title pane to a view.
       
   129         * @since 5.0
       
   130         */
       
   131         virtual void SetTitlePaneL( TInt& aResourceId ) = 0;
       
   132         
       
   133        /**
       
   134         *Get the resorce id for CBA, The derived view change the CBA resource by overriding
       
   135         *this function.
       
   136         * @since 5.0
       
   137         */
       
   138         virtual TInt CbaResourceId( const TVwsViewId& aPrevViewId,TUid aCustomMessageId );
       
   139         
       
   140         /**
       
   141         * Called by HandleListBoxEventL.
       
   142         * Handles list box stylus down event.
       
   143         */
       
   144         virtual void HandleListBoxStylusDown();
       
   145         
       
   146         /**
       
   147         * Called by HandleListBoxEventL.
       
   148         * Handles list box stylus move event.
       
   149         */
       
   150         virtual void HandleListBoxStylusDrag();
       
   151         
       
   152     private:
       
   153 
       
   154         /* Remove container. */
       
   155         void RemoveContainer();
       
   156 
       
   157     protected: // Data
       
   158 
       
   159         /**
       
   160         * Container.
       
   161         * Not own.
       
   162         */
       
   163         CPslnBaseContainer* iContainer;
       
   164 
       
   165         /**
       
   166         * Application UI.
       
   167         * Not own.
       
   168         */
       
   169         CPslnUi* iPslnUi;
       
   170 
       
   171         /**
       
   172         * Model.
       
   173         * Not own.
       
   174         */
       
   175         CPslnModel* iModel;
       
   176 
       
   177         /**
       
   178         * Currently selected item.
       
   179         */
       
   180         TInt  iCurrentItem;
       
   181 
       
   182         /**
       
   183         * Navi pane.
       
   184         * Own.
       
   185         */
       
   186         CAknNavigationDecorator* iNaviPaneContext;
       
   187     };
       
   188 
       
   189 #endif // C_PSLNBASEVIEW_H
       
   190 
       
   191 // End of File