simpledatamodeladapter/src/presencepluginwatcherinfo.cpp
changeset 0 c8caa15ef882
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     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:  IETF SIMPLE Protocol implementation for XIMP Framework
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32std.h>
       
    20 #include <utf.h>
       
    21 
       
    22 #include "presencepluginwatcherinfo.h"
       
    23 
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // CPresencePluginWatcherInfo::CPresencePluginWatcherInfo
       
    29 // ---------------------------------------------------------------------------
       
    30 CPresencePluginWatcherInfo::CPresencePluginWatcherInfo( )
       
    31         {}
       
    32 
       
    33 // ---------------------------------------------------------------------------
       
    34 // CPresencePluginWatcherInfo::~CPresencePluginWatcherInfo
       
    35 // ---------------------------------------------------------------------------
       
    36 CPresencePluginWatcherInfo::~CPresencePluginWatcherInfo()
       
    37     {
       
    38     delete iId;
       
    39     delete iSipId;
       
    40     }
       
    41 
       
    42 // ----------------------------------------------------------
       
    43 // CPresencePluginWatcherInfo::NewL
       
    44 // ----------------------------------------------------------
       
    45 //
       
    46 CPresencePluginWatcherInfo* CPresencePluginWatcherInfo::NewL(
       
    47    const TDesC8& aId, const TDesC& aSipId )
       
    48     {
       
    49     CPresencePluginWatcherInfo* self =
       
    50     	new (ELeave) CPresencePluginWatcherInfo( );
       
    51     CleanupStack::PushL( self );
       
    52     self->ConstructL( aId, aSipId );
       
    53     CleanupStack::Pop( self );
       
    54     return self;
       
    55     }
       
    56 
       
    57 // ---------------------------------------------------------------------------
       
    58 // CPresencePluginWatcherInfo::ConstructL
       
    59 // ---------------------------------------------------------------------------
       
    60 //
       
    61 void CPresencePluginWatcherInfo::ConstructL( 
       
    62     const TDesC8& aId, const TDesC& aSipId  )
       
    63     {
       
    64     iId = aId.AllocL();
       
    65     iSipId = aSipId.AllocL();
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------------------------
       
    69 // CPresencePluginWatcherInfo::Destroy
       
    70 // ---------------------------------------------------------------------------
       
    71 void CPresencePluginWatcherInfo::Destroy()
       
    72     {
       
    73     DP_SDA("CPresencePluginWatcherInfo::Destroy");
       
    74     iLink.Deque();
       
    75     delete this;
       
    76     DP_SDA("CPresencePluginWatcherInfo::Destroy end");
       
    77     }
       
    78     
       
    79 // ---------------------------------------------------------------------------
       
    80 // CPresencePluginWatcherInfo::Match
       
    81 // ---------------------------------------------------------------------------
       
    82 TBool CPresencePluginWatcherInfo::Match( 
       
    83 	const TDesC8& aId,
       
    84 	const TDesC& aSipId )
       
    85     {
       
    86     DP_SDA("CPresencePluginWatcherInfo::Match");
       
    87     if ( (!iId->Des().CompareF( aId )) && (!iSipId->Des().CompareF( aSipId )) )    
       
    88         {
       
    89         return ETrue;
       
    90         }
       
    91     else
       
    92         {
       
    93         return EFalse;
       
    94         }       
       
    95     }
       
    96        
       
    97 // ---------------------------------------------------------------------------
       
    98 // CPresencePluginWatcherInfo::SipId
       
    99 // ---------------------------------------------------------------------------
       
   100 //
       
   101 TPtrC CPresencePluginWatcherInfo::SipId( )
       
   102     {
       
   103     DP_SDA("CPresencePluginWatcherInfo::SipId");
       
   104     return iSipId ? iSipId->Des() : TPtrC();       
       
   105     }
       
   106     
       
   107 // ---------------------------------------------------------------------------
       
   108 // CPresencePluginWatcherInfo::LinkOffset
       
   109 // ---------------------------------------------------------------------------
       
   110 //    
       
   111 TInt CPresencePluginWatcherInfo::LinkOffset()
       
   112     {
       
   113     return _FOFF(CPresencePluginWatcherInfo, iLink);
       
   114     }
       
   115     
       
   116 // End of file