omacpadapters/WAPAdapter/Inc/CWPWAPAdapterBase.h
changeset 47 d316aecb87fd
equal deleted inserted replaced
46:b9b00b134b0d 47:d316aecb87fd
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Base for WAP adapters.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CWPWAPADAPTERBASE_H
       
    21 #define CWPWAPADAPTERBASE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <CWPAdapter.h>
       
    25 #include <MWPContextExtension.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CWPCharacteristic;
       
    29 class MWPWAPItemBase;
       
    30 class CCommsDatabase;
       
    31 class RCmConnectionMethodExt;
       
    32 class RCmManagerExt;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  * CWPWAPAdapterBase is a base for WAP adapters.
       
    38  *
       
    39  * @lib WPWAPAdapter
       
    40  * @since 2.0
       
    41  */ 
       
    42 class CWPWAPAdapterBase : public CWPAdapter, private MWPContextExtension
       
    43     {
       
    44     public:  // Constructors and destructor
       
    45 
       
    46         /**
       
    47         * Destructor.
       
    48         */
       
    49         ~CWPWAPAdapterBase();
       
    50 
       
    51     public: // from CWPAdapter
       
    52         
       
    53         TInt ItemCount() const;     
       
    54         const TDesC16& SummaryTitle(TInt aIndex) const;     
       
    55         const TDesC16& SummaryText(TInt aIndex) const;      
       
    56         void SaveL( TInt aItem );
       
    57         TBool CanSetAsDefault( TInt aItem ) const;
       
    58         void SetAsDefaultL( TInt aItem );
       
    59         TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor );
       
    60         void VisitL(CWPCharacteristic& aElement);
       
    61         void VisitL(CWPParameter& aElement);
       
    62         void VisitLinkL(CWPCharacteristic& aCharacteristic );
       
    63         TInt ContextExtension( MWPContextExtension*& aExtension );
       
    64 
       
    65     public: // from MWPContextExtension
       
    66         virtual const TDesC8& SaveDataL( TInt aIndex ) const;
       
    67         virtual void DeleteL( const TDesC8& aSaveData );
       
    68         TUint32 Uid() const;
       
    69 
       
    70     public: // New methods
       
    71         /**
       
    72         * Handles one application characteristic.
       
    73         * @param aCharacteristic The application characteristic
       
    74         */
       
    75         virtual void ApplicationL( CWPCharacteristic& aCharacteristic ) = 0;
       
    76 
       
    77     protected:  // New functions
       
    78         /**
       
    79         * C++ default constructor.
       
    80         */
       
    81         CWPWAPAdapterBase();
       
    82 
       
    83         /**
       
    84         * 2nd phase base constructor. Derived classes must call this.
       
    85         */
       
    86         void BaseConstructL();
       
    87 
       
    88         /**
       
    89         * Create CCommsDatabase and APEngine if NULL.
       
    90         */
       
    91         void CreateDbL();
       
    92 
       
    93     protected:  // Data
       
    94         // The application if of the current characteristic
       
    95         TPtrC iAppID;
       
    96 
       
    97         // The visible setting items. Owns.
       
    98         RPointerArray<MWPWAPItemBase> iItems;
       
    99 
       
   100         // The hidden setting items. Owns.
       
   101         RPointerArray<MWPWAPItemBase> iHiddenItems;
       
   102 
       
   103         // Comms database for saving. Owns.
       
   104         CCommsDatabase* iCommsDb;
       
   105 
       
   106         // APEngine for saving. Owns.
       
   107         RCmManagerExt* iCmManager;
       
   108     };
       
   109 
       
   110 #endif  // CWPWAPADAPTERBASE_H
       
   111             
       
   112 // End of File