diff -r 22de2e391156 -r 20ac952a623c remotecontrol/remotecontrolfw/server/inc/messagerecipients.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/remotecontrol/remotecontrolfw/server/inc/messagerecipients.h Wed Oct 13 16:20:29 2010 +0300 @@ -0,0 +1,130 @@ +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + @file + @internalComponent +*/ + +#ifndef MESSAGERECIPIENTS_H +#define MESSAGERECIPIENTS_H + +#include +#include + +/** +A list of clients a message with the given transaction ID was delivered to, +that hasn't yet been responded to +*/ +NONSHARABLE_CLASS(CMessageRecipients): public CBase + { +public: + /** + @return Ownership of a new CMessageRecipients object. + */ + static CMessageRecipients* NewL(); + + /** + Destructor. + */ + ~CMessageRecipients(); + + /** + @return List of clients to which the message was delivered + */ + TSglQue& Clients(); + + /** + @return Iterator over a list of clients to which the message was delivered. + @note Pointers returned by the iterator will be const TClientInfo* + */ + TClientInfoConstIter& ConstIter(); + + /** + @return The transaction ID of the message that was delivered + */ + TUint& TransactionId(); + + /** + Removes and deletes the specified client from the list of clients this message was delivered to. + Called when the client responds to the message + */ + void RemoveAndDestroyClient(const TClientInfo& aClientInfo); +public: + TSglQueLink iLink; +private: + + /** + Constructor + */ + CMessageRecipients(); + + TSglQue iClientInfo; + TSglQueIter iIter; + TClientInfoConstIter iConstIter; + TUint iTransactionId; + }; + +/** +A list of CMessageRecipients, for storing the list of messages that haven't yet +had a response sent to the bearer and which clients each was delivered to +*/ +NONSHARABLE_CLASS(CMessageRecipientsList): public CBase + { +public: + /** + @return Ownership of a new CMessageRecipientsList object. + */ + static CMessageRecipientsList* NewL(); + + /** + Destructor. + */ + ~CMessageRecipientsList(); + + /** + @return The list of messages and which client each was delivered to. + */ + TSglQue& Messages(); + + /** + @return Iterator over the list of messages + */ + TSglQueIter& Iter(); + + /** + Removes and deletes a message from the message recipients list with a specified transaction ID + Called when the response is sent to the bearer, or the last client has responded. + */ + void RemoveAndDestroyMessage(const TUint aTransactionId); + + /** + @return pointer to a CMessageRecipients object with a specified transaction ID, or NULL + if one was not found + */ + CMessageRecipients* Message(TUint aTransactionId); + +private: + + /** + Constructor + */ + CMessageRecipientsList(); + + TSglQue iMessages; + TSglQueIter iIter; + }; + +#endif // MESSAGERECIPIENTS_H