williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: // Started by BLB, October 1996 williamr@2: #if !defined(__BACNTF_H__) williamr@2: #define __BACNTF_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: williamr@2: class CEnvironmentChangeNotifier : public CActive williamr@2: /** Environment change notifier. This is an active object and can be used to handle williamr@2: environment change events. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C static CEnvironmentChangeNotifier* NewL(TInt aPriority,const TCallBack& aCallBack); williamr@2: IMPORT_C ~CEnvironmentChangeNotifier(); williamr@2: IMPORT_C void Start(); williamr@2: IMPORT_C TInt Set(const TCallBack& aCallBack); williamr@2: inline TInt Change() const; williamr@2: private: williamr@2: inline CEnvironmentChangeNotifier(TInt aPriority); williamr@2: void RunL(); williamr@2: void DoCancel(); williamr@2: private: williamr@2: TInt iChange; williamr@2: TCallBack iCallBack; williamr@2: RChangeNotifier iChangeNotifier; williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: inline TInt CEnvironmentChangeNotifier::Change() const williamr@2: /** Returns the last set of change events. williamr@2: williamr@2: If the last outstanding request completed normally, the function returns a williamr@2: bit pattern where each bit value corresponds to one of the enumerators defined williamr@2: by TChanges. A set bit indicates that the corresponding change event occurred. williamr@2: williamr@2: For example, if the bit value TChanges::EChangesMidnightCrossover is set, williamr@2: then the system time has passed midnight. williamr@2: williamr@2: @return A set of bits consisting of one or more of the values defined by TChanges, williamr@2: or KErrCancel if the last outstanding request was cancelled. williamr@2: @see TChanges */ williamr@2: {return iChange;} williamr@2: williamr@2: #endif williamr@4: williamr@4: