gsprofilesrv_plat/settings_framework_api/inc/GSMainView.h
branchRCL_3
changeset 24 8ee96d21d9bf
parent 23 8bda91a87a00
child 25 7e0eff37aedb
equal deleted inserted replaced
23:8bda91a87a00 24:8ee96d21d9bf
     1 /*
       
     2 * Copyright (c) 2005 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:   Main view.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef GSMAINVIEW_H
       
    21 #define GSMAINVIEW_H
       
    22 
       
    23 // INCLUDES
       
    24 #include    "gspluginloader.h"
       
    25 #include    "gschildviewmanager.h"
       
    26 #include    <data_caging_path_literals.hrh>
       
    27 #include    <ConeResLoader.h>
       
    28 #include    <gstabbedviewowner.h>
       
    29 #include    <aknview.h>
       
    30 #include    <eikmenup.h>
       
    31 
       
    32 // CONSTANTS
       
    33 _LIT( KGSMainViewResourceFileName, "z:GSApp.rsc" );
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CGSMainContainer;
       
    37 class CGSPluginInterface;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 * CGSMainView view class
       
    43 *
       
    44 * Main view of GS
       
    45 *
       
    46 * This view is responsible for visualizing the first level of settings
       
    47 * plugins.
       
    48 *
       
    49 */
       
    50 class CGSMainView :
       
    51     public CAknView,
       
    52     public MGSPluginLoadObserver,
       
    53     public MGSTabbedViewOwner,
       
    54     public MGSChildViewManager
       
    55     {
       
    56     public: // Constructors and destructor
       
    57 
       
    58         CGSMainView();
       
    59 
       
    60         /**
       
    61         * Symbian OS two-phased constructor
       
    62         * @return GS main view.
       
    63         */
       
    64         static CGSMainView* NewL();
       
    65 
       
    66         /**
       
    67         * Symbian OS two-phased constructor
       
    68         * @return GS main view.
       
    69         */
       
    70         static CGSMainView* NewLC();
       
    71 
       
    72         /**
       
    73         * Symbian OS default constructor.
       
    74         */
       
    75         void ConstructL();
       
    76 
       
    77         /**
       
    78         * Destructor
       
    79         */
       
    80         ~CGSMainView();
       
    81 
       
    82     public: // New
       
    83 
       
    84         /**
       
    85         * Returns pointer to the owned plugins.
       
    86         */
       
    87         CArrayPtrFlat<CGSPluginInterface>* Plugins();
       
    88 
       
    89         /**
       
    90         * Updates plugin's view. This can be used when child plugin's values
       
    91         * are changed.
       
    92         */
       
    93         void UpdateView();
       
    94         
       
    95         /**
       
    96          * represent the position of ListBox
       
    97          */
       
    98         struct TListBoxPosition
       
    99 		    {
       
   100 		    /**
       
   101 		     * The three items are all set to -1 as an initial value because their legal
       
   102 		     * value should be no less than 0.
       
   103 		     */
       
   104 		    inline void Reset()
       
   105 		    	{
       
   106 		        iCurrentItemIndex = -1;
       
   107 		    	iItemOffsetInPixels = -1;
       
   108 		    	iTopItemIndex = -1;
       
   109 		    	}
       
   110 		    TInt iCurrentItemIndex;
       
   111 		    TInt iItemOffsetInPixels;
       
   112 		    TInt iTopItemIndex;
       
   113 		    };
       
   114 
       
   115     public: // From CAknView
       
   116 
       
   117         /**
       
   118         * See base view.
       
   119         */
       
   120         TUid Id() const;
       
   121 
       
   122     public: // From MGSPluginLoadObserver
       
   123 
       
   124         /**
       
   125         * See base view.
       
   126         */
       
   127         void HandlePluginLoaded( KGSPluginLoaderStatus aStatus );
       
   128 
       
   129     public: // From MGSChildViewManager
       
   130 
       
   131         /**
       
   132         * See base view.
       
   133         */
       
   134         void TransferDynamicPluginL( CGSPluginInterface* aPlugin );
       
   135 
       
   136     public: // From MGSTabbedViewOwner
       
   137 
       
   138         /**
       
   139         * See base view.
       
   140         */
       
   141         CArrayPtrFlat<CGSPluginInterface>* TabbedViews();
       
   142 
       
   143         /**
       
   144         * See base class.
       
   145         */
       
   146         void TabChangedL( TUid selectedTabUid );
       
   147 
       
   148     protected: // From CAknView
       
   149 
       
   150         /**
       
   151         * See base view.
       
   152         */
       
   153         void DoActivateL(
       
   154             const TVwsViewId& aPrevViewId,
       
   155             TUid aCustomMessageId,
       
   156             const TDesC8& aCustomMessage );
       
   157 
       
   158         /**
       
   159         * See base view.
       
   160         */
       
   161         void DoDeactivate();
       
   162 
       
   163         /**
       
   164         * See base view.
       
   165         */
       
   166         void HandleCommandL( TInt aCommand );
       
   167     
       
   168     protected: // From MEikMenuObserver
       
   169 
       
   170         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   171 
       
   172     private:
       
   173 
       
   174         /**
       
   175         * Opens the nearest localized resourcefile.
       
   176         */
       
   177         void OpenLocalizedResourceFileL( const TDesC& aResourceFileName );
       
   178 
       
   179         /**
       
   180         * Creates new container.
       
   181         */
       
   182         void NewContainerL();
       
   183 
       
   184     private: // Data
       
   185 
       
   186         // Pointer to Application UI. Not owned.
       
   187         CAknViewAppUi* iAppUi;
       
   188 
       
   189         // Pointer to owned container.
       
   190         CGSMainContainer* iContainer;
       
   191 
       
   192         // GS plug-ins owned by this view. CGSPluginLoader defines the
       
   193         // ordering of items.
       
   194         CArrayPtrFlat<CGSPluginInterface>* iPluginArray;
       
   195 
       
   196         // Asynchronous loader for the GS plug-ins.
       
   197         CGSPluginLoader* iPluginLoader;
       
   198 
       
   199         // Resource loader.
       
   200         RConeResourceLoader iResourceLoader;
       
   201 
       
   202         // UID of the selected plugin in the container's lbx.
       
   203         TUid iSelectedPluginUid;
       
   204         
       
   205         //keep the exact position of the listbox including current item index,
       
   206         //ItemOffsetInPixels and  TopItemindex
       
   207         TListBoxPosition iPosition;
       
   208         
       
   209         //record the screen mode, portrait/landscape
       
   210         TBool iIsLandscapeOrientation;
       
   211     };
       
   212 
       
   213 
       
   214 #endif  // GSMAINVIEW_H
       
   215 // End of File