phonebookui/Phonebook2/UIControls/inc/CPbk2DefaultSavingStorageSettingItem.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Phonebook 2 default saving storage setting item.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2DEFAULTSAVINGSTORAGESETTINGITEM_H
       
    20 #define CPBK2DEFAULTSAVINGSTORAGESETTINGITEM_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <aknsettingitemlist.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CVPbkContactStoreUriArray;
       
    27 class CSelectionItemList;
       
    28 class CAknSingleStyleListBox;
       
    29 class CRepository;
       
    30 class CVPbkContactManager;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  * Phonebook 2 default saving storage setting item.
       
    36  */
       
    37 NONSHARABLE_CLASS( CPbk2DefaultSavingStorageSettingItem ) :
       
    38             public CAknEnumeratedTextPopupSettingItem
       
    39     {
       
    40     public: // Construction and destruction
       
    41 
       
    42         /**
       
    43          * Constructor.
       
    44          *
       
    45          * @param aResourceId       Resource id.
       
    46          * @param aValue            Value.
       
    47          * @param aSupportedStores  Array of supported stores
       
    48          * @see CAknEnumeratedTextPopupSettingItem
       
    49          */
       
    50         CPbk2DefaultSavingStorageSettingItem(
       
    51                 TInt aResourceId,
       
    52                 TInt& aValue,
       
    53                 CVPbkContactStoreUriArray& aSupportedStores,
       
    54                 CSelectionItemList& aSelectionItemList );
       
    55 
       
    56         /**
       
    57          * Destructor.
       
    58          */
       
    59         ~CPbk2DefaultSavingStorageSettingItem();
       
    60 
       
    61     public: // Interface
       
    62 
       
    63         /**
       
    64          * Returns the value of the setting.
       
    65          *
       
    66          * @return  Value of the setting.
       
    67          */
       
    68          TInt Value();
       
    69 
       
    70         /**
       
    71          * Updates the setting item.
       
    72          *
       
    73          * @return  ETrue if update successful, EFalse otherwise.
       
    74          */
       
    75         TBool UpdateL();
       
    76 
       
    77         /**
       
    78          * Restores array states.
       
    79          */
       
    80         void RestoreStateL();
       
    81 
       
    82     private: // From CAknSettingItem
       
    83         void CompleteConstructionL();
       
    84         void StoreL();
       
    85         void LoadL();
       
    86 
       
    87     private: // Implementation
       
    88         void CreatePopupItemListL();
       
    89         void CreateEnumeratedItemListL();
       
    90         void ShowInformationNoteL();
       
    91         TBool LaunchDefaultSavingMemoryQueryL();
       
    92         TBool IsDefaultSavingStorageL(
       
    93                 HBufC& aStoreName );
       
    94         void SetSelectedIndex(
       
    95                 TInt aNewIndex );
       
    96         void SetSelectedIndex(
       
    97                 const TDesC& aStoreUri );
       
    98         TBool CheckSelectedItems();
       
    99 
       
   100     private: // Data
       
   101         /// Ref: Array of supported contact store URIs
       
   102         CVPbkContactStoreUriArray& iSupportedStores;
       
   103         /// Ref: Selection item list
       
   104         CSelectionItemList& iSelectionItemList;
       
   105         /// Own: Repository
       
   106         CRepository* iRepository;
       
   107         /// Ref: Array of text enumerations
       
   108         CArrayPtr<CAknEnumeratedText>* iEnumeratedTextArray;
       
   109         /// Ref: Array of texts for popup items
       
   110         CArrayPtr<HBufC>* iPopupTextArray;
       
   111         /// Own: Array of contact store URIs
       
   112         CArrayPtr<HBufC>* iStoreUriArray;
       
   113     };
       
   114 
       
   115 #endif // CPBK2DEFAULTSAVINGSTORAGESETTINGITEM_H
       
   116 
       
   117 // End of File