omaprovisioning/provisioning/WAPAdapter/Inc/MWPWAPItemBase.h
branchRCL_3
changeset 25 b183ec05bd8c
parent 24 13d7c31c74e0
child 26 19bba8228ff0
equal deleted inserted replaced
24:13d7c31c74e0 25:b183ec05bd8c
     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 MWPWAPITEMBASE_H
       
    21 #define MWPWAPITEMBASE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // CONSTANTS
       
    27 const TUint32 KWPWAPNoUID = 0;
       
    28 const TUint32 KWPWAPItemTypeNone = 0;
       
    29 const TUint32 KWPWAPItemTypeBookmark = 1;
       
    30 const TUint32 KWPWAPItemTypeAccesspoint = 2;
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  * MWPWAPItemBase is a base class for wap settings.
       
    38  *
       
    39  * @lib WPWAPAdapter
       
    40  * @since 2.0
       
    41  */ 
       
    42 class MWPWAPItemBase
       
    43     {
       
    44 	public:
       
    45 		struct TWPWAPSaveItem
       
    46 			{
       
    47 			TUint32 iSaveItemType;
       
    48 			TUint32 iUID;
       
    49 			};
       
    50 
       
    51     public:  // Constructors and destructor
       
    52 
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~MWPWAPItemBase() {};
       
    57 
       
    58     public:   // New functions
       
    59 
       
    60         /**
       
    61         * Returns the name of the item to be returned in
       
    62         * SummaryText().
       
    63         * @return Name of the item
       
    64         */
       
    65         virtual const TDesC& Name() const = 0;
       
    66 
       
    67         /**
       
    68         * Returns the title of the item to be returned in
       
    69         * SummaryTitle().
       
    70         * @return Name of the item
       
    71         */
       
    72         virtual const TDesC& Title() const = 0;
       
    73 
       
    74         /**
       
    75         * Returns the address of the service pointed by 
       
    76         * the item.
       
    77         * @return Address of the service
       
    78         */
       
    79         virtual const TDesC& Address() const = 0;
       
    80 
       
    81         /**
       
    82         * Saves the item. Call BaseSaveL() in beginning.
       
    83         */
       
    84         virtual void SaveL() = 0;
       
    85 
       
    86         /**
       
    87         * Returns ETrue if the item can be saved as
       
    88         * default setting.
       
    89         * @return Whether the item can be made default
       
    90         */
       
    91         virtual TBool CanSetAsDefault() const = 0;
       
    92 
       
    93         /**
       
    94         * Sets the item as default setting.
       
    95         */
       
    96         virtual void SetAsDefaultL() = 0;
       
    97 
       
    98         /**
       
    99         * Returns ETrue if the item is valid.
       
   100         * @return ETrue if valid
       
   101         */
       
   102         virtual TBool ValidateL() = 0;
       
   103 
       
   104         /**
       
   105         * Adds the item and its children to a list of items.
       
   106         * @param aShownItems The list of shown items to be appended to
       
   107         * @param aHiddenItems The list of hidden items to be appended to
       
   108         */
       
   109         virtual void AddL( RPointerArray<MWPWAPItemBase>& aShownItems, 
       
   110             RPointerArray<MWPWAPItemBase>& aHiddenItems  ) = 0;
       
   111 
       
   112         /**
       
   113         * Returns the ID of the saved item.
       
   114         * @return ID of the saved item, or KWPWAPNoUID
       
   115         */
       
   116         virtual const TDesC8& SaveData() const = 0;
       
   117 
       
   118     };
       
   119 
       
   120 #endif  // MWPWAPITEMBASE_H
       
   121             
       
   122 // End of File