CRegistryPreviewComp.h
Go to the documentation of this file.
1 #ifndef icmpstr_CRegistryPreviewComp_included
2 #define icmpstr_CRegistryPreviewComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QProcess>
7 #include <QtCore/QDir>
8 #if QT_VERSION >= 0x050000
9 #include <QtWidgets/QLabel>
10 #else
11 #include <QtGui/QLabel>
12 #endif
13 
14 // ACF includes
16 #include "ilog/TLoggerCompWrap.h"
17 #include "ifile/IFileNameParam.h"
18 
19 // ACF-Solutions includes
21 
22 
23 namespace icmpstr
24 {
25 
26 
28  public QObject,
30  public IRegistryPreview
31 {
32  Q_OBJECT
33 public:
35 
36  I_BEGIN_COMPONENT(CRegistryPreviewComp);
37  I_REGISTER_INTERFACE(icmpstr::IRegistryPreview);
38  I_ASSIGN(m_versionInfoCompPtr, "VersionInfo", "Version info used to serialize temporary registry file", false, "VersionInfo");
39  I_ASSIGN(m_commandFileNameCompPtr, "CommandFileName", "Parameter storing command file name", true, "CommandFileName");
40  I_ASSIGN(m_envManagerCompPtr, "EnvironmentManager", "Registry loader used to retrive package configuration", false, "EnvironmentManager");
41  I_END_COMPONENT;
42 
44 
45  // reimplemented (icmpstr::IRegistryPreview)
46  virtual bool StartRegistry(const icomp::IRegistry& registry);
47  virtual bool IsRunning() const;
48  virtual void AbortRegistry();
49 
50 protected:
51  // reimplemented (icomp::CComponentBase)
52  virtual void OnComponentCreated();
53  virtual void OnComponentDestroyed();
54 
55 protected Q_SLOTS:
56  void OnStateChanged(QProcess::ProcessState state);
59 
60 private:
61  QString m_tempFileName;
62  QProcess m_process;
63 
64  bool m_isRunning;
65 
66  I_REF(ifile::IFileNameParam, m_commandFileNameCompPtr);
67  I_REF(icomp::IComponentEnvironmentManager, m_envManagerCompPtr);
68  I_REF(iser::IVersionInfo, m_versionInfoCompPtr);
69 };
70 
71 
72 } // namespace icmpstr
73 
74 
75 #endif // !icmpstr_CRegistryPreviewComp_included
76 
77 
virtual void OnComponentCreated()
virtual bool IsRunning() const
Returns true if the registry registry is executing.
ilog::CLoggerComponentBase BaseClass
virtual void OnComponentDestroyed()
virtual void AbortRegistry()
Abort registry execution.
virtual bool StartRegistry(const icomp::IRegistry &registry)
Start registry execution.
void OnStateChanged(QProcess::ProcessState state)

© 2007-2011 Witold Gantzke and Kirill Lepskiy