|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef PROFILER_STATUS_CHECKER_H |
|
19 #define PROFILER_STATUS_CHECKER_H |
|
20 |
|
21 #include <e32std.h> |
|
22 #include <e32base.h> |
|
23 #include <e32property.h> // RProperty |
|
24 |
|
25 // CONSTANTS |
|
26 const TUid KEngineStatusPropertyCat = { 0x2001E5AD }; |
|
27 enum TEnginePropertyKeys |
|
28 { |
|
29 EProfilerEngineStatus = 8 |
|
30 }; |
|
31 |
|
32 // CLASS DECLARATIONS |
|
33 class MProfilerStatusObserver |
|
34 { |
|
35 public: // Enums |
|
36 enum KProfilerStatus |
|
37 { |
|
38 EIdle = 0, |
|
39 EInitializing, |
|
40 ERunning, |
|
41 EStopping, |
|
42 ERestarting |
|
43 }; |
|
44 |
|
45 public: // New |
|
46 virtual void HandleProfilerStatusChange( |
|
47 KProfilerStatus aStatus ) = 0; |
|
48 virtual void HandleProfilerErrorL( |
|
49 TInt aError ) = 0; |
|
50 }; |
|
51 |
|
52 |
|
53 class CProfilerEngineStatusChecker : public CActive |
|
54 { |
|
55 public: |
|
56 inline static CProfilerEngineStatusChecker* CProfilerEngineStatusChecker::NewL(); |
|
57 inline ~CProfilerEngineStatusChecker(); |
|
58 inline void SetObserver(MProfilerStatusObserver* aObserver); |
|
59 inline TInt GetInitialState(); |
|
60 private: |
|
61 inline CProfilerEngineStatusChecker(); |
|
62 inline void ConstructL(); |
|
63 inline void RunL(); |
|
64 inline void DoCancel(); |
|
65 private: |
|
66 TInt iPrevStat; |
|
67 MProfilerStatusObserver* iObserver; |
|
68 RProperty iEngineStatus; |
|
69 }; |
|
70 |
|
71 #include <piprofiler/ProfilerEngineStatusChecker.inl> |
|
72 |
|
73 |
|
74 #endif // PROFILER_STATUS_CHECKER_H |