ccservices/cmsservices/contactpresence/src/presenceiconinfores.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2008 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:  contact presence
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <e32base.h>
       
    23 #include "presenceiconinfores.h"
       
    24 
       
    25 // ================= MEMBER FUNCTIONS =======================
       
    26 //
       
    27 
       
    28 // ----------------------------------------------------------
       
    29 // CPresenceIconInfoRes::CPresenceIconInfoRes
       
    30 // ----------------------------------------------------------
       
    31 //
       
    32 CPresenceIconInfoRes::CPresenceIconInfoRes( TInt aOpId )
       
    33 : iOpId( aOpId )
       
    34     {
       
    35     }
       
    36 
       
    37 // ----------------------------------------------------------
       
    38 // CPresenceIconInfoRes::~CPresenceIconInfoRes
       
    39 // ----------------------------------------------------------
       
    40 //
       
    41 CPresenceIconInfoRes::~CPresenceIconInfoRes()
       
    42     {    
       
    43     delete iBrandId;
       
    44     iBrandId = NULL;
       
    45     
       
    46     delete iElementId;
       
    47     iElementId = NULL;
       
    48     
       
    49     delete iServiceName;
       
    50     iServiceName = NULL;
       
    51     }
       
    52 
       
    53 // ----------------------------------------------------------
       
    54 // CPresenceIconInfoRes::NewL
       
    55 // ----------------------------------------------------------
       
    56 //
       
    57 CPresenceIconInfoRes* CPresenceIconInfoRes::NewL(
       
    58         const TDesC8& aBrandId,
       
    59         const TDesC8& aElementId,
       
    60         const TDesC& aServiceName,
       
    61         TInt aOpId )
       
    62     {
       
    63     CPresenceIconInfoRes* self = new (ELeave) CPresenceIconInfoRes( aOpId );
       
    64     CleanupStack::PushL( self );
       
    65     self->ConstructL(  aBrandId, aElementId, aServiceName);
       
    66     CleanupStack::Pop( self );
       
    67     return self;
       
    68     }
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // CPresenceIconInfoRes::ConstructL
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 void CPresenceIconInfoRes::ConstructL(         
       
    75     const TDesC8& aBrandId,
       
    76     const TDesC8& aElementId,
       
    77     const TDesC& aServiceName )
       
    78     {
       
    79     iBrandId = aBrandId.AllocL();
       
    80     iElementId = aElementId.AllocL();
       
    81     iServiceName = aServiceName.AllocL();        
       
    82     }
       
    83 
       
    84 // ----------------------------------------------------------
       
    85 TPtrC8 CPresenceIconInfoRes::BrandId() 
       
    86     {
       
    87     return iBrandId ? iBrandId->Des() : TPtrC8();
       
    88     }
       
    89 
       
    90 // ----------------------------------------------------------
       
    91 TPtrC8 CPresenceIconInfoRes::ElementId()
       
    92     {
       
    93     return iElementId ? iElementId->Des() : TPtrC8();
       
    94     }
       
    95     
       
    96 // ----------------------------------------------------------
       
    97 TPtrC CPresenceIconInfoRes::ServiceName() 
       
    98     {
       
    99     return iServiceName ? iServiceName->Des() : TPtrC();
       
   100     }
       
   101 
       
   102 // ----------------------------------------------------------
       
   103 TInt CPresenceIconInfoRes::OpId() 
       
   104     {
       
   105     return iOpId;
       
   106     }
       
   107     
       
   108 
       
   109     
       
   110 // ----------------------------------------------------------
       
   111