omaprovisioning/provisioning/WAPAdapter/Inc/CWPWAPItemBAse.h
changeset 0 b497e44ab2fc
child 24 bf47f3b79154
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     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 class for WAP setting items.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CWPWAPITEMBASE_H
       
    21 #define CWPWAPITEMBASE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <MWPVisitor.h>
       
    26 #include "MWPWAPItemBase.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CCommsDatabase;
       
    30 class CApDataHandler;
       
    31 class CApAccessPointItem;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * CWPWAPItemBase is a base class for browser settings.
       
    37  *
       
    38  * @lib WPWAPAdapter
       
    39  * @since 2.0
       
    40  */ 
       
    41 class CWPWAPItemBase : public CBase, private MWPVisitor, public MWPWAPItemBase
       
    42     {
       
    43     public:  // Constructors and destructor
       
    44 
       
    45         /**
       
    46         * Destructor.
       
    47         */
       
    48         ~CWPWAPItemBase();
       
    49 
       
    50     public:  // From MWPVisitor
       
    51 
       
    52         void VisitL(CWPCharacteristic& aCharacteristic);
       
    53         void VisitL(CWPParameter& aParameter);
       
    54         void VisitLinkL(CWPCharacteristic& aCharacteristic );
       
    55 
       
    56     public:   // From MWPWAPItemBase
       
    57 
       
    58         const TDesC& Name() const;
       
    59         const TDesC& Title() const;
       
    60         const TDesC& Address() const;
       
    61         const TDesC8& SaveData() const;
       
    62 
       
    63     protected:   // New methods
       
    64         /**
       
    65         * C++ default constructor.
       
    66         * @param aTitle Title for items
       
    67         * @param aDefaultName Default name for items
       
    68         * @param aCharacteristic The APPLICATION characteristic
       
    69         * @param aCommsDb The CommsDB to use. Created if NULL.
       
    70         * @param aAPHandler The APEngine data handler to use. Created if NULL.
       
    71         */
       
    72         CWPWAPItemBase( const TDesC& aTitle, 
       
    73             const TDesC& aDefaultName, 
       
    74             CWPCharacteristic& aCharacteristic, 
       
    75             CCommsDatabase*& aCommsDb, 
       
    76             CApDataHandler*& aAPHandler );
       
    77 
       
    78         /**
       
    79         * 2nd phase base constructor. Derived classes must call this.
       
    80         */
       
    81         void BaseConstructL();
       
    82 
       
    83         /**
       
    84         * Handles one resource item.
       
    85         * @param aResource The RESOURCE item
       
    86         */
       
    87         virtual void ResourceL( CWPCharacteristic& aResource ) = 0;
       
    88 
       
    89         /**
       
    90         * Create CCommsDatabase and APEngine if NULL.
       
    91         */
       
    92         void CreateDbL();
       
    93 
       
    94         /**
       
    95         * Writes a home page to an access point. If access point already
       
    96         * has a home page, create a new one.
       
    97         * @param aItem Access point to access
       
    98         */
       
    99         void WriteHomePageL( CApAccessPointItem& aItem );
       
   100 
       
   101         /**
       
   102         * Create a valid name for the access point.
       
   103         * @param aName The base name for access point
       
   104         * @param aDb CommsDb instance
       
   105         */
       
   106         void MakeValidNameL( TDes& aName, CCommsDatabase& aDb ) const;
       
   107 
       
   108     protected:
       
   109         // The parent characteristic. Refs.
       
   110         CWPCharacteristic& iCharacteristic;
       
   111 
       
   112         // The preferred access point name
       
   113         TPtrC iName;
       
   114 
       
   115         // The access point address, Owns.
       
   116         HBufC* iAddr;
       
   117 
       
   118         // The UID of the access point
       
   119         TUint32 iUID;
       
   120 
       
   121         // UID of the saved item
       
   122         TPckgBuf<TWPWAPSaveItem> iSaveItem;
       
   123 
       
   124         // Temporary current proxy while visiting. Refs.
       
   125         CWPCharacteristic* iLink;
       
   126 
       
   127         // Text to return in SummaryTitle().
       
   128         const TDesC& iTitle;
       
   129 
       
   130         // Default name of access point.
       
   131         const TDesC& iDefaultName;
       
   132 
       
   133         // Comms db. Refs.
       
   134         CCommsDatabase*& iCommsDb;
       
   135 
       
   136         // APEngine. Refs.
       
   137         CApDataHandler*& iAPHandler;
       
   138     };
       
   139 
       
   140 #endif  // CWPWAPITEMBASE_H
       
   141             
       
   142 // End of File