accessoryservices/remotecontrolfw/server/inc/messagerecipients.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-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  @file 
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef MESSAGERECIPIENTS_H
       
    22 #define MESSAGERECIPIENTS_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <remcon/clientinfo.h>
       
    26 
       
    27 /**
       
    28 A list of clients a message with the given transaction ID was delivered to,
       
    29 that hasn't yet been responded to
       
    30 */
       
    31 NONSHARABLE_CLASS(CMessageRecipients): public CBase
       
    32 	{
       
    33 public:
       
    34 	/**
       
    35 	@return Ownership of a new CMessageRecipients object.
       
    36 	*/
       
    37 	static CMessageRecipients* NewL();
       
    38 	
       
    39 	/**
       
    40 	Destructor.
       
    41 	*/
       
    42 	~CMessageRecipients();
       
    43 	
       
    44 	/**
       
    45 	@return List of clients to which the message was delivered
       
    46 	*/
       
    47 	TSglQue<TClientInfo>& Clients();
       
    48 	
       
    49 	/**
       
    50 	@return Iterator over a list of clients to which the message was delivered.
       
    51 	@note Pointers returned by the iterator will be const TClientInfo*
       
    52 	*/
       
    53 	TClientInfoConstIter& ConstIter();
       
    54 	
       
    55 	/**
       
    56 	@return The transaction ID of the message that was delivered
       
    57 	*/
       
    58 	TUint& TransactionId();
       
    59 	
       
    60 	/**
       
    61  	Removes and deletes the specified client from the list of clients this message was delivered to.
       
    62  	Called when the client responds to the message
       
    63 	*/
       
    64 	void RemoveAndDestroyClient(const TClientInfo& aClientInfo);
       
    65 public:
       
    66 	TSglQueLink iLink;
       
    67 private:
       
    68 
       
    69 	/**
       
    70 	Constructor
       
    71 	*/
       
    72 	CMessageRecipients();
       
    73 
       
    74 	TSglQue<TClientInfo> iClientInfo;
       
    75 	TSglQueIter<TClientInfo> iIter;
       
    76 	TClientInfoConstIter iConstIter;
       
    77 	TUint iTransactionId;
       
    78 	};
       
    79 
       
    80 /**
       
    81 A list of CMessageRecipients, for storing the list of messages that haven't yet
       
    82 had a response sent to the bearer and which clients each was delivered to
       
    83 */
       
    84 NONSHARABLE_CLASS(CMessageRecipientsList): public CBase
       
    85 	{
       
    86 public:
       
    87 	/**
       
    88 	@return Ownership of a new CMessageRecipientsList object.
       
    89 	*/
       
    90 	static CMessageRecipientsList* NewL();
       
    91 	
       
    92 	/**
       
    93 	Destructor.
       
    94 	*/
       
    95 	~CMessageRecipientsList();
       
    96 	
       
    97 	/**
       
    98 	@return The list of messages and which client each was delivered to.
       
    99 	*/
       
   100 	TSglQue<CMessageRecipients>& Messages();
       
   101 	
       
   102 	/**
       
   103 	@return Iterator over the list of messages
       
   104 	*/
       
   105 	TSglQueIter<CMessageRecipients>& Iter();
       
   106 	
       
   107 	/**
       
   108 	Removes and deletes a message from the message recipients list with a specified transaction ID
       
   109 	Called when the response is sent to the bearer, or the last client has responded. 
       
   110 	*/
       
   111 	void RemoveAndDestroyMessage(const TUint aTransactionId);
       
   112 	
       
   113 	/**
       
   114 	@return pointer to a CMessageRecipients object with a specified transaction ID, or NULL
       
   115 	if one was not found
       
   116 	*/
       
   117 	CMessageRecipients* Message(TUint aTransactionId);
       
   118 	
       
   119 private:
       
   120 
       
   121 	/**
       
   122 	Constructor
       
   123 	*/
       
   124 	CMessageRecipientsList();
       
   125 
       
   126 	TSglQue<CMessageRecipients> iMessages;
       
   127 	TSglQueIter<CMessageRecipients> iIter;
       
   128 	};
       
   129 	
       
   130 #endif // MESSAGERECIPIENTS_H