imservices/ossprotocoladaptation/src/cossprotocolpresencefeatures.cpp
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2007-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:  oss presence features implementation for XIMP Framework
       
    15 *
       
    16 */
       
    17 
       
    18 #include "cossprotocolpresencefeatures.h"
       
    19 #include <protocolpresentitygroups.h>
       
    20 #include <protocolpresencepublishing.h>
       
    21 #include <protocolpresenceauthorization.h>
       
    22 #include <badesca.h>
       
    23 #include "cossprotocolpresentitygroups.h"
       
    24 #include "ossprotocolpluginlogger.h"
       
    25 #include "cossprotocolpresencepublishing.h"
       
    26 #include "cossprotocolpresenceauthorization.h"
       
    27 
       
    28 _LIT ( KOSSProtocolPresenceFeatures, "COSSProtocolPresenceFeatures" );
       
    29 
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // COSSProtocolConnection::COSSProtocolPresenceFeatures()
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 COSSProtocolPresenceFeatures::COSSProtocolPresenceFeatures()
       
    37 	{
       
    38 	}
       
    39 
       
    40 // ---------------------------------------------------------------------------
       
    41 // COSSProtocolPresenceFeatures::ConstructL()
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 void COSSProtocolPresenceFeatures::ConstructL (
       
    45     COSSProtocolConnectionManager& aConnMan )
       
    46 	{
       
    47 	iPresentityGroups = COSSProtocolpresentitygroups::NewL ( aConnMan );
       
    48 	iPresencePublishing = COssProtocolPresencePublishing::NewL ( aConnMan );
       
    49 	iAuthrozation = COssProtocolPresenceAuthorization::NewL ( aConnMan );
       
    50 	}
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // COSSProtocolPresenceFeatures::NewL()
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 COSSProtocolPresenceFeatures* COSSProtocolPresenceFeatures::NewL (
       
    57     COSSProtocolConnectionManager& aConnMan )
       
    58 	{
       
    59 
       
    60 	COSSProtocolPresenceFeatures* self = new ( ELeave ) COSSProtocolPresenceFeatures;
       
    61 	CleanupStack::PushL ( self );
       
    62 	self->ConstructL ( aConnMan );
       
    63 	CleanupStack::Pop ( self );
       
    64 
       
    65 	return self;
       
    66 	}
       
    67 
       
    68 // ---------------------------------------------------------------------------
       
    69 // COSSProtocolPresenceFeatures::~COSSProtocolPresenceFeatures()
       
    70 // ---------------------------------------------------------------------------
       
    71 //
       
    72 COSSProtocolPresenceFeatures::~COSSProtocolPresenceFeatures()
       
    73 	{
       
    74 	delete iPresentityGroups;
       
    75 	delete iPresencePublishing;
       
    76 	delete iAuthrozation;
       
    77 	}
       
    78 
       
    79 
       
    80 // ---------------------------------------------------------------------------
       
    81 // COSSProtocolPresenceFeatures::GetInterface()
       
    82 // ---------------------------------------------------------------------------
       
    83 //
       
    84 TAny* COSSProtocolPresenceFeatures::GetInterface ( TInt32 aInterfaceId,
       
    85         TIfGetOps aOptions )
       
    86 	{
       
    87 	if ( aInterfaceId == MProtocolPresenceFeatures::KInterfaceId )
       
    88 		{
       
    89 		MProtocolPresenceFeatures* self = this;
       
    90 		return self;
       
    91 		}
       
    92 
       
    93 	if ( aOptions == MXIMPBase::EPanicIfUnknown )
       
    94 
       
    95 		{
       
    96 		User::Panic ( KOSSProtocolPresenceFeatures, KErrExtensionNotSupported );
       
    97 		}
       
    98 
       
    99 	return NULL;
       
   100 	}
       
   101 
       
   102 
       
   103 // ---------------------------------------------------------------------------
       
   104 // COSSProtocolPresenceFeatures::GetInterface()
       
   105 // ---------------------------------------------------------------------------
       
   106 //
       
   107 const TAny* COSSProtocolPresenceFeatures::GetInterface ( TInt32 aInterfaceId,
       
   108         TIfGetOps aOptions ) const
       
   109 	{
       
   110 
       
   111 	if ( aInterfaceId == MProtocolPresenceFeatures::KInterfaceId )
       
   112 		{
       
   113 		const MProtocolPresenceFeatures* self = this;
       
   114 		return self;
       
   115 		}
       
   116 
       
   117 	if ( aOptions == MXIMPBase::EPanicIfUnknown )
       
   118 		{
       
   119 		User::Panic ( KOSSProtocolPresenceFeatures, KErrExtensionNotSupported );
       
   120 		}
       
   121 
       
   122 	return NULL;
       
   123 	}
       
   124 
       
   125 
       
   126 // ---------------------------------------------------------------------------
       
   127 // COSSProtocolPresenceFeatures::GetInterfaceId()
       
   128 // ---------------------------------------------------------------------------
       
   129 //
       
   130 TInt32 COSSProtocolPresenceFeatures::GetInterfaceId() const
       
   131 	{
       
   132 	return MProtocolPresenceFeatures::KInterfaceId;
       
   133 	}
       
   134 
       
   135 // ---------------------------------------------------------------------------
       
   136 // COSSProtocolPresenceFeatures::PresenceWatching()
       
   137 // ---------------------------------------------------------------------------
       
   138 //
       
   139 MProtocolPresenceWatching& COSSProtocolPresenceFeatures::PresenceWatching()
       
   140 	{
       
   141 	MProtocolPresenceWatching* dummyWatch = NULL;
       
   142 	return *dummyWatch;
       
   143 	}
       
   144 
       
   145 // ---------------------------------------------------------------------------
       
   146 // COSSProtocolPresenceFeatures::PresencePublishing()
       
   147 // ---------------------------------------------------------------------------
       
   148 //
       
   149 MProtocolPresencePublishing& COSSProtocolPresenceFeatures::PresencePublishing()
       
   150 	{
       
   151 	return	*iPresencePublishing;
       
   152 	}
       
   153 
       
   154 // ---------------------------------------------------------------------------
       
   155 // COSSProtocolPresenceFeatures::PresentityGroups()
       
   156 // ---------------------------------------------------------------------------
       
   157 //
       
   158 MProtocolPresentityGroups& COSSProtocolPresenceFeatures::PresentityGroups()
       
   159 	{
       
   160 	return *iPresentityGroups;
       
   161 	}
       
   162 
       
   163 // ---------------------------------------------------------------------------
       
   164 // COSSProtocolPresenceFeatures::PresenceAuthorization()
       
   165 // ---------------------------------------------------------------------------
       
   166 //
       
   167 MProtocolPresenceAuthorization& COSSProtocolPresenceFeatures::PresenceAuthorization()
       
   168 	{
       
   169 	return *iAuthrozation;
       
   170 	}
       
   171 
       
   172 // End of file
       
   173 
       
   174 
       
   175 
       
   176 
       
   177 
       
   178 
       
   179