26
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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 PIPROFILEREGINE_H
|
|
19 |
#define PIPROFILEREGINE_H
|
|
20 |
|
|
21 |
#include <qobject.h>
|
|
22 |
#include <qlist.h>
|
|
23 |
|
|
24 |
#include "pluginattributes.h"
|
|
25 |
|
|
26 |
class PIProfilerEnginePrivate;
|
|
27 |
class GeneralAttributes;
|
|
28 |
|
|
29 |
enum ProfilerEngineStatus
|
|
30 |
{
|
|
31 |
PI_PROFILING = 0, PI_FINISHED_SUCCEFULLY, PI_ERROR
|
|
32 |
};
|
|
33 |
enum ProfilingMode
|
|
34 |
{
|
|
35 |
PI_PROFILINGMODENORMAL = 0, PI_PROFILINGMODETIMED
|
|
36 |
};
|
|
37 |
enum ProfilingOutput
|
|
38 |
{
|
|
39 |
PI_DEBUG_OUTPUT = 0, PI_FILE_OUTPUT
|
|
40 |
};
|
|
41 |
|
|
42 |
class PIProfilerEngine: public QObject
|
|
43 |
{
|
|
44 |
Q_OBJECT
|
|
45 |
public:
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Constructor
|
|
49 |
*/
|
|
50 |
PIProfilerEngine();
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Initilises engine
|
|
54 |
*/
|
|
55 |
bool init();
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Destructor
|
|
59 |
*/
|
|
60 |
~PIProfilerEngine();
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Gets PI Profiler general settings
|
|
64 |
*/
|
|
65 |
void getGeneralSettings(GeneralAttributes &settings);
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Notifys engine that ui is ready
|
|
69 |
*/
|
|
70 |
void notifyUIReady();
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Saves general settings into engine
|
|
74 |
*/
|
|
75 |
bool saveGeneralSettings(GeneralAttributes &settings);
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Saves plug-in settings into engine
|
|
79 |
*/
|
|
80 |
bool savePluginSettings(const PluginAttributes &pluginAttributes);
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Starts normal profiling
|
|
84 |
*/
|
|
85 |
bool startProfiling();
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Starts timed profiling
|
|
89 |
*/
|
|
90 |
bool startTimedProfiling();
|
|
91 |
|
|
92 |
/**
|
|
93 |
* Stops profiling
|
|
94 |
*/
|
|
95 |
void stopProfiling();
|
|
96 |
|
|
97 |
/**
|
|
98 |
* gets time limit for timed profiling
|
|
99 |
*/
|
|
100 |
int getTimeLimit();
|
|
101 |
|
|
102 |
/**
|
|
103 |
* Sets PI profiler engine to continue running after ui is closed.
|
|
104 |
*/
|
|
105 |
void leaveProfilingOnAfterClosing();
|
|
106 |
|
|
107 |
bool checkTraceLocationSanity(QString &location);
|
|
108 |
|
|
109 |
signals:
|
|
110 |
|
|
111 |
/**
|
|
112 |
* Signal that is emitted when plug-in list is loaded
|
|
113 |
*/
|
|
114 |
void pluginListUpdated(QList<PluginAttributes> &samplerList);
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Signal that is emitted when profiling status is changed
|
|
118 |
*/
|
|
119 |
void profilingStatusChanged(ProfilerEngineStatus status, const QString &text = 0,
|
|
120 |
ProfilingMode profilingMode = PI_PROFILINGMODENORMAL, ProfilingOutput output =
|
|
121 |
PI_FILE_OUTPUT);
|
|
122 |
|
|
123 |
private:
|
|
124 |
|
|
125 |
// private implementation
|
|
126 |
PIProfilerEnginePrivate *mPrivate;
|
|
127 |
|
|
128 |
private:
|
|
129 |
// Friend classes
|
|
130 |
|
|
131 |
friend class PIProfilerEnginePrivate;
|
|
132 |
|
|
133 |
};
|
|
134 |
|
|
135 |
#endif // PIPROFILEREGINE_H
|