browserutilities/favouritesengine/ClientServer/src/FavouritesWapAp.cpp
changeset 0 dd21522fd290
child 25 0ed94ceaa377
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     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 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: 
       
    15 *      Implementation of class TFavouritesWapAp
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include "FavouritesWapAp.h"
       
    24 #include "FavouritesPanic.h"
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 /**
       
    29 * This value is set to iApId, when the AP is "Default" or "Null"; not really
       
    30 * necessary, but clearer.
       
    31 */
       
    32 LOCAL_D const TUint32 KMeaninglessNeverAccessed = 0xFFFFFFFF;
       
    33 
       
    34 // ================= MEMBER FUNCTIONS =======================
       
    35 
       
    36 // ---------------------------------------------------------
       
    37 // TFavouritesWapAp::TFavouritesWapAp
       
    38 // ---------------------------------------------------------
       
    39 //
       
    40 EXPORT_C TFavouritesWapAp::TFavouritesWapAp() :
       
    41     iApId( KMeaninglessNeverAccessed ),
       
    42     iValueKind( EDefault )
       
    43     {
       
    44     }
       
    45 
       
    46 // ---------------------------------------------------------
       
    47 // TFavouritesWapAp::operator=
       
    48 // ---------------------------------------------------------
       
    49 //
       
    50 EXPORT_C TFavouritesWapAp&
       
    51 TFavouritesWapAp::operator= ( const TFavouritesWapAp& aAp )
       
    52     {
       
    53     if ( &aAp != this )
       
    54         {
       
    55         iApId = aAp.iApId;
       
    56         iValueKind = aAp.iValueKind;
       
    57         }
       
    58     return *this;
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------
       
    62 // TFavouritesWapAp::operator=
       
    63 // ---------------------------------------------------------
       
    64 //
       
    65 EXPORT_C TFavouritesWapAp& TFavouritesWapAp::operator= ( TUint32 aApId )
       
    66     {
       
    67     iApId = aApId;
       
    68     iValueKind = ENormal;
       
    69     return *this;
       
    70     }
       
    71 
       
    72 // ---------------------------------------------------------
       
    73 // TFavouritesWapAp::SetNull
       
    74 // ---------------------------------------------------------
       
    75 //
       
    76 EXPORT_C void TFavouritesWapAp::SetNull()
       
    77     {
       
    78     iApId = KMeaninglessNeverAccessed;  // Not really necessary.
       
    79     iValueKind = ENull;
       
    80     }
       
    81 
       
    82 // ---------------------------------------------------------
       
    83 // TFavouritesWapAp::SetDefault
       
    84 // ---------------------------------------------------------
       
    85 //
       
    86 EXPORT_C void TFavouritesWapAp::SetDefault()
       
    87     {
       
    88     iApId = KMeaninglessNeverAccessed;  // Not really necessary.
       
    89     iValueKind = EDefault;
       
    90     }
       
    91 
       
    92 // ---------------------------------------------------------
       
    93 // TFavouritesWapAp::SetApId
       
    94 // ---------------------------------------------------------
       
    95 //
       
    96 EXPORT_C void TFavouritesWapAp::SetApId( TUint32 aApId )
       
    97     {
       
    98     iApId = aApId;
       
    99     iValueKind = ENormal;
       
   100     }
       
   101 
       
   102 // ---------------------------------------------------------
       
   103 // TFavouritesWapAp::IsNull
       
   104 // ---------------------------------------------------------
       
   105 //
       
   106 EXPORT_C TBool TFavouritesWapAp::IsNull() const
       
   107     {
       
   108     return iValueKind == ENull;
       
   109     }
       
   110 
       
   111 // ---------------------------------------------------------
       
   112 // TFavouritesWapAp::IsDefault
       
   113 // ---------------------------------------------------------
       
   114 //
       
   115 EXPORT_C TBool TFavouritesWapAp::IsDefault() const
       
   116     {
       
   117     return iValueKind == EDefault;
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------
       
   121 // TFavouritesWapAp::ApId
       
   122 // ---------------------------------------------------------
       
   123 //
       
   124 EXPORT_C TUint32 TFavouritesWapAp::ApId() const
       
   125     {
       
   126     __ASSERT_DEBUG( iValueKind == ENormal, \
       
   127         FavouritesPanic ( EFavouritesNoWapApValue ) );
       
   128     return iApId;
       
   129     }
       
   130 
       
   131 // ---------------------------------------------------------
       
   132 // TFavouritesWapAp::ExternalizeL
       
   133 // ---------------------------------------------------------
       
   134 //
       
   135 void TFavouritesWapAp::ExternalizeL( RWriteStream& aStream ) const
       
   136     {
       
   137     aStream.WriteInt32L( iApId );
       
   138     aStream.WriteInt32L( STATIC_CAST( TInt, iValueKind ) );
       
   139     }
       
   140 
       
   141 // ---------------------------------------------------------
       
   142 // TFavouritesWapAp::InternalizeL
       
   143 // ---------------------------------------------------------
       
   144 //
       
   145 void TFavouritesWapAp::InternalizeL( RReadStream& aStream )
       
   146     {
       
   147     iApId = aStream.ReadInt32L();
       
   148     iValueKind = STATIC_CAST( TValueKind, aStream.ReadInt32L() );
       
   149     }
       
   150 
       
   151 //  End of File