CTcpTerminalGuiComp.h
Go to the documentation of this file.
1 #ifndef iqtex_CTcpTerminalGuiComp_included
2 #define iqtex_CTcpTerminalGuiComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QTimer>
7 #include <QtNetwork/QTcpSocket>
8 
9 // ACF includes
10 #include "imod/IModel.h"
12 #include "ifile/IFileNameParam.h"
14 
15 #include "GeneratedFiles/iqtex/ui_CTcpTerminalGuiComp.h"
16 
17 
18 namespace iqtex
19 {
20 
21 
26  public iqtgui::TDesignerGuiCompBase<Ui::CTcpTerminalGuiComp>,
28 {
29  Q_OBJECT
30 
31 public:
33 
34  I_BEGIN_COMPONENT(CTcpTerminalGuiComp);
35  I_ASSIGN(m_urlParamCompPtr, "UrlParam", "URL parameter used to find out address and socket for TCP connection", true, "UrlParam");
36  I_ASSIGN_TO(m_urlParamModelCompPtr, m_urlParamCompPtr, false);
37  I_ASSIGN_MULTI_0(m_presetTextsAttrPtr, "PresetTexts", "Set of preset texts", false);
38  I_END_COMPONENT;
39 
41 
42 protected:
43  void UpdateStateIcon();
44 
45  // reimplemented (iqtgui::CGuiComponentBase)
46  virtual void OnGuiCreated();
47 
48  // reimplemented (imod::CSingleModelObserverBase)
49  virtual void OnUpdate(int updateFlags, istd::IPolymorphic* updateParamsPtr);
50 
51  // reimplemented (icomp::CComponentBase)
52  virtual void OnComponentCreated();
53  virtual void OnComponentDestroyed();
54 
55 protected slots:
56  void on_SendButton_clicked();
59  void OnReadyRead();
60  void OnConectTimer();
61  void OnStateChanged(QAbstractSocket::SocketState socketState);
62 
63 private:
64  I_REF(ifile::IFileNameParam, m_urlParamCompPtr);
65  I_REF(imod::IModel, m_urlParamModelCompPtr);
66  I_MULTIATTR(QString, m_presetTextsAttrPtr);
67 
68  QTimer m_connectTimer;
69  QTcpSocket m_socket;
70 
71  QIcon m_connectedIcon;
72  QIcon m_disconnectedIcon;
73 };
74 
75 
76 } // namespace iqtex
77 
78 
79 #endif // !iqtex_CTcpTerminalGuiComp_included
80 
81 
virtual void OnGuiCreated()
Implementation of simple TCP terminal.
iqtgui::TDesignerGuiCompBase< Ui::CTcpTerminalGuiComp > BaseClass
virtual void OnComponentCreated()
virtual void OnComponentDestroyed()
void OnStateChanged(QAbstractSocket::SocketState socketState)
I_ASSIGN_TO(m_urlParamModelCompPtr, m_urlParamCompPtr, false)
virtual void OnUpdate(int updateFlags, istd::IPolymorphic *updateParamsPtr)

© 2007-2011 Witold Gantzke and Kirill Lepskiy