libraries/memoryaccess/PropertyAccess.h
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // PropertyAccess.h
       
     2 // 
       
     3 // Copyright (c) 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "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 // Accenture - Initial contribution
       
    11 //
       
    12 #ifndef PROPERTYACCESS_H
       
    13 #define PROPERTYACCESS_H
       
    14 
       
    15 #include <kernel.h>
       
    16 #include <kern_priv.h>
       
    17 
       
    18 class TNotifyRequest;
       
    19 
       
    20 NONSHARABLE_CLASS(DPropertyAccess) : public DBase
       
    21 	{
       
    22 public:
       
    23 	DPropertyAccess(DThread* aThread);
       
    24 	~DPropertyAccess();
       
    25 	TInt HandleProperty(TInt aFunction, TAny* aParams, TAny* aVal);
       
    26 	TInt DoHandleProperty(DThread* aClient, TInt aFunction, TAny* aParams, TAny* aVal);
       
    27 
       
    28 private:
       
    29 	TInt GetAllPropertiesFrom(DThread* aClient, RPropertyRef& property, TAny* aVal);
       
    30 	void CancelNotifys();
       
    31 	static void PropertyChanged(TAny* aPtr, TInt aReason);
       
    32 	void DoPropertyChanged(TNotifyRequest& aRequest, TInt aReason);
       
    33 	TInt SetupNotifyAll(DThread* aClient, TAny* aParams, TAny* aVal);
       
    34 	TInt SetupNotifyAll(TBool aBtrace, const TDesC8& aUserRequestsBuf);
       
    35 
       
    36 private:
       
    37 	DThread* iClient;
       
    38 	SDblQue iRequests;
       
    39 	TRequestStatus* iNotifyClientStatus;
       
    40 	TAny* iClientNotifyPtr;
       
    41 	TInt iMissedChanges;
       
    42 	};
       
    43 
       
    44 class TNotifyRequest
       
    45 	{
       
    46 public:
       
    47 	TNotifyRequest(TPropertyCompleteFn aCompleteFn, TUid aCat, TInt aKey, DPropertyAccess* aPropertyAccess, TBool aBtrace)
       
    48 		: iRequest(aCompleteFn, this), iPropertyAccess(aPropertyAccess), iBtrace(aBtrace), iCat(aCat), iKey(aKey)
       
    49 		{}
       
    50 public:
       
    51 	RPropertyRef iProperty;
       
    52 	TPropertySubsRequest iRequest;
       
    53 	DPropertyAccess* iPropertyAccess;
       
    54 	SDblQueLink iLink;
       
    55 	TBool iBtrace; // If set, don't use iNotifyClientStatus/iClientNotifyPtr/iMissedChanges, just use BTrace
       
    56 	// Lame, no way of getting these from the RPropertyRef
       
    57 	TUid iCat;
       
    58 	TInt iKey;
       
    59 	};
       
    60 
       
    61 #endif