sysstatemgmt/systemstatemgr/sus/inc/ssmadaptationcmn.h
changeset 0 4e1aa6a622a0
child 3 a811597961f0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     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 #ifndef __SSMADAPTATIONCMN_H__
       
    17 #define __SSMADAPTATIONCMN_H__
       
    18 
       
    19 #include <e32cmn.h>
       
    20 #include "susadaptionclisrv.h"
       
    21 
       
    22 class CAdaptationMessage : public CBase
       
    23 	{
       
    24 public:
       
    25 	CAdaptationMessage(const RMessage2 &aMessage);
       
    26 	void Complete(TInt aReason);
       
    27 	CSession2 *Session() const;
       
    28 	void WriteL(TInt aParam, const TDesC8 &aDes);
       
    29 	TInt Function() const;
       
    30 	TInt Int0() const;
       
    31 	void ReadL(TInt aParamNumber,TPtr8 aParam);
       
    32 	TInt GetDesLength(TInt aParam);
       
    33 private:
       
    34 	RMessage2 iMessage;
       
    35 	TBool iMessageAvailable;
       
    36 public :
       
    37 	TSusAdaptionServerRequests iRequestType;
       
    38 	//To know whether the object is created using reserved heap or not.
       
    39 	TBool iUsingReservedHeap;
       
    40 	};
       
    41 
       
    42 class RSsmAdaptationRequestQueue
       
    43 	{
       
    44 public:
       
    45 	void Close();
       
    46 	TBool IsEmpty();
       
    47 	void Dequeue(CAdaptationMessage *&aCurrentMessage);
       
    48 	void RemoveFromQueueAndComplete(const RMessage2 &aMessage);
       
    49 	TInt Queue(CAdaptationMessage *aPendingRequest);
       
    50 	void NotifyAndRemoveAll();
       
    51 	void RemoveFromQueueAndComplete(const RMessage2 &aMessage, RHeap *aReservedHeap);	
       
    52 	void NotifyAndRemoveAll(RHeap *aReservedHeap);
       
    53 	TInt Reserve(TInt aReserverCount);
       
    54 	TInt Count();
       
    55 	
       
    56 private:
       
    57 	RPointerArray<CAdaptationMessage > iQueue;
       
    58 		
       
    59 	};
       
    60 
       
    61 #endif	__SSMADAPTATIONCMN_H__