realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/CSIPContactElement.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name          : CSIPContactElement.cpp
       
    15 // Part of       : ProfileAgent
       
    16 // Version       : SIP/4.0
       
    17 //
       
    18 
       
    19 
       
    20 
       
    21 #include "sipcontactelement.h"
       
    22 
       
    23 // -----------------------------------------------------------------------------
       
    24 // CSIPContactElement::NewL
       
    25 // -----------------------------------------------------------------------------
       
    26 //
       
    27 CSIPContactElement* CSIPContactElement::NewL()
       
    28 	{
       
    29 	CSIPContactElement* self = new( ELeave ) CSIPContactElement;
       
    30 	CleanupStack::PushL( self );
       
    31 	self->ConstructL();
       
    32 	CleanupStack::Pop( self );
       
    33 	return self;
       
    34 	}
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CSIPContactElement::CSIPContactElement
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 CSIPContactElement::CSIPContactElement() 
       
    41  : iHasExpires(EFalse)
       
    42 	{
       
    43 	}
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CSIPContactElement::ConstructL
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 void CSIPContactElement::ConstructL()
       
    50 	{
       
    51 	iUri8 = CUri8::NewL();
       
    52 	}
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CSIPContactElement::~CSIPContactElement
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 CSIPContactElement::~CSIPContactElement()
       
    59 	{
       
    60 	delete iUri8;
       
    61 	iState.Close();
       
    62 	iEvent.Close();
       
    63 	}
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // CSIPContactElement::SetUri8L
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 void CSIPContactElement::SetUri8L( CUri8* aUri )
       
    70 	{
       
    71 	__ASSERT_ALWAYS( aUri, User::Leave( KErrCorrupt ) );
       
    72 	delete iUri8;
       
    73 	iUri8 = aUri;
       
    74 	}
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CSIPContactElement::Uri8
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 const CUri8& CSIPContactElement::Uri8() const
       
    81 	{
       
    82 	return *iUri8;
       
    83 	}
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // CSIPContactElement::SetState
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 void CSIPContactElement::SetState( RString aState )
       
    90 	{
       
    91 	iState.Close();
       
    92 	iState = aState.Copy();
       
    93 	}
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CSIPContactElement::State
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 RString CSIPContactElement::State() const
       
   100 	{
       
   101 	return iState;
       
   102 	}
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // CSIPContactElement::SetEvent
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 void CSIPContactElement::SetEvent( RString aEvent )
       
   109 	{
       
   110 	iEvent.Close();
       
   111 	iEvent = aEvent.Copy();
       
   112 	}
       
   113 
       
   114 // -----------------------------------------------------------------------------
       
   115 // CSIPContactElement::Event
       
   116 // -----------------------------------------------------------------------------
       
   117 //
       
   118 RString CSIPContactElement::Event() const
       
   119 	{
       
   120 	return iEvent;
       
   121 	}	
       
   122 	
       
   123 // -----------------------------------------------------------------------------
       
   124 // CSIPContactElement::SetExpires
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 void CSIPContactElement::SetExpires( TUint aValue )
       
   128 	{
       
   129 	iExpires = aValue;
       
   130 	iHasExpires = ETrue;
       
   131 	}
       
   132 
       
   133 // -----------------------------------------------------------------------------
       
   134 // CSIPContactElement::Expires
       
   135 // -----------------------------------------------------------------------------
       
   136 //
       
   137 TUint CSIPContactElement::Expires() const
       
   138 	{
       
   139 	return iExpires;
       
   140 	}
       
   141 
       
   142 // -----------------------------------------------------------------------------
       
   143 // CSIPContactElement::HasExpires
       
   144 // -----------------------------------------------------------------------------
       
   145 //	
       
   146 TBool CSIPContactElement::HasExpires() const
       
   147     {
       
   148     return iHasExpires;
       
   149     }