author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
parent 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 2 |
// All rights reserved. |
williamr@2 | 3 |
// This component and the accompanying materials are made available |
williamr@4 | 4 |
// under the terms of "Eclipse Public License v1.0" |
williamr@2 | 5 |
// which accompanies this distribution, and is available |
williamr@4 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 7 |
// |
williamr@2 | 8 |
// Initial Contributors: |
williamr@2 | 9 |
// Nokia Corporation - initial contribution. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// Contributors: |
williamr@2 | 12 |
// |
williamr@2 | 13 |
// Description: |
williamr@2 | 14 |
// |
williamr@2 | 15 |
|
williamr@2 | 16 |
// Started by BLB, October 1996 |
williamr@2 | 17 |
#if !defined(__BACNTF_H__) |
williamr@2 | 18 |
#define __BACNTF_H__ |
williamr@2 | 19 |
|
williamr@2 | 20 |
#include <e32base.h> |
williamr@2 | 21 |
|
williamr@2 | 22 |
|
williamr@2 | 23 |
class CEnvironmentChangeNotifier : public CActive |
williamr@2 | 24 |
/** Environment change notifier. This is an active object and can be used to handle |
williamr@2 | 25 |
environment change events. |
williamr@2 | 26 |
@publishedAll |
williamr@2 | 27 |
@released |
williamr@2 | 28 |
*/ |
williamr@2 | 29 |
{ |
williamr@2 | 30 |
public: |
williamr@2 | 31 |
IMPORT_C static CEnvironmentChangeNotifier* NewL(TInt aPriority,const TCallBack& aCallBack); |
williamr@2 | 32 |
IMPORT_C ~CEnvironmentChangeNotifier(); |
williamr@2 | 33 |
IMPORT_C void Start(); |
williamr@2 | 34 |
IMPORT_C TInt Set(const TCallBack& aCallBack); |
williamr@2 | 35 |
inline TInt Change() const; |
williamr@2 | 36 |
private: |
williamr@2 | 37 |
inline CEnvironmentChangeNotifier(TInt aPriority); |
williamr@2 | 38 |
void RunL(); |
williamr@2 | 39 |
void DoCancel(); |
williamr@2 | 40 |
private: |
williamr@2 | 41 |
TInt iChange; |
williamr@2 | 42 |
TCallBack iCallBack; |
williamr@2 | 43 |
RChangeNotifier iChangeNotifier; |
williamr@2 | 44 |
}; |
williamr@2 | 45 |
|
williamr@2 | 46 |
|
williamr@2 | 47 |
|
williamr@2 | 48 |
inline TInt CEnvironmentChangeNotifier::Change() const |
williamr@2 | 49 |
/** Returns the last set of change events. |
williamr@2 | 50 |
|
williamr@2 | 51 |
If the last outstanding request completed normally, the function returns a |
williamr@2 | 52 |
bit pattern where each bit value corresponds to one of the enumerators defined |
williamr@2 | 53 |
by TChanges. A set bit indicates that the corresponding change event occurred. |
williamr@2 | 54 |
|
williamr@2 | 55 |
For example, if the bit value TChanges::EChangesMidnightCrossover is set, |
williamr@2 | 56 |
then the system time has passed midnight. |
williamr@2 | 57 |
|
williamr@2 | 58 |
@return A set of bits consisting of one or more of the values defined by TChanges, |
williamr@2 | 59 |
or KErrCancel if the last outstanding request was cancelled. |
williamr@2 | 60 |
@see TChanges */ |
williamr@2 | 61 |
{return iChange;} |
williamr@2 | 62 |
|
williamr@2 | 63 |
#endif |
williamr@4 | 64 |
|
williamr@4 | 65 |