Environment Change Notifier is provided so that an application can be notified of changes in the environment such as a switch in locale, crossing over past midnight and so on.
The TChanges enumerator lists the possible events. This set of events may be extended as the operating system evolves.
An environment change notifier is an instance of a CEnvironmentChangeNotifier class. This is an active object which allows an application to respond to change events easily. These change events are generated by a kernel side change notifier service. The CEnvironmentChangeNotifier class uses the kernel side change notifier service through an RChangeNotifier handle.
An application supplies a callback function to CEnvironmentChangeNotifier when it is constructed.
When an outstanding request for change events completes, CEnvironmentChangeNotifier issues another request for change events before calling the callback function (encapsulated in a TCallBack ).
The implementation of the callback function depends on the application but, typically, it would flag the required changes and schedule other changes either to the application's engine or the application's user interface.
Programs can use Environment Change Notifier to request for notifications for the following changes:
To use the Environment Change Notifier, an application must perform the following:
Implement a callback function to handle the environment change.
Construct a CEnvironmentChangeNotifier object using its NewL() function, specifying the active object priority and a pointer to the callback function encapsulated in a TCallBack object.
NewL() also adds this CEnvironmentChangeNotifier active object to the current active scheduler .
Issue a request for change events by calling the Start() member function.
Whenever a request completes, CEnvironmentChangeNotifier issues another request for change events before the callback function is invoked.
The first call to the callback function occurs immediately after the first call to Start() . This is because of the way the underlying change notifier service is implemented; the changes reported are those defined by the TChanges enum.
To stop the environment change notifier, an application must:
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License v1.0.