emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsettingitem.h
branchRCL_3
changeset 12 4ce476e64c59
parent 11 0396474f30f5
child 13 8592a65ad3fb
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
     1 /*
       
     2 * Copyright (c) 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:  Definition of the class CPbkxRclResultI
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBKXRCLSETTINGITEM_H
       
    20 #define CPBKXRCLSETTINGITEM_H
       
    21 
       
    22 #include <aknsettingitemlist.h>
       
    23 
       
    24 class CPbkxRemoteContactLookupProtocolAccount;
       
    25 
       
    26 /**
       
    27 * Class for showing RCL account selection setting item.
       
    28 *
       
    29 * Selected value is written to central repository.
       
    30 */
       
    31 class CPbkxRclSettingItem : public CAknEnumeratedTextPopupSettingItem
       
    32     {
       
    33 public: // constructor and destructor
       
    34     
       
    35     /**
       
    36     * Creates new setting item.
       
    37     *
       
    38     * @return New setting item.
       
    39     */
       
    40     static CPbkxRclSettingItem* NewL();
       
    41 
       
    42     /**
       
    43     * Creates new setting item.
       
    44     *
       
    45     * Created item is left on cleanup stack.
       
    46     *
       
    47     * @return New setting item.
       
    48     */
       
    49     static CPbkxRclSettingItem* NewLC();
       
    50 
       
    51     /**
       
    52     * Destructor.
       
    53     */
       
    54     virtual ~CPbkxRclSettingItem();
       
    55     
       
    56 public: // virtual methods from base class
       
    57 
       
    58     /**
       
    59     * @see CAknEnumeratedTextPopupSettingItem
       
    60     */
       
    61     virtual void EditItemL( TBool aCalledFromMenu );
       
    62     
       
    63 private: // methods used internally
       
    64 
       
    65     /**
       
    66     * Creates all protocol adapters and asks all protocol accounts from
       
    67     * each.
       
    68     */
       
    69     void LoadProtocolAccountsL();
       
    70 
       
    71     /**
       
    72     * Initializes text arrays which are shown to the user.
       
    73     */
       
    74     void FillTextArraysL();
       
    75 
       
    76     /**
       
    77     * Reads account information from central repository and sets the correct
       
    78     * account as selected.
       
    79     */
       
    80     void SetSelectedAccountL();
       
    81 
       
    82     /**
       
    83     * Stores selected account information to central repository.
       
    84     */
       
    85     void StoreSettingL();
       
    86     
       
    87 private: // constructors
       
    88 
       
    89     /**
       
    90     * Constructor.
       
    91     */
       
    92     CPbkxRclSettingItem();
       
    93 
       
    94     /**
       
    95     * Second-phase constructor.
       
    96     */
       
    97     void ConstructL();
       
    98 
       
    99 private: // data
       
   100 
       
   101     // Selected item index.
       
   102     TInt iSelectedItem;
       
   103 
       
   104     // Enumeration texts. Not owned.
       
   105     CArrayPtr<CAknEnumeratedText>* iEnumTexts;
       
   106 
       
   107     // Popped up texts. Not owned.
       
   108     CArrayPtr<HBufC>* iPoppedUpTexts;
       
   109     
       
   110     // Protocol accounts. Owned.
       
   111     RPointerArray<CPbkxRemoteContactLookupProtocolAccount> iProtocolAccounts;
       
   112 
       
   113     // Offset to resource file.
       
   114     TInt iResourceFileOffset;
       
   115     
       
   116     };
       
   117 
       
   118 #endif
       
   119