33
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2006 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: Notifies the changes in publish and suscripe properties.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef CSATPSCHANGENOTIFIER_H
|
|
21 |
#define CSATPSCHANGENOTIFIER_H
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include <e32base.h>
|
|
25 |
#include <e32property.h>
|
|
26 |
#include "MSatSystemStateChangeNotifier.h"
|
|
27 |
|
|
28 |
// FORWARD DECLARATION
|
|
29 |
class MSatSystemStateObserver;
|
|
30 |
|
|
31 |
// CLASS DECLARATION
|
|
32 |
|
|
33 |
/**
|
|
34 |
* Notifies the changes in publish and suscripe properties.
|
|
35 |
*
|
|
36 |
* @lib SatSystemState
|
|
37 |
* @since Series 60 3.0
|
|
38 |
*/
|
|
39 |
class CSatPSChangeNotifier : public CActive,
|
|
40 |
public MSatSystemStateChangeNotifier
|
|
41 |
{
|
|
42 |
public: // Constructors and destructor
|
|
43 |
|
|
44 |
/**
|
|
45 |
* Two-phased constructor.
|
|
46 |
* @param aPropertyKey This is the P&S key.
|
|
47 |
* @param aPropertyValue Value of the P&S key.
|
|
48 |
* @param aObserver A class that is notified when value changes.
|
|
49 |
* @param aNotifyValue Defines the value that causes the notification.
|
|
50 |
*/
|
|
51 |
static CSatPSChangeNotifier* NewL(
|
|
52 |
const TUid& aPropertyKey,
|
|
53 |
TUint aPropertyValue,
|
|
54 |
MSatSystemStateObserver& aObserver,
|
|
55 |
TInt aNotifyValue = -1 );
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Destructor.
|
|
59 |
*/
|
|
60 |
virtual ~CSatPSChangeNotifier();
|
|
61 |
|
|
62 |
public: // Functions from base classes
|
|
63 |
|
|
64 |
/**
|
|
65 |
* From MSatSystemStateChangeNotifier Request a notification of a
|
|
66 |
* change in system state.
|
|
67 |
*/
|
|
68 |
void NotifyChangeL();
|
|
69 |
|
|
70 |
/**
|
|
71 |
* From MSatSystemStateChangeNotifier Cancels the notification request.
|
|
72 |
*/
|
|
73 |
void CancelNotify();
|
|
74 |
|
|
75 |
/**
|
|
76 |
* From MSatSystemStateChangeNotifier Gets the current value.
|
|
77 |
* @return Current value for earlier request.
|
|
78 |
*/
|
|
79 |
TInt GetValueInt();
|
|
80 |
|
|
81 |
protected: // Functions from base classes
|
|
82 |
|
|
83 |
/**
|
|
84 |
* From CActive
|
|
85 |
*/
|
|
86 |
void DoCancel();
|
|
87 |
|
|
88 |
/**
|
|
89 |
* From CActive.
|
|
90 |
*/
|
|
91 |
void RunL();
|
|
92 |
|
|
93 |
private: // New methods
|
|
94 |
|
|
95 |
/**
|
|
96 |
* Makes the request and activates the active object.
|
|
97 |
*/
|
|
98 |
void Activate();
|
|
99 |
|
|
100 |
private:
|
|
101 |
|
|
102 |
/**
|
|
103 |
* C++ default constructor.
|
|
104 |
* @param aPropertyKey This is the P&S key.
|
|
105 |
* @param aPropertyValue Value of the P&S key.
|
|
106 |
* @param aObserver A class that is notified when value changes.
|
|
107 |
* @param aNotifyValue Defines the value that causes the notification.
|
|
108 |
*/
|
|
109 |
CSatPSChangeNotifier(
|
|
110 |
const TUid& aPropertyKey,
|
|
111 |
TUint aPropertyValue,
|
|
112 |
MSatSystemStateObserver& aObserver,
|
|
113 |
TInt aNotifyValue );
|
|
114 |
|
|
115 |
private: // Data
|
|
116 |
|
|
117 |
// Change observer.
|
|
118 |
MSatSystemStateObserver& iObserver;
|
|
119 |
|
|
120 |
// Publish & suscripe handle.
|
|
121 |
RProperty iPSClient;
|
|
122 |
|
|
123 |
// Publish&Suscripe property key
|
|
124 |
TUid iPSKey;
|
|
125 |
|
|
126 |
// Publish&Suscripe property value
|
|
127 |
TUint iPSValue;
|
|
128 |
|
|
129 |
// Value of the property when observer should be notified
|
|
130 |
// If this is not set, the changed value is sent to observer
|
|
131 |
TInt iNotifyValue;
|
|
132 |
|
|
133 |
};
|
|
134 |
|
|
135 |
#endif // CSATPSCHANGENOTIFIER_H
|
|
136 |
|
|
137 |
// End of File
|