dosservices/dosserver/inc/doswaitingevent.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *    This is the definition for CDosWaitingEvent class.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __DOSWAITINGEVENT_H__
       
    21 #define __DOSWAITINGEVENT_H__
       
    22 
       
    23 //
       
    24 // CDosWaitingEvent class
       
    25 //
       
    26 
       
    27 #include <e32base.h>
       
    28 
       
    29 /**
       
    30 * Represents an incoming event that is to be transferred to registered listeners.
       
    31 */
       
    32 NONSHARABLE_CLASS( CDosWaitingEvent ) : public CBase
       
    33 {
       
    34 public:
       
    35 	/**
       
    36 	* Constructor.
       
    37 	*/
       
    38 	CDosWaitingEvent();
       
    39 
       
    40 	/**
       
    41 	* Destructor.
       
    42 	*/
       
    43 	~CDosWaitingEvent();
       
    44 
       
    45 	/**
       
    46 	* It adds itself to a Queue of events.
       
    47 	* @param aQueue A reference to the queue.
       
    48 	*/
       
    49 	void AddMeToQueue(TSglQue<CDosWaitingEvent>& aQueue);
       
    50 
       
    51 	/**
       
    52 	* It removes itself from a queue of events.
       
    53 	* @param aQueue A reference to the queue.
       
    54 	*/
       
    55 	void RemoveMeFromQueueD(TSglQue<CDosWaitingEvent>& aQueue);
       
    56 
       
    57 	/**
       
    58 	* Tells if the event has a paramater.
       
    59 	* @return ETrue if it has, EFalse otherwise.
       
    60 	*/
       
    61 	inline TBool HasParameter() const;
       
    62 
       
    63 	/**
       
    64 	* Returns the event's parameter.
       
    65 	* @return A buffer containing the parameter.
       
    66 	*/
       
    67 	inline const TDesC8& Parameter() const;
       
    68 
       
    69 	/**
       
    70 	* Sets the event's parameter. It takes it from a client-server message.
       
    71 	* @param aMessage Client-server message containing the request.
       
    72 	*/
       
    73 	void SetParameterL(const RMessage2& aMessage);
       
    74 
       
    75 	/**
       
    76 	* Sets the event's parameter.
       
    77 	* @param aParameter A pointer to the data.
       
    78 	* @param aParLength Length of the data.
       
    79 	*/
       
    80 	void SetParameterL(TAny* aParameter,TInt aParLength);
       
    81 
       
    82 	/**
       
    83 	* Tells if the events has been queued.
       
    84 	* @return ETrue if it has, EFalse otherwise.
       
    85 	*/
       
    86 	inline TBool IsQueued() const;
       
    87 
       
    88 public:
       
    89 	//To be part of the waiting list
       
    90 	TSglQueLink iLink; 
       
    91 private:
       
    92 	//The parameter for this event
       
    93 	HBufC8* iParameter; 
       
    94 
       
    95 	// Counts in how many queues this object is in.
       
    96 	TInt iQueueCount; 
       
    97 };
       
    98 
       
    99 
       
   100 
       
   101 #include "doswaitingevent.inl"
       
   102 
       
   103 #endif // __DOSWAITINGEVENT_H__