tsrc/provisioningenginestub/inc/cwpadapter.h
changeset 15 ccd8e69b5392
parent 2 b31261fd4e04
child 20 e8be2c2e049d
child 22 496ad160a278
equal deleted inserted replaced
2:b31261fd4e04 15:ccd8e69b5392
     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:  project specification
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CWPADAPTER_H
       
    20 #define CWPADAPTER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <E32Base.h>
       
    24 #include "MWPVisitor.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MWPPairVisitor;
       
    28 class MWPContextExtension;
       
    29 
       
    30 // DATA TYPES
       
    31 enum TWPSaveLeaveCode
       
    32     {
       
    33     EWPAccessPointsProtected = -49152,
       
    34     EWPCommsDBLocked = -49153,
       
    35     EWPBookmarksLocked = -49154
       
    36     };
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41  * CWPAdapter has to be implemented by each adapter.
       
    42  * CWPAdapter contains only pure virtual methods, which must be 
       
    43  * implemented by adapters, and inline methods, which can be
       
    44  * used by adapters or engine. Inlining prevents circular binary
       
    45  * dependency.
       
    46 *
       
    47 *  @lib ProvisioningEngine
       
    48 *  @since 2.0
       
    49  */ 
       
    50 class CWPAdapter : public CBase, public MWPVisitor
       
    51     {
       
    52     public:
       
    53 
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         IMPORT_C ~CWPAdapter();
       
    58 
       
    59     public:
       
    60 
       
    61         /**
       
    62         * Check the number of settings items.
       
    63         * @return Number of items
       
    64         */
       
    65         virtual TInt ItemCount() const = 0;
       
    66 
       
    67         /**
       
    68         * Returns the title of the nth summary line. 
       
    69         * @param aIndex Number of summary line
       
    70         * @return Summary line title
       
    71         */
       
    72         virtual const TDesC16& SummaryTitle(TInt aIndex) const = 0;
       
    73         
       
    74         /**
       
    75         * Returns the text of the nth summary line. 
       
    76         * @param aIndex Number of summary line
       
    77         * @return Summary line text
       
    78         */
       
    79         virtual const TDesC16& SummaryText(TInt aIndex) const = 0;
       
    80         
       
    81         /**
       
    82         * Saves one setting handled by the adapter.
       
    83         * @param Setting number
       
    84         */
       
    85         virtual void SaveL( TInt aItem ) = 0;
       
    86 
       
    87         /**
       
    88         * Returns ETrue if the adapter can set the settings as default.
       
    89         * @param Setting number
       
    90         * @return ETrue if the setting can be made default
       
    91         */
       
    92         virtual TBool CanSetAsDefault( TInt aItem ) const = 0;
       
    93 
       
    94         /**
       
    95         * Adapter sets the settings as default.
       
    96         * @param Setting number
       
    97         */
       
    98         virtual void SetAsDefaultL( TInt aItem ) = 0;
       
    99 
       
   100         /**
       
   101         * Calls the pair visitor for each detail line of an item.
       
   102         * @param aItem Item whose details are needed
       
   103         * @param aVisitor Pair visitor
       
   104         * @return KErrNotSupported if not supported
       
   105         */
       
   106         virtual TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ) = 0;
       
   107 
       
   108     public: // From MWPVisitor
       
   109 
       
   110         void VisitL(CWPCharacteristic& aCharacteristic) = 0;
       
   111         void VisitL(CWPParameter& aParameter) = 0;
       
   112         void VisitLinkL(CWPCharacteristic& aCharacteristic ) = 0;
       
   113 
       
   114     };
       
   115 
       
   116 #endif /* CWPADAPTER_H */