|
1 /* |
|
2 * Copyright (c) 2009 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: The base class for listening to events in Publish & Subscribe or in |
|
15 * Central Repository |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CPROENGOBSERVERBASE_H |
|
22 #define CPROENGOBSERVERBASE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * The base class for listening to events in Publish & Subscribe or in |
|
31 * Central Repository. This is a helper class for CProEngNotifyHandlerImpl. |
|
32 * |
|
33 * @lib ProfileEngine.lib |
|
34 * @since 3.1 |
|
35 */ |
|
36 NONSHARABLE_CLASS( CProEngObserverBase ) : public CActive |
|
37 { |
|
38 protected: // constructor and destructor |
|
39 |
|
40 CProEngObserverBase( TUint32 aKey ); |
|
41 |
|
42 virtual ~CProEngObserverBase() {}; |
|
43 |
|
44 public: // New functions: |
|
45 |
|
46 /** |
|
47 * Absract method to request notifications from the source determined |
|
48 * by the subclass. This must be called once after the real observer |
|
49 * class is constructed. After that this is called by RunL() of this |
|
50 * class. |
|
51 * @return KErrNone if succeed, otherwise a system-wide error code. |
|
52 */ |
|
53 virtual TInt RequestNotification() = 0; |
|
54 |
|
55 /** |
|
56 * Abstract method to send notification to the observer. |
|
57 */ |
|
58 virtual void NotifyObserverL() = 0; |
|
59 |
|
60 /** |
|
61 * Abstract method to send notification about the given error to the |
|
62 * observer. |
|
63 * @param aError the error code to be delivered to the observer. |
|
64 */ |
|
65 virtual void NotifyError( TInt aError ) = 0; |
|
66 |
|
67 private: // Functions from base classes |
|
68 |
|
69 /** |
|
70 * From CActive. |
|
71 */ |
|
72 void RunL(); |
|
73 |
|
74 protected: // Data: |
|
75 |
|
76 // The key to observe |
|
77 TUint32 iKey; |
|
78 |
|
79 }; |
|
80 |
|
81 #endif // CPROENGOBSERVERBASE_H |
|
82 |
|
83 // End of File |
|
84 |