ximpfw/core/srcdatamodel/ximpcontextstateimp.cpp
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2006 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:  MXIMPContextState API object implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "ximpcontextstateimp.h"
       
    19 
       
    20 
       
    21 
       
    22 // ============================ MEMBER FUNCTIONS =============================
       
    23 
       
    24 // ---------------------------------------------------------------------------
       
    25 // CXIMPContextStateImp::NewLC()
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 EXPORT_C CXIMPContextStateImp* CXIMPContextStateImp::NewLC()
       
    29     {
       
    30     CXIMPContextStateImp* self = new( ELeave ) CXIMPContextStateImp;
       
    31     CleanupStack::PushL( self );
       
    32     self->ConstructL();
       
    33     return self;
       
    34     }
       
    35 
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // CXIMPContextStateImp::NewL()
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 EXPORT_C CXIMPContextStateImp* CXIMPContextStateImp::NewL()
       
    42     {
       
    43     CXIMPContextStateImp* self = CXIMPContextStateImp::NewLC();
       
    44     CleanupStack::Pop( self );
       
    45     return self;
       
    46     }
       
    47 
       
    48 
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // CXIMPContextStateImp::~CXIMPContextStateImp()
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 CXIMPContextStateImp::~CXIMPContextStateImp()
       
    55     {
       
    56     }
       
    57 
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 // CXIMPContextStateImp::CXIMPContextStateImp()
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 CXIMPContextStateImp::CXIMPContextStateImp()
       
    64     {
       
    65     iContextState = MXIMPContextState::EInactive;
       
    66     }
       
    67 
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // CXIMPContextStateImp::ConstructL()
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 void CXIMPContextStateImp::ConstructL()
       
    74     {
       
    75     }
       
    76 
       
    77 
       
    78 // ---------------------------------------------------------------------------
       
    79 // CXIMPContextStateImp::NewFromStreamLC()
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 XIMPIMP_IMPLEMENT_DATAOBJ_NEWFROMSTREAM( CXIMPContextStateImp )
       
    83 
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // Implement supported interface access.
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 XIMPIMP_IF_BASE_GET_INTERFACE_BEGIN( CXIMPContextStateImp,
       
    90                                      MXIMPContextState )
       
    91 XIMPIMP_IF_BASE_GET_INTERFACE_END()
       
    92 
       
    93 
       
    94 XIMPIMP_IF_BASE_GET_CONST_INTERFACE_BEGIN( CXIMPContextStateImp,
       
    95                                            MXIMPContextState )
       
    96 XIMPIMP_IF_BASE_GET_INTERFACE_END()
       
    97 
       
    98 
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 // CXIMPContextStateImp::ContextState()
       
   102 // ---------------------------------------------------------------------------
       
   103 MXIMPContextState::TState CXIMPContextStateImp::ContextState() const
       
   104     {
       
   105     return iContextState;
       
   106     }
       
   107 
       
   108 
       
   109 // ---------------------------------------------------------------------------
       
   110 // CXIMPContextStateImp::ExternalizeL()
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 void CXIMPContextStateImp::ExternalizeL( RWriteStream& aStream ) const
       
   114     {
       
   115     aStream.WriteInt32L( iContextState );
       
   116     }
       
   117 
       
   118 
       
   119 // ---------------------------------------------------------------------------
       
   120 // CXIMPContextStateImp::InternalizeL()
       
   121 // ---------------------------------------------------------------------------
       
   122 //
       
   123 EXPORT_C void CXIMPContextStateImp::InternalizeL( RReadStream& aStream )
       
   124     {
       
   125     iContextState = (MXIMPContextState::TState) aStream.ReadInt32L();
       
   126     }
       
   127 
       
   128 
       
   129 // ---------------------------------------------------------------------------
       
   130 // CXIMPContextStateImp::SetStateValue()
       
   131 // ---------------------------------------------------------------------------
       
   132 //
       
   133 EXPORT_C void CXIMPContextStateImp::SetStateValue( 
       
   134     MXIMPContextState::TState aState )
       
   135     {
       
   136     iContextState = aState;
       
   137     }
       
   138 
       
   139 
       
   140 // ---------------------------------------------------------------------------
       
   141 // CXIMPContextStateImp::EqualsContent()
       
   142 // ---------------------------------------------------------------------------
       
   143 //
       
   144 TBool CXIMPContextStateImp::EqualsContent( 
       
   145     const CXIMPApiDataObjBase& aOtherInstance ) const
       
   146     {
       
   147     const CXIMPContextStateImp* tmp =
       
   148     TXIMPGetImpClassOrPanic< const CXIMPContextStateImp >::From( 
       
   149                                                         aOtherInstance.Base() );
       
   150 
       
   151     TBool totallySame = ETrue;
       
   152     TBool x;
       
   153     x = iContextState == tmp->iContextState;
       
   154     totallySame &= x;
       
   155 
       
   156     return totallySame;
       
   157     }
       
   158 
       
   159 
       
   160 // End of file