persistentstorage/centralrepository/cenrepsrv/sessnotf.h
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2004-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 SESSNOTF_H
       
    17 #define SESSNOTF_H
       
    18 
       
    19 #include <e32base.h>
       
    20 #include "obsrvr_noc.h"
       
    21 #include <centralrepository.h>
       
    22 #include "clientrequest.h"
       
    23 
       
    24 using namespace NCentralRepositoryConstants;
       
    25 
       
    26 class CSessionNotifier : public CBase, public MObserver
       
    27 	{
       
    28 public:
       
    29 	CSessionNotifier();
       
    30 	~CSessionNotifier();
       
    31 
       
    32 	TInt AddRequest(TUint32 aId, TClientRequest aMessage);
       
    33 	TInt AddRequest(TUint32 aPartialId, TUint32 aIdMask, TClientRequest aMessage);
       
    34 	TInt CancelRequest(TUint32 aId);
       
    35 	TInt CancelRequest(TUint32 aPartialId, TUint32 aIdMask);
       
    36 	TInt CancelAllRequests();
       
    37 
       
    38 	void IdReportingOn();
       
    39 	void IdReportingOff();
       
    40 
       
    41 private:
       
    42 	void Notify(TUint32 aId);
       
    43 
       
    44 private:
       
    45 	TBool iIdReportingOn;
       
    46 
       
    47 	struct SRequest
       
    48 		{
       
    49 		TUint32 id;
       
    50 		TClientRequest msg;
       
    51 		};
       
    52 	RArray<SRequest> iRequests;
       
    53 
       
    54 	struct SGroupRequest
       
    55 		{
       
    56 		TUint32 partialId;
       
    57 		TUint32 idMask;
       
    58 		TClientRequest msg;
       
    59 		};
       
    60 	RArray<SGroupRequest> iGroupRequests;
       
    61 
       
    62 	enum { KArrayGranularity=1 };
       
    63 	};
       
    64 
       
    65 #endif // SESSNOTF_H