web_pub/favourites_engine_api/inc/FavouritesWapAp.h
changeset 0 dd21522fd290
child 48 79859ed3eea9
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2004 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 the License "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:  Declaration of FavouritesWapAp
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef FAVOURITES_WAP_AP_H
       
    20 #define FAVOURITES_WAP_AP_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <s32strm.h>
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29 * TFavouritesWapAp is the representation one the Access Point used in favourites. 
       
    30 * In addition to the AP Uid-s an item may hold "Use default" and "Unset/Null" values.
       
    31 */
       
    32 class TFavouritesWapAp
       
    33     {
       
    34 
       
    35     public:     // construction
       
    36         
       
    37         /**
       
    38         * C++ default constructor. Initializes to "Default".
       
    39         * @since 0.9       
       
    40         */
       
    41         IMPORT_C TFavouritesWapAp();
       
    42 
       
    43     public:     // operators
       
    44 
       
    45         /**
       
    46         * Assignment operator (from another TFavouritesWapAp).
       
    47         * @since 0.9       
       
    48         * @param aAp AP to assign from.
       
    49         * @return TFavouritesWapAp
       
    50         */
       
    51         IMPORT_C TFavouritesWapAp& operator= ( const TFavouritesWapAp& aAp );
       
    52 
       
    53         /**
       
    54         * Assignment operator (from TUint32).
       
    55         * "Null" and "Default" properties cleared.
       
    56         * @since 0.9       
       
    57         * @param aApId AP id to assign from.
       
    58         * @return TFavouritesWapAp
       
    59         */
       
    60         IMPORT_C TFavouritesWapAp& operator= ( TUint32 aApId );
       
    61 
       
    62     public:     // setters
       
    63 
       
    64         /**
       
    65         * Set value is unset. Any previous value is lost.
       
    66         * @since 0.9       
       
    67         * @return void
       
    68         */
       
    69         IMPORT_C void SetNull();
       
    70 
       
    71         /**
       
    72         * Set value is "Default". Any previous value is lost.
       
    73         * @since 0.9  
       
    74         * @return void     
       
    75         */
       
    76         IMPORT_C void SetDefault();
       
    77 
       
    78         /**
       
    79         * Set value. "Null" and "Default" properties cleared.
       
    80         * @since 0.9       
       
    81         * @param aApId AP id to set.
       
    82         * @return void
       
    83         */
       
    84         IMPORT_C void SetApId( TUint32 aApId );
       
    85 
       
    86     public:     // getters
       
    87 
       
    88         /**
       
    89         * Check if value is unset.
       
    90         * @since 0.9       
       
    91         * @return ETrue if value is unset.
       
    92         */
       
    93         IMPORT_C TBool IsNull() const;
       
    94 
       
    95         /**
       
    96         * Check if value is "Default".
       
    97         * @since 0.9       
       
    98         * @return ETrue if value is "Default".
       
    99         */
       
   100         IMPORT_C TBool IsDefault() const;
       
   101 
       
   102         /**
       
   103         * Get the AP id. If the value is "Null" or "Default", this method
       
   104         * panics. Check those before calling this method!
       
   105         * @since 0.9       
       
   106         * @return AP id.
       
   107         */
       
   108         IMPORT_C TUint32 ApId() const;
       
   109 
       
   110     public:     // (But not exported): Streaming
       
   111 
       
   112         /**
       
   113         * Externalize into a stream.
       
   114         * @since 0.9       
       
   115         * @param aStream The stream to externalize to.
       
   116         * @return void 
       
   117         */
       
   118         void ExternalizeL( RWriteStream& aStream ) const;
       
   119 
       
   120         /**
       
   121         * Internalize from a stream.
       
   122         * @since 0.9       
       
   123         * @param aStream The stream to externalize from.
       
   124         */
       
   125         void InternalizeL( RReadStream& aStream );
       
   126 
       
   127     private:    // friends
       
   128 
       
   129         /// RFavouritesTable writes this into database.
       
   130         friend class RFavouritesSrvTable;
       
   131 
       
   132     private:    // types
       
   133 
       
   134         /**
       
   135         * This enum holds the value kind ("Null", "Default" or just normal).
       
   136         */
       
   137         enum TValueKind
       
   138             {
       
   139             ENormal,    ///< Has real value (not special).
       
   140             ENull,      ///< Has "Null" value.
       
   141             EDefault    ///< Has "Default value".
       
   142             };
       
   143 
       
   144     private:    // data
       
   145 
       
   146         /**
       
   147         * AP id. Meaningless if value is "Null" or "Default".
       
   148         */
       
   149         TUint32 iApId;
       
   150 
       
   151         /**
       
   152         * Value kind.
       
   153         */
       
   154         TValueKind iValueKind;
       
   155     };
       
   156 
       
   157 #endif
       
   158             
       
   159 // End of File