usbmgmt/usbmgr/usbman/chargingplugin/public/repositorynotifier.h
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 2005-2009 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 *
       
    16 */
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef REPOSITORYNOTIFIER_H
       
    24 #define REPOSITORYNOTIFIER_H
       
    25 
       
    26 #include <e32base.h>
       
    27 
       
    28 class CRepository;
       
    29 
       
    30 class MUsbChargingRepositoryObserver
       
    31 	{
       
    32 public:
       
    33 	virtual void HandleRepositoryValueChangedL(const TUid& aRepository, TUint aId, TInt aVal) = 0;
       
    34 	};
       
    35 
       
    36 class CUsbChargingRepositoryNotifier : public CActive
       
    37 	{
       
    38 public:
       
    39 	~CUsbChargingRepositoryNotifier();
       
    40 	static CUsbChargingRepositoryNotifier* NewL(MUsbChargingRepositoryObserver& aObserver,const TUid& aRepository, TUint aId);
       
    41 	void Notify();
       
    42 protected:
       
    43 	CUsbChargingRepositoryNotifier(MUsbChargingRepositoryObserver& aObserver,const TUid& aRepository, TUint aId);
       
    44 	void RunL();
       
    45 	void ConstructL();
       
    46 private:
       
    47 	void DoCancel();
       
    48 	TInt RunError(TInt aError);
       
    49 
       
    50 protected:
       
    51 	MUsbChargingRepositoryObserver& iObserver;
       
    52 	CRepository*	iRepository;
       
    53 	TUid			iRepositoryUid;
       
    54 	TUint			iId;
       
    55 	};
       
    56 
       
    57 #endif // REPOSITORYNOTIFIER_H