systemsettings/gssensorplugin/inc/gssenbasecontainer.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Base container for multiselection containers
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef GSSENBASECONTAINER_H
       
    21 #define GSSENBASECONTAINER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <gsbasecontainer.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CGSListBoxItemTextArray;
       
    28 class CGSSensorPluginModel;
       
    29 class MGSSensorMskObserver;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  *  CGSSenBaseContainer container class
       
    35  *
       
    36  *  base container class for multiselection options settings view
       
    37  *
       
    38  *  @lib gssensorplugin.lib
       
    39  *  @since S60 5.0
       
    40  */
       
    41 class CGSSenBaseContainer : public CGSBaseContainer
       
    42     {
       
    43     public:
       
    44 
       
    45         /**
       
    46          * Destructor.
       
    47          */
       
    48         virtual ~CGSSenBaseContainer();
       
    49 
       
    50         /**
       
    51          * Default constructor
       
    52          */
       
    53         CGSSenBaseContainer( MGSSensorMskObserver& aMskObserver );
       
    54 
       
    55         /**
       
    56          * Retrieves the currently selected listbox feature id
       
    57          *
       
    58          * @return TInt Feature id.
       
    59          */
       
    60         TInt CurrentFeatureId() const;
       
    61 
       
    62         /**
       
    63          * Updates selected items checkbox icon
       
    64          *
       
    65          * @param aSelectedItem Checkbox to update
       
    66          */
       
    67         void UpdateCheckboxIconL( TInt aSelectedItem );
       
    68 
       
    69         /**
       
    70          * Stores currently made selections to Cenrep
       
    71          */
       
    72         void StoreSelectionsL();
       
    73 
       
    74         /**
       
    75          * Changes selection status bit in bitmask.
       
    76          *
       
    77          * @param aPosition Position of wanted selection in bitmask
       
    78          */
       
    79         void ChangeSelectionStatus( TInt aPosition );
       
    80 
       
    81         /**
       
    82          * Checks that selections are synchronized with the ones in the listbox
       
    83          */
       
    84         void CheckSelections();
       
    85 
       
    86         /**
       
    87          * Returns selected option value from selections bitmask
       
    88          *
       
    89          * @param aPosition Position of wanted selection in bitmask
       
    90          * @return 1: ON
       
    91          *         0: OFF
       
    92          */
       
    93         TInt SelectionStatus( TInt aPosition );
       
    94 
       
    95     protected:
       
    96 
       
    97         /**
       
    98          * Constructs listbox and initializes its sub-folders
       
    99          *
       
   100          * @param aResLbxId resource ID of the listbox item array
       
   101          */
       
   102         virtual void ConstructListBoxL( TInt aResLbxId ) = 0;
       
   103 
       
   104         /**
       
   105          * Update listbox icons according to previously set values
       
   106          */
       
   107         virtual void UpdateCheckboxIconsL() = 0;
       
   108 
       
   109         /**
       
   110          * Returns child classes interaction id
       
   111          *
       
   112          * @return TInt ID of the childs interaction from gssensorplugin.hrh file
       
   113          */
       
   114         virtual TInt InteractionId() = 0;
       
   115 
       
   116         /**
       
   117          * Constructs listbox and initializes its sub-folders
       
   118          *
       
   119          * @param aResLbxId resource ID of the listbox item array
       
   120          * @param aResMsId resource ID of the multiselection list
       
   121          * @param aInteraction ID of the interaction to get correct 
       
   122          *                     selections from CenRep
       
   123          */
       
   124         void ConstructListBoxL( TInt aResLbxId, TInt aResMsId );
       
   125 
       
   126         /**
       
   127          * Adds checkbox icons to multiselection list
       
   128          */
       
   129         void AddCheckboxIconsL();
       
   130 
       
   131         /**
       
   132          * Handles changes in MSK label between item changes in listbox
       
   133          */
       
   134         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   135 
       
   136 
       
   137     protected: // Data
       
   138 
       
   139         /**
       
   140          * Contains bitmask of selections
       
   141          */
       
   142         TUint32 iSelections;
       
   143 
       
   144         /**
       
   145          * Selection items from resource file
       
   146          */
       
   147         CDesCArrayFlat* iSelectionItems;
       
   148 
       
   149         /**
       
   150          * GS listbox model
       
   151          */
       
   152         CGSListBoxItemTextArray* iListboxItemArray;
       
   153         
       
   154         /**
       
   155          * Plugin model, does not own, so do not delete this
       
   156          */
       
   157         CGSSensorPluginModel* iModel;
       
   158 
       
   159         /**
       
   160          * Pointer to Middle soft key observer, not owned
       
   161          */
       
   162         MGSSensorMskObserver& iMskObserver;
       
   163 
       
   164     };
       
   165 
       
   166 #endif // GSSENBASECONTAINER_H