remotecontrol/remotecontrolfw/client/intermediate/src/remconinterfacefeatures.cpp
changeset 51 20ac952a623c
equal deleted inserted replaced
48:22de2e391156 51:20ac952a623c
       
     1 // Copyright (c) 2008-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 //
       
    15 
       
    16 #include <remcon/remconinterfacefeatures.h>
       
    17 
       
    18 // Default size chosen based on number of operations in core api
       
    19 const TInt KDefaultOperationBufLength = 62;
       
    20 const TInt KIncrementReallocGranularity = 62;
       
    21 
       
    22 EXPORT_C TInt RRemConInterfaceFeatures::Open()
       
    23 	{
       
    24 	return iOperations.Create(KDefaultOperationBufLength);
       
    25 	}
       
    26 
       
    27 EXPORT_C void RRemConInterfaceFeatures::Close()
       
    28 	{
       
    29 	iOperations.Close();
       
    30 	}
       
    31 
       
    32 EXPORT_C void RRemConInterfaceFeatures::AddOperationL(TUint aOperationId)
       
    33 	{
       
    34 	if(iOperations.Length() + sizeof(TUint) > iOperations.MaxLength())
       
    35 		{
       
    36 		// Need more space!
       
    37 		iOperations.ReAllocL(iOperations.Length() + KIncrementReallocGranularity);
       
    38 		}
       
    39 	
       
    40 	TPckgBuf<TUint> opBuf(aOperationId);
       
    41 	iOperations.Append(opBuf);
       
    42 	}
       
    43 
       
    44 const TDesC8& RRemConInterfaceFeatures::SupportedOperations() const
       
    45 	{
       
    46 	return iOperations;
       
    47 	}