dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
ipconnectionplugin.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  *
27  * Additional note on redistribution: The copyright and license notices above
28  * must be maintained in each individual source file that is a derivative work
29  * of this source file; otherwise redistribution is prohibited.
30  */
31 
32 #ifndef IPconnectionPLUGIN_H
33 #define IPconnectionPLUGIN_H
34 
35 #include "ipconnection_global.h"
38 #include "coreplugin/iconnection.h"
39 #include "ipdevice.h"
41 //#include <QtCore/QSettings>
42 
43 class QAbstractSocket;
44 class QTcpSocket;
45 class QUdpSocket;
46 
47 class IConnection;
53 class IPconnection_EXPORT IPConnection : public Core::IConnection
54 {
55  Q_OBJECT
56 public:
57  IPConnection();
58  virtual ~IPConnection();
59 
61  virtual QIODevice *openDevice(Core::IDevice *deviceName);
62  virtual void closeDevice(const QString &deviceName);
63 
64  virtual QString connectionName();
65  virtual QString shortName();
66 
67  IPConnectionOptionsPage *optionsPage() const { return m_optionspage; }
68 
69 protected slots:
70  void onEnumerationChanged();
71 
72 private:
73  void openDevice(QString HostName, int Port, bool UseTCP);
74  QAbstractSocket *ipSocket;
75  IPConnectionConfiguration *m_config;
76  IPConnectionOptionsPage *m_optionspage;
77  QList<Core::IDevice *> devices;
78  QString errorMsg;
79 };
80 
81 class IPconnection_EXPORT IPConnectionPlugin : public ExtensionSystem::IPlugin
82 {
83  Q_OBJECT
84  Q_PLUGIN_METADATA(IID "org.dronin.plugins.IPConnection")
85 public:
88 
89  virtual bool initialize(const QStringList &arguments, QString *error_message);
90  virtual void extensionsInitialized();
91 
92 private:
93  IPConnection *m_connection;
94 };
95 
96 #endif // IPconnectionPLUGIN_H
virtual QIODevice * openDevice(IDevice *device)=0
virtual void extensionsInitialized()=0
virtual void closeDevice(const QString &deviceName)
Definition: iconnection.h:61
virtual QList< IDevice * > availableDevices()=0
virtual QString connectionName()=0
IPConnectionOptionsPage * optionsPage() const
virtual bool initialize(const QStringList &arguments, QString *errorString)=0
virtual QString shortName()
Definition: iconnection.h:71
Base class for all plugins.
Definition: iplugin.h:45