|
1 /* |
|
2 * Copyright (c) 2006-2007 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: CCFEcomObserver class implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CFECOMOBSERVER_H |
|
20 #define CFECOMOBSERVER_H |
|
21 |
|
22 #include <e32base.h> // For CActive, link against: euser.lib |
|
23 |
|
24 #include <e32std.h> |
|
25 #include <ecom/ecom.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MCFStateObserver; |
|
29 class CPeriodic; |
|
30 |
|
31 class CCFEComObserver : public CActive |
|
32 { |
|
33 public: |
|
34 // Cancel and destroy |
|
35 ~CCFEComObserver( ); |
|
36 |
|
37 // Two-phased constructor. |
|
38 static CCFEComObserver* NewL( ); |
|
39 |
|
40 // Two-phased constructor. |
|
41 static CCFEComObserver* NewLC( ); |
|
42 |
|
43 public: // New functions |
|
44 |
|
45 /** |
|
46 * Adds a new observer for plugin notifications. |
|
47 * @param aObserver Observer pointer. |
|
48 */ |
|
49 void AddObserverL( MCFStateObserver* aObserver ); |
|
50 |
|
51 private: |
|
52 |
|
53 // Start observing ecom notification |
|
54 void StartObserving( ); |
|
55 |
|
56 private: |
|
57 |
|
58 CCFEComObserver( ); |
|
59 void ConstructL( ); |
|
60 |
|
61 private: // From CActive |
|
62 |
|
63 // Handle completion |
|
64 void RunL( ); |
|
65 |
|
66 // How to cancel me |
|
67 void DoCancel( ); |
|
68 |
|
69 // Override to handle leaves from RunL(). Default implementation causes |
|
70 // the active scheduler to panic. |
|
71 TInt RunError( TInt aError ); |
|
72 |
|
73 private: |
|
74 |
|
75 // Notifies observers |
|
76 void NotifyObservers(); |
|
77 |
|
78 private: |
|
79 |
|
80 // Own: ECom session handle (must be closed, not deleted) |
|
81 REComSession* iEComSession; |
|
82 |
|
83 // Own: Observers - pointers not owned |
|
84 RPointerArray<MCFStateObserver> iObservers; |
|
85 }; |
|
86 |
|
87 #endif // CFECOMOBSERVER_H |
|
88 |