imservices/ossprotocoladaptation/src/cossprotocolimfeatures.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 protocol plugin im features
       
    15 *
       
    16 */
       
    17 
       
    18 #include "cossprotocolimfeatures.h"
       
    19 #include <protocolimconversation.h>
       
    20 #include <badesca.h>
       
    21 #include "cossprotocolimconversation.h"
       
    22 #include "ossprotocolpluginlogger.h"
       
    23 
       
    24 _LIT ( KOSSProtocolImFeatures, "COSSProtocolImFeatures" );
       
    25 
       
    26 // ======== MEMBER FUNCTIONS ========
       
    27 
       
    28 // ---------------------------------------------------------------------------
       
    29 // COSSProtocolConnection::COSSProtocolImFeatures()
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 COSSProtocolImFeatures::COSSProtocolImFeatures(COSSProtocolConnectionManager& aConnMan) : iConnMan (aConnMan)
       
    33 	{
       
    34 	}
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // COSSProtocolImFeatures::ConstructL()
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 void COSSProtocolImFeatures::ConstructL (
       
    41     COSSProtocolConnectionManager& aConnMan )
       
    42 	{
       
    43 	iImConversation = COSSProtocolImConversation::NewL ( aConnMan );
       
    44 	}
       
    45 
       
    46 // ---------------------------------------------------------------------------
       
    47 // COSSProtocolImFeatures::NewL()
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 COSSProtocolImFeatures* COSSProtocolImFeatures::NewL (
       
    51     COSSProtocolConnectionManager& aConnMan )
       
    52 	{
       
    53 
       
    54 	COSSProtocolImFeatures* self = new ( ELeave ) COSSProtocolImFeatures(aConnMan);
       
    55 	CleanupStack::PushL ( self );
       
    56 	self->ConstructL ( aConnMan );
       
    57 	CleanupStack::Pop ( self );
       
    58 
       
    59 	return self;
       
    60 	}
       
    61 
       
    62 // ---------------------------------------------------------------------------
       
    63 // COSSProtocolImFeatures::~COSSProtocolImFeatures()
       
    64 // ---------------------------------------------------------------------------
       
    65 //
       
    66 COSSProtocolImFeatures::~COSSProtocolImFeatures()
       
    67 	{
       
    68 	delete iImConversation;
       
    69 	}
       
    70 
       
    71 
       
    72 // ---------------------------------------------------------------------------
       
    73 // COSSProtocolImFeatures::GetInterface()
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 TAny* COSSProtocolImFeatures::GetInterface ( TInt32 aInterfaceId,
       
    77         TIfGetOps aOptions )
       
    78 	{
       
    79 	if ( aInterfaceId == CProtocolImFeatures::KInterfaceId )
       
    80 		{
       
    81 		CProtocolImFeatures* self = this;
       
    82 		return self;
       
    83 		}
       
    84 
       
    85 	if ( aOptions == MXIMPBase::EPanicIfUnknown )
       
    86 
       
    87 		{
       
    88 		User::Panic ( KOSSProtocolImFeatures, KErrExtensionNotSupported );
       
    89 		}
       
    90 
       
    91 	return NULL;
       
    92 	}
       
    93 
       
    94 
       
    95 // ---------------------------------------------------------------------------
       
    96 // COSSProtocolImFeatures::GetInterface()
       
    97 // ---------------------------------------------------------------------------
       
    98 //
       
    99 const TAny* COSSProtocolImFeatures::GetInterface ( TInt32 aInterfaceId,
       
   100         TIfGetOps aOptions ) const
       
   101 	{
       
   102 
       
   103 	if ( aInterfaceId == CProtocolImFeatures::KInterfaceId )
       
   104 		{
       
   105 		const CProtocolImFeatures* self = this;
       
   106 		return self;
       
   107 		}
       
   108 
       
   109 	if ( aOptions == MXIMPBase::EPanicIfUnknown )
       
   110 		{
       
   111 		User::Panic ( KOSSProtocolImFeatures, KErrExtensionNotSupported );
       
   112 		}
       
   113 
       
   114 	return NULL;
       
   115 	}
       
   116 
       
   117 
       
   118 // ---------------------------------------------------------------------------
       
   119 // COSSProtocolImFeatures::GetInterfaceId() const
       
   120 // ---------------------------------------------------------------------------
       
   121 //
       
   122 TInt32 COSSProtocolImFeatures::GetInterfaceId() const
       
   123 	{
       
   124 	return CProtocolImFeatures::KInterfaceId;
       
   125 	}
       
   126 
       
   127 
       
   128 // ---------------------------------------------------------------------------
       
   129 // COSSProtocolImFeatures::ImConversation()
       
   130 // ---------------------------------------------------------------------------
       
   131 //
       
   132 MProtocolImConversation& COSSProtocolImFeatures::ImConversation()
       
   133 	{
       
   134 	return *iImConversation;
       
   135 	}
       
   136 
       
   137 // ---------------------------------------------------------------------------
       
   138 // COSSProtocolImFeatures::ImGroup()
       
   139 // ---------------------------------------------------------------------------
       
   140 //
       
   141 MProtocolImGroup& COSSProtocolImFeatures::ImGroup()
       
   142 	{
       
   143 	MProtocolImGroup* dummyGroup = NULL;
       
   144 	return *dummyGroup;
       
   145 	//Not supported
       
   146 	}
       
   147 
       
   148 // ---------------------------------------------------------------------------
       
   149 // COSSProtocolImFeatures::ImInvitation()
       
   150 // ---------------------------------------------------------------------------
       
   151 //
       
   152 MProtocolImInvitation& COSSProtocolImFeatures::ImInvitation()
       
   153 	{
       
   154 	//Not supported
       
   155 	MProtocolImInvitation* dummyInvitation = NULL;
       
   156 	return *dummyInvitation;
       
   157 	
       
   158 	}
       
   159 // ---------------------------------------------------------------------------
       
   160 // COSSProtocolImFeatures::SupportedSubInterfaces()
       
   161 // ---------------------------------------------------------------------------
       
   162 //
       
   163 TInt COSSProtocolImFeatures::SupportedSubInterfaces() const
       
   164     {
       
   165     return KErrNone;
       
   166     
       
   167     }
       
   168 // ---------------------------------------------------------------------------
       
   169 // COSSProtocolImFeatures::ImSearch()
       
   170 // ---------------------------------------------------------------------------
       
   171 //
       
   172 MProtocolImSearch& COSSProtocolImFeatures::ImSearch()
       
   173 	{
       
   174 	//ignore compiler worning ,Not supported
       
   175 	MProtocolImSearch* dummySearch = NULL;
       
   176 	return *dummySearch;
       
   177 
       
   178 	}
       
   179 void COSSProtocolImFeatures::SetHost(MProtocolImDataHost& aHost )
       
   180 	{
       
   181 		iHost = &aHost ;
       
   182 		iConnMan.SetImHost(aHost) ;
       
   183 	}
       
   184 	
       
   185 // End of file