51
|
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 |
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalTechnology
|
|
21 |
@released
|
|
22 |
*/
|
|
23 |
|
|
24 |
#ifndef REMCONBEARERBULKOBSERVER_H
|
|
25 |
#define REMCONBEARERBULKOBSERVER_H
|
|
26 |
|
|
27 |
#include <e32base.h>
|
|
28 |
#include <remcon/messagetype.h>
|
|
29 |
#include <remcon/clientid.h>
|
|
30 |
|
|
31 |
class TRemConAddress;
|
|
32 |
|
|
33 |
/**
|
|
34 |
Interface presented by RemCon down to bulk bearers.
|
|
35 |
The public methods are non-virtual and exported, so that they can be added to
|
|
36 |
without breaking BC for existing (non-rebuilt) bearers.
|
|
37 |
*/
|
|
38 |
class MRemConBearerBulkObserver
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
/**
|
|
42 |
Called when an incoming command from a remote is ready to be picked up by
|
|
43 |
RemCon.
|
|
44 |
@param aAddr The address the command came from.
|
|
45 |
@return Error. If KErrNone, RemCon is committing to collecting the message
|
|
46 |
using GetResponse. If non-KErrNone, the message will be dropped by the
|
|
47 |
bearer.
|
|
48 |
*/
|
|
49 |
IMPORT_C TInt NewCommand(const TRemConAddress& aAddr);
|
|
50 |
|
|
51 |
/**
|
|
52 |
Called when an incoming command from a remote is ready to be picked up by
|
|
53 |
RemCon. This overload is used when the command is for a stateless
|
|
54 |
interface and must be delivered to a particular client.
|
|
55 |
|
|
56 |
@param aAddr The address the command came from.
|
|
57 |
@param aClientId The client to deliver the command to.
|
|
58 |
@return Error. If KErrNone, RemCon is committing to collecting the message
|
|
59 |
using GetResponse. If non-KErrNone, the message will be dropped by the
|
|
60 |
bearer.
|
|
61 |
*/
|
|
62 |
IMPORT_C TInt NewCommand(const TRemConAddress& aAddr, const TRemConClientId& aClient);
|
|
63 |
|
|
64 |
/**
|
|
65 |
Called by a bearer when a new command has come in. RemCon returns a cookie
|
|
66 |
(a transaction id), guaranteed to be unique, which the bearer may use for
|
|
67 |
its own identification purposes.
|
|
68 |
@return A new transaction ID.
|
|
69 |
*/
|
|
70 |
IMPORT_C TUint NewTransactionId();
|
|
71 |
|
|
72 |
/**
|
|
73 |
Called by a bearer when a command is no longer valid and should be removed
|
|
74 |
from RemCon's queues
|
|
75 |
@param aTransactionId The transaction ID of the expired command
|
|
76 |
*/
|
|
77 |
IMPORT_C void CommandExpired(TUint aTransactionId);
|
|
78 |
|
|
79 |
/**
|
|
80 |
Called by a bearer to select the client to which commands should be addressed.
|
|
81 |
@param aAddr The address for received commands to be delivered to a specific client.
|
|
82 |
@param aClient The client to which commands received from the given address should
|
|
83 |
be delievered to.
|
|
84 |
*/
|
|
85 |
IMPORT_C TInt SetAddressedClient(const TRemConAddress& aAddr, const TRemConClientId& aClient);
|
|
86 |
|
|
87 |
/**
|
|
88 |
Called by a bearer to remove any addressing to particular clients for an address.
|
|
89 |
@param aAddr The address of received commands that are no longer to be delivered to
|
|
90 |
specified clients.
|
|
91 |
*/
|
|
92 |
IMPORT_C TInt RemoveAddressing(const TRemConAddress& aAddr);
|
|
93 |
|
|
94 |
private:
|
|
95 |
/**
|
|
96 |
@see NewCommand.
|
|
97 |
*/
|
|
98 |
virtual TInt MrcbboDoNewCommand(const TRemConAddress& aAddr) = 0;
|
|
99 |
|
|
100 |
/**
|
|
101 |
@see NewCommand.
|
|
102 |
*/
|
|
103 |
virtual TInt MrcbboDoNewCommand(const TRemConAddress& aAddr, const TRemConClientId& aClient) = 0;
|
|
104 |
|
|
105 |
/**
|
|
106 |
@see TransactionId.
|
|
107 |
*/
|
|
108 |
virtual TUint MrcbboDoNewTransactionId() = 0;
|
|
109 |
|
|
110 |
/**
|
|
111 |
@see CommandExpired.
|
|
112 |
*/
|
|
113 |
virtual void MrcbboDoCommandExpired(TUint aTransactionId) = 0;
|
|
114 |
|
|
115 |
/**
|
|
116 |
@see SetAddressedClient.
|
|
117 |
*/
|
|
118 |
virtual TInt MrcbboDoSetAddressedClient(const TRemConAddress& aAddr, const TRemConClientId& aClient) = 0;
|
|
119 |
|
|
120 |
/**
|
|
121 |
@see RemoveAddressing.
|
|
122 |
*/
|
|
123 |
virtual TInt MrcbboDoRemoveAddressing(const TRemConAddress& aAddr) = 0;
|
|
124 |
};
|
|
125 |
|
|
126 |
#endif // REMCONBEARERBULKOBSERVER_H
|