33
|
1 |
/*
|
|
2 |
* Copyright (c) 2004-2005 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: Interface for Active object handling Publish and subscribe
|
|
15 |
* notify events.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef CSSSETTINGSACTIVEOBJECT_H
|
|
21 |
#define CSSSETTINGSACTIVEOBJECT_H
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include <e32base.h>
|
|
25 |
#include <e32property.h>
|
|
26 |
|
|
27 |
|
|
28 |
// CLASS DECLARATION
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Interface for Publish and Subscribe notify.
|
|
32 |
*
|
|
33 |
* @since 3.0
|
|
34 |
* @lib SsSettings.lib
|
|
35 |
*/
|
|
36 |
class MSSSettingsPubSubNotify
|
|
37 |
{
|
|
38 |
public: // New functions
|
|
39 |
|
|
40 |
virtual void HandlePubSubNotify(
|
|
41 |
const TUid aUid,
|
|
42 |
const TUint32 aKeyId ) = 0;
|
|
43 |
};
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Interface for Active object handling Publish and subscribe notify events.
|
|
47 |
* @lib sssettings.lib
|
|
48 |
* @since 3.0
|
|
49 |
*/
|
|
50 |
NONSHARABLE_CLASS( CSSSettingsActiveObject )
|
|
51 |
: public CActive
|
|
52 |
{
|
|
53 |
public: // Constructors and destructor
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Two-phased constructor.
|
|
57 |
*
|
|
58 |
* @param aNotifyUid The Uid to be notified.
|
|
59 |
* @param aNotifyKey The key under aNotifyUid to be notified.
|
|
60 |
* @param aNotifyHandler The notifier to be informed about notify events.
|
|
61 |
* @return CSSSettingsActiveObject instance pointer.
|
|
62 |
*/
|
|
63 |
static CSSSettingsActiveObject* NewL(
|
|
64 |
const TUid aNotifyUid,
|
|
65 |
const TUint32 aNotifyKey,
|
|
66 |
MSSSettingsPubSubNotify& aNotifyHandler );
|
|
67 |
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Destructor.
|
|
71 |
*/
|
|
72 |
virtual ~CSSSettingsActiveObject();
|
|
73 |
|
|
74 |
|
|
75 |
public: // New functions
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Starts the notify.
|
|
79 |
*
|
|
80 |
* @return Error code.
|
|
81 |
*/
|
|
82 |
TInt NotifyKeyChange();
|
|
83 |
|
|
84 |
/**
|
|
85 |
* Cancel notify
|
|
86 |
*/
|
|
87 |
void CancelNotify();
|
|
88 |
|
|
89 |
|
|
90 |
protected: // Functions from base classes
|
|
91 |
|
|
92 |
/**
|
|
93 |
* From CActive.
|
|
94 |
*/
|
|
95 |
void RunL();
|
|
96 |
|
|
97 |
/**
|
|
98 |
* From CActive.
|
|
99 |
*/
|
|
100 |
void DoCancel();
|
|
101 |
|
|
102 |
|
|
103 |
private:
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Constructor.
|
|
107 |
*/
|
|
108 |
CSSSettingsActiveObject(
|
|
109 |
const TUid aNotifyUid,
|
|
110 |
const TUint32 aNotifyKey,
|
|
111 |
MSSSettingsPubSubNotify& aNotifyHandler );
|
|
112 |
|
|
113 |
/**
|
|
114 |
* By default Symbian OS constructor is private.
|
|
115 |
*/
|
|
116 |
void ConstructL();
|
|
117 |
|
|
118 |
|
|
119 |
private: // Data
|
|
120 |
|
|
121 |
// Central Repository.
|
|
122 |
RProperty iProperty;
|
|
123 |
|
|
124 |
// Uid to be notified.
|
|
125 |
TUid iNotifyUid;
|
|
126 |
|
|
127 |
// Key to be notified.
|
|
128 |
TUint32 iNotifyKey;
|
|
129 |
|
|
130 |
// Notify handler.
|
|
131 |
MSSSettingsPubSubNotify* iNotifyHandler;
|
|
132 |
|
|
133 |
// The notify information.
|
|
134 |
TBool iNotify;
|
|
135 |
};
|
|
136 |
|
|
137 |
#endif // CSSSETTINGSACTIVEOBJECT_H
|
|
138 |
|
|
139 |
// End of File
|