accessoryservices/remotecontrolfw/server/inc/messagesendobserver.h
author hgs
Thu, 23 Sep 2010 10:05:41 +0300
changeset 70 653a8b91b95e
permissions -rw-r--r--
201037
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
70
hgs
parents:
diff changeset
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     2
// All rights reserved.
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     7
//
hgs
parents:
diff changeset
     8
// Initial Contributors:
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    10
//
hgs
parents:
diff changeset
    11
// Contributors:
hgs
parents:
diff changeset
    12
//
hgs
parents:
diff changeset
    13
// Description:
hgs
parents:
diff changeset
    14
// Server-side representation of a target client, which may have multiple 
hgs
parents:
diff changeset
    15
// server-side sessions open
hgs
parents:
diff changeset
    16
// 
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
/**
hgs
parents:
diff changeset
    19
 @file
hgs
parents:
diff changeset
    20
 @internalComponent
hgs
parents:
diff changeset
    21
*/
hgs
parents:
diff changeset
    22
hgs
parents:
diff changeset
    23
#ifndef MESSAGESENDOBSERVER_H
hgs
parents:
diff changeset
    24
#define MESSAGESENDOBSERVER_H
hgs
parents:
diff changeset
    25
hgs
parents:
diff changeset
    26
class MRemConMessageSendObserver
hgs
parents:
diff changeset
    27
	{
hgs
parents:
diff changeset
    28
public:
hgs
parents:
diff changeset
    29
hgs
parents:
diff changeset
    30
	/**
hgs
parents:
diff changeset
    31
	Called by CRemConServer to provide the result of an attempt to send a given message to a single remote.
hgs
parents:
diff changeset
    32
	This should be used in cases where a command can only be delivered to zero or one remotes (e.g. a notify command)
hgs
parents:
diff changeset
    33
	AND the observer does not require notification in advance of the number of remotes.
hgs
parents:
diff changeset
    34
	The observer should complete its client request with the error given here.
hgs
parents:
diff changeset
    35
	@param aMessage The CRemConMessage whose send was attempted.
hgs
parents:
diff changeset
    36
	@param aError The result of the send attempt (KErrNone in success).
hgs
parents:
diff changeset
    37
	*/
hgs
parents:
diff changeset
    38
	virtual void MrcmsoMessageSendResult(const CRemConMessage& aMessage, TInt aError)=0;
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
	/**
hgs
parents:
diff changeset
    41
	Called by CRemConServer to notify the observer that an attempt is about to be made to send a particular message
hgs
parents:
diff changeset
    42
	to one or more remotes.
hgs
parents:
diff changeset
    43
	This allows CRemConServer to notify the session in advance of the number of remotes to which the send will be attempted.
hgs
parents:
diff changeset
    44
	If the number of remotes is 1, this method can still be used to provide the session with notification of the number of remotes.
hgs
parents:
diff changeset
    45
	MrcmsoMessageSendOneOrMoreResult() will be invoked for each remote to which an attempt is made to send the message.
hgs
parents:
diff changeset
    46
	The observer should keep track of the number of remotes to which the message is still to be sent and should complete its client
hgs
parents:
diff changeset
    47
	request once all remotes have been tried.
hgs
parents:
diff changeset
    48
	@param aMessage The CRemConMessage whose send is about to be attempted.
hgs
parents:
diff changeset
    49
	@param aNumRemotes The number of remotes that the message is to be sent to.
hgs
parents:
diff changeset
    50
	*/
hgs
parents:
diff changeset
    51
	virtual void MrcmsoMessageSendOneOrMoreAttempt(const CRemConMessage& aMessage, TUint aNumRemotes)=0;
hgs
parents:
diff changeset
    52
hgs
parents:
diff changeset
    53
	/**
hgs
parents:
diff changeset
    54
	Called by CRemConServer to notify the observer that an attempt is about to be made to send a particular message to n 
hgs
parents:
diff changeset
    55
	further remotes.
hgs
parents:
diff changeset
    56
	This can be used when the exact number of remotes is not known at first. This should not be invoked after the first
hgs
parents:
diff changeset
    57
	attempt to send the message has been made.
hgs
parents:
diff changeset
    58
	The observer should keep track of the number of remotes to which the message is still to be sent and should complete its client
hgs
parents:
diff changeset
    59
	request once all remotes have been tried.
hgs
parents:
diff changeset
    60
	@param aMessage The CRemConMessage whose send is about to be attempted.
hgs
parents:
diff changeset
    61
	@param aNumRemotes The number of additional remotes that this message is to be sent to.
hgs
parents:
diff changeset
    62
	*/
hgs
parents:
diff changeset
    63
	virtual void MrcmsoMessageSendOneOrMoreIncremental(const CRemConMessage& aMessage, TUint aNumRemotes)=0;
hgs
parents:
diff changeset
    64
hgs
parents:
diff changeset
    65
	/**
hgs
parents:
diff changeset
    66
	Called by CRemConServer to indicate that a message send attempt to one or more remotes could not be made.
hgs
parents:
diff changeset
    67
	For example, the send attempt may have failed because as the message could not be addressed.
hgs
parents:
diff changeset
    68
	The observer should complete its client	request immediately with the given error.
hgs
parents:
diff changeset
    69
	@param aMessage The CRemConMessage whose send was attempted.
hgs
parents:
diff changeset
    70
	@param aError An error preventing the attempt from being made.
hgs
parents:
diff changeset
    71
	*/
hgs
parents:
diff changeset
    72
	virtual void MrcmsoMessageSendOneOrMoreAttemptFailed(const CRemConMessage& aMessage, TInt aError)=0;
hgs
parents:
diff changeset
    73
hgs
parents:
diff changeset
    74
	/**
hgs
parents:
diff changeset
    75
	Called by CRemConServer to provide the result of an attempt to send a given message to one of a number of remotes.
hgs
parents:
diff changeset
    76
	A call is made to this method for each remote for which an attempted send was made.
hgs
parents:
diff changeset
    77
	The observer should keep track of the number of remotes to which the message is still to be sent and should complete its client
hgs
parents:
diff changeset
    78
	request once all remotes have been tried.
hgs
parents:
diff changeset
    79
	If the message send result is unexpected (i.e. the observer believes that no remotes should have been tried), then the observer
hgs
parents:
diff changeset
    80
	may ignore this result. For example, the observers client may have cancelled its send request for this message.
hgs
parents:
diff changeset
    81
	@param aMessage The CRemConMessage whose send was attempted.
hgs
parents:
diff changeset
    82
	@param aError The result of the send attempt (KErrNone in success).
hgs
parents:
diff changeset
    83
	*/
hgs
parents:
diff changeset
    84
	virtual void MrcmsoMessageSendOneOrMoreResult(const CRemConMessage& aMessage, TInt aError)=0;
hgs
parents:
diff changeset
    85
hgs
parents:
diff changeset
    86
	/**
hgs
parents:
diff changeset
    87
	Called by CRemConServer to indicate that the sending of a given message to a remote was abandoned.
hgs
parents:
diff changeset
    88
	This provides a mechanism whereby CRemConServer may drop a message without sending an error back
hgs
parents:
diff changeset
    89
	to the client. For example, if the message is not permitted by the TSP for the remote, or fails to match a
hgs
parents:
diff changeset
    90
	command, then the attempt for this remote should be abandoned but the client may still be completed
hgs
parents:
diff changeset
    91
	without error. If a message cannot be sent because of an error, then MrcmsoMessageSendResult() should be used.
hgs
parents:
diff changeset
    92
	The observer should keep track of the number of remotes to which the message is still to be sent and should complete its client
hgs
parents:
diff changeset
    93
	request once all remotes have been tried.
hgs
parents:
diff changeset
    94
	If the message send result is unexpected (i.e. the observer believes that no remotes should have been tried), then the observer
hgs
parents:
diff changeset
    95
	may ignore this result. For example, the observers client may have cancelled its send request for this message.
hgs
parents:
diff changeset
    96
	@param aMessage The CRemConMessage whose send was attempted.
hgs
parents:
diff changeset
    97
	*/
hgs
parents:
diff changeset
    98
	virtual void MrcmsoMessageSendOneOrMoreAbandoned(const CRemConMessage& aMessage)=0;
hgs
parents:
diff changeset
    99
hgs
parents:
diff changeset
   100
	};
hgs
parents:
diff changeset
   101
hgs
parents:
diff changeset
   102
#endif // MESSAGESENDOBSERVER_H