2 ******************************************************************************
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
7 * @addtogroup GCSPlugins GCS Plugins
9 * @addtogroup CorePlugin Core Plugin
11 * @brief The Core GCS plugin
12 *****************************************************************************/
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.
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
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 #include <QtCore/QStringList>
34 #include <QtCore/QIODevice>
36 #include "core_global.h"
40 * An IConnection object define a "type of connection",
41 * for instance USB, Serial, Network, ...
43 class CORE_EXPORT IConnection
: public QObject
{
48 * Return the list of devices found on the system
53 bool operator==(device i
)
55 return this->name
== i
.name
;
59 virtual QList
<device
> availableDevices() = 0;
62 * Open a device, and return a QIODevice interface from it
63 * It should be a dynamically created object as it will be
64 * deleted by the connection manager.
66 virtual QIODevice
*openDevice(const QString
&deviceName
) = 0;
68 virtual void closeDevice(const QString
&deviceName
)
74 * Connection type name "USB HID"
76 virtual QString
connectionName() = 0;
79 * Short name to display in a combo box
81 virtual QString
shortName()
83 return connectionName();
87 * Manage whether the plugin is allowed to poll for devices
90 virtual void suspendPolling() {};
91 virtual void resumePolling() {};
95 * Available devices list has changed, signal it to connection manager (and whoever wants to know)
97 void availableDevChanged(IConnection
*);
101 #endif // ICONNECTION_H