author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 2 |
// All rights reserved. |
williamr@2 | 3 |
// This component and the accompanying materials are made available |
williamr@2 | 4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
williamr@2 | 5 |
// which accompanies this distribution, and is available |
williamr@2 | 6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
williamr@2 | 7 |
// |
williamr@2 | 8 |
// Initial Contributors: |
williamr@2 | 9 |
// Nokia Corporation - initial contribution. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// Contributors: |
williamr@2 | 12 |
// |
williamr@2 | 13 |
// Description: |
williamr@2 | 14 |
// |
williamr@2 | 15 |
|
williamr@2 | 16 |
|
williamr@2 | 17 |
|
williamr@2 | 18 |
/** |
williamr@2 | 19 |
@file |
williamr@2 | 20 |
@publishedPartner |
williamr@2 | 21 |
@released |
williamr@2 | 22 |
*/ |
williamr@2 | 23 |
|
williamr@2 | 24 |
#ifndef REMCONINTERFACEBASE_H |
williamr@2 | 25 |
#define REMCONINTERFACEBASE_H |
williamr@2 | 26 |
|
williamr@2 | 27 |
#include <e32base.h> |
williamr@2 | 28 |
#include <remcon/clienttype.h> |
williamr@2 | 29 |
|
williamr@2 | 30 |
class CRemConInterfaceSelector; |
williamr@2 | 31 |
|
williamr@2 | 32 |
/** |
williamr@2 | 33 |
Base class for outer layer APIs. |
williamr@2 | 34 |
*/ |
williamr@2 | 35 |
class CRemConInterfaceBase : public CBase |
williamr@2 | 36 |
{ |
williamr@2 | 37 |
public: |
williamr@2 | 38 |
/** Destructor */ |
williamr@2 | 39 |
IMPORT_C ~CRemConInterfaceBase(); |
williamr@2 | 40 |
|
williamr@2 | 41 |
public: // called by the ultimate client |
williamr@2 | 42 |
/** |
williamr@2 | 43 |
Cancels the currently outstanding asynchronous send request. |
williamr@2 | 44 |
@return KErrNone. |
williamr@2 | 45 |
*/ |
williamr@2 | 46 |
IMPORT_C TInt Cancel(); |
williamr@2 | 47 |
|
williamr@2 | 48 |
public: // called by the interface selector |
williamr@2 | 49 |
/** |
williamr@2 | 50 |
Called by the interface selector to get a pointer to an object which |
williamr@2 | 51 |
implements the interface API with UID aUid. This is a mechanism for |
williamr@2 | 52 |
allowing future change to the interface API without breaking BC in |
williamr@2 | 53 |
existing (non-updated) interfaces. |
williamr@2 | 54 |
*/ |
williamr@2 | 55 |
virtual TAny* GetInterfaceIf(TUid aUid) = 0; |
williamr@2 | 56 |
|
williamr@2 | 57 |
/** |
williamr@2 | 58 |
Accessor for the interface's UID. |
williamr@2 | 59 |
@return The interface's UID. |
williamr@2 | 60 |
*/ |
williamr@2 | 61 |
TUid InterfaceUid() const; |
williamr@2 | 62 |
|
williamr@2 | 63 |
/** |
williamr@2 | 64 |
Accessor for the maximum length of operation-specific data in this |
williamr@2 | 65 |
interface. |
williamr@2 | 66 |
@return The size in bytes of a buffer needed to hold the largest single |
williamr@2 | 67 |
payload of operation-associated data in this interface. |
williamr@2 | 68 |
*/ |
williamr@2 | 69 |
TUint MaxLength() const; |
williamr@2 | 70 |
|
williamr@2 | 71 |
/** |
williamr@2 | 72 |
Accessor for the type of the interface- either controller or target. |
williamr@2 | 73 |
@return The interface type. |
williamr@2 | 74 |
*/ |
williamr@2 | 75 |
TRemConClientType Type() const; |
williamr@2 | 76 |
|
williamr@2 | 77 |
protected: |
williamr@2 | 78 |
/** |
williamr@2 | 79 |
Constructor. |
williamr@2 | 80 |
@param aInterfaceUid The UID of the interface. |
williamr@2 | 81 |
@param aMaxLength The maximum length of any operation-specific data in the |
williamr@2 | 82 |
interface being registered. |
williamr@2 | 83 |
@param aInterfaceSelector The interface selector. |
williamr@2 | 84 |
*/ |
williamr@2 | 85 |
IMPORT_C CRemConInterfaceBase(TUid aInterfaceUid, |
williamr@2 | 86 |
TUint aMaxLength, |
williamr@2 | 87 |
CRemConInterfaceSelector& aInterfaceSelector, |
williamr@2 | 88 |
TRemConClientType aType); |
williamr@2 | 89 |
|
williamr@2 | 90 |
/** Must be called by concrete types at construction time. Registers the |
williamr@2 | 91 |
interface with the interface selector. */ |
williamr@2 | 92 |
IMPORT_C void BaseConstructL(); |
williamr@2 | 93 |
|
williamr@2 | 94 |
/** |
williamr@2 | 95 |
Accessor for the interface selector. |
williamr@2 | 96 |
@return The interface selector. |
williamr@2 | 97 |
*/ |
williamr@2 | 98 |
IMPORT_C CRemConInterfaceSelector& InterfaceSelector(); |
williamr@2 | 99 |
|
williamr@2 | 100 |
private: // owned |
williamr@2 | 101 |
/** The UID of the concrete (derived) interface. */ |
williamr@2 | 102 |
TUid iInterfaceUid; |
williamr@2 | 103 |
|
williamr@2 | 104 |
/** Max length of operation-specific data in this interface. */ |
williamr@2 | 105 |
TUint iMaxLength; |
williamr@2 | 106 |
|
williamr@2 | 107 |
/** The type of the interface- controller or target. */ |
williamr@2 | 108 |
const TRemConClientType iType; |
williamr@2 | 109 |
|
williamr@2 | 110 |
/** |
williamr@2 | 111 |
Pad for BC-friendly future change. |
williamr@2 | 112 |
*/ |
williamr@2 | 113 |
TAny* iPad; |
williamr@2 | 114 |
|
williamr@2 | 115 |
private: // unowned |
williamr@2 | 116 |
CRemConInterfaceSelector& iInterfaceSelector; |
williamr@2 | 117 |
}; |
williamr@2 | 118 |
|
williamr@2 | 119 |
#endif // REMCONINTERFACEBASE_H |