|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSIPSYSTEMSTATEMONITORAO_H |
|
20 #define CSIPSYSTEMSTATEMONITORAO_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <sipsystemstateobserver.h> |
|
24 #include <sipsystemstatemonitor.h> |
|
25 #include <e32property.h> |
|
26 #include <e32base.h> |
|
27 |
|
28 |
|
29 // CLASS DECLARATION |
|
30 class CSipSystemStateMonitorAo : public CActive |
|
31 { |
|
32 public: // Constructors and destructor |
|
33 |
|
34 static CSipSystemStateMonitorAo* NewL(); |
|
35 |
|
36 ~CSipSystemStateMonitorAo(); |
|
37 |
|
38 public: // New functions |
|
39 |
|
40 CSipSystemStateMonitor::TSystemState State() const; |
|
41 |
|
42 void AddObserverL( MSipSystemStateObserver& aObserver ); |
|
43 void RemoveObserver( MSipSystemStateObserver& aObserver ); |
|
44 |
|
45 private: // Constructors |
|
46 |
|
47 CSipSystemStateMonitorAo(); |
|
48 void ConstructL (); |
|
49 |
|
50 private: // From CActive |
|
51 |
|
52 void RunL(); |
|
53 TInt RunError( TInt aError ); |
|
54 void DoCancel(); |
|
55 |
|
56 private: // New functions |
|
57 |
|
58 void NotifyObservers(); |
|
59 TBool IsSystemReady( TInt aSystemState ) const; |
|
60 |
|
61 private: // Data |
|
62 |
|
63 RProperty iProperty; |
|
64 // Observers not owned |
|
65 RPointerArray<MSipSystemStateObserver> iObservers; |
|
66 CSipSystemStateMonitor::TSystemState iState; |
|
67 |
|
68 private: // For testing purposes |
|
69 |
|
70 friend class CSipSystemStateMonitorImplTest; |
|
71 friend class CSipSystemStateMonitorAoTest; |
|
72 }; |
|
73 |
|
74 #endif //CSIPSYSTEMSTATEMONITORAO_H |
|
75 |