uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencefeatures.cpp
branchRCL_3
changeset 22 3104fc151679
parent 21 2b7283837edb
child 23 9a48e301e94b
equal deleted inserted replaced
21:2b7283837edb 22:3104fc151679
     1 /*
       
     2 * s_presencefeatures.cpp Copyright (c) 2006, 2007 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:  Interface for presence context.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "s_presencefeatures.h"
       
    19 #include "s_presentitygroups.h"
       
    20 #include "s_ximppresenceauthorization.h"
       
    21 #include "s_presencepublishing.h"
       
    22 #include "s_presenceobjectfactory.h"
       
    23 #include "s_presencewatching.h"
       
    24 
       
    25 MPresenceAuthorizationStub gPresenceAuthorizationStub;
       
    26 MPresencePublishingStub gMPresenceFeaturesStubPublishing;
       
    27 MPresenceObjectFactoryStub gMPresenceFeaturesStubObjectFactory;
       
    28 MPresenceWatchingStub gMPresenceFeaturesStubPresenceWatching;
       
    29 
       
    30 /**
       
    31  * Factory method to instantiate MPresenceFeatures.
       
    32  *
       
    33  * Factory method to instantiate platform default
       
    34  * MXIMPClient implementation through the ECom.
       
    35  * If the default presence framework isn't supported
       
    36  * in the platform, leaves with errorcode signalled
       
    37  * from ECom.
       
    38  *
       
    39  * @return The new presence client object. Object
       
    40  *         ownership is returned to caller.
       
    41  */
       
    42 MPresenceFeatures* MyMPresenceFeatureStub::NewStubL( MXIMPContext* /*aContext*/ )
       
    43 	{
       
    44 	
       
    45 	MyMPresenceFeatureStub* ret = new (ELeave) MyMPresenceFeatureStub();
       
    46 	CleanupStack::PushL(ret);
       
    47 	ret->ContructL();
       
    48 	CleanupStack::Pop();
       
    49 	return ret;	
       
    50 	}
       
    51 
       
    52 void MyMPresenceFeatureStub::ContructL()
       
    53 	{
       
    54 	iGroups = new (ELeave) MyPresentityGroupsStub();	
       
    55 	}
       
    56 
       
    57 /**
       
    58  * Public destructor.
       
    59  * Objects can be deleted through this interface.
       
    60  */
       
    61 MyMPresenceFeatureStub::~MyMPresenceFeatureStub()
       
    62 	{
       
    63 	delete iGroups;	
       
    64 	};
       
    65 
       
    66 
       
    67 /**
       
    68  * Default constructor to zero initialize
       
    69  * the iEcomDtorID member.
       
    70  */
       
    71 MyMPresenceFeatureStub::MyMPresenceFeatureStub()
       
    72 	{
       
    73 		
       
    74 	}
       
    75 
       
    76 
       
    77 /**
       
    78  * Gets reference to object factory interface.
       
    79  *
       
    80  * Returned object factory interface is used
       
    81  * to instantiate presence objects.
       
    82  *
       
    83  * @return Object factory interface.
       
    84  *         No ownership is returned caller.
       
    85  */
       
    86 MPresenceObjectFactory& MyMPresenceFeatureStub::PresenceObjectFactory() const
       
    87 	{
       
    88 //	MPresenceObjectFactory* ret = NULL;
       
    89 //	return *ret;
       
    90 	return gMPresenceFeaturesStubObjectFactory;
       
    91 	};
       
    92 
       
    93 
       
    94 /**
       
    95  * Gets reference to presence watching interface.
       
    96  *
       
    97  * @return Requested interface.
       
    98  *         No ownership is returned caller.
       
    99  */
       
   100 MPresenceWatching& MyMPresenceFeatureStub::PresenceWatching() const
       
   101 	{
       
   102 	//MPresenceWatching* ret = NULL;
       
   103 	//return *ret;	
       
   104 	return gMPresenceFeaturesStubPresenceWatching;
       
   105 	};
       
   106 
       
   107 
       
   108 
       
   109 /**
       
   110  * Gets reference to presence publishing interface.
       
   111  *
       
   112  * @return Requested interface.
       
   113  *         No ownership is returned caller.
       
   114  */
       
   115 MPresencePublishing& MyMPresenceFeatureStub::PresencePublishing() const
       
   116 	{
       
   117 //	MPresencePublishing* ret = NULL;
       
   118 //	return *ret;	
       
   119 	return gMPresenceFeaturesStubPublishing;
       
   120 	};
       
   121 
       
   122 
       
   123 
       
   124 /**
       
   125  * Gets reference to presentity groups interface.
       
   126  *
       
   127  * @return Requested interface.
       
   128  *         No ownership is returned caller.
       
   129  */
       
   130 MPresentityGroups& MyMPresenceFeatureStub::PresentityGroups() const
       
   131 	{
       
   132 	return *iGroups;	
       
   133 	};
       
   134 
       
   135 
       
   136 /**
       
   137  * Gets reference to presence authorization interface.
       
   138  *
       
   139  * @return Requested interface.
       
   140  *         No ownership is returned caller.
       
   141  */
       
   142 MPresenceAuthorization& MyMPresenceFeatureStub::PresenceAuthorization() const
       
   143 	{
       
   144 	return gPresenceAuthorizationStub;
       
   145 	};
       
   146 
       
   147 
       
   148 const TAny* MyMPresenceFeatureStub::GetInterface(
       
   149                     TInt32 /*aInterfaceId*/,
       
   150                     TIfGetOps /*aOps*/ ) const
       
   151     {
       
   152     return NULL;
       
   153     }
       
   154 
       
   155 TAny* MyMPresenceFeatureStub::GetInterface(
       
   156                     TInt32 /*aInterfaceId*/,
       
   157                     TIfGetOps /*aOps*/ )
       
   158     {
       
   159     return NULL;
       
   160     }
       
   161 
       
   162 TInt32 MyMPresenceFeatureStub::GetInterfaceId() const
       
   163     {
       
   164     return 0;
       
   165     }
       
   166 
       
   167