QGCToolWidgetItem.h 1.01 KB
Newer Older
1 2 3 4 5
#ifndef QGCTOOLWIDGETITEM_H
#define QGCTOOLWIDGETITEM_H

#include <QWidget>
#include <QAction>
lm's avatar
lm committed
6
#include <QSettings>
7

8 9
#include "UASInterface.h"

10 11 12 13
class QGCToolWidgetItem : public QWidget
{
    Q_OBJECT
public:
14
    QGCToolWidgetItem(const QString& name, QWidget *parent = 0);
15 16 17 18 19 20 21 22
    ~QGCToolWidgetItem();

    int component() {return _component;}

public slots:
    virtual void startEditMode() {}
    virtual void endEditMode() {}
    virtual void setComponent(int comp) {_component = comp;}
lm's avatar
lm committed
23 24
    virtual void writeSettings(QSettings& settings) = 0;
    virtual void readSettings(const QSettings& settings) = 0;
25
    void setActiveUAS(UASInterface *uas);
26

lm's avatar
lm committed
27 28 29
signals:
    void editingFinished();

30 31 32
protected:
    QAction* startEditAction;
    QAction* stopEditAction;
lm's avatar
lm committed
33
    QAction* deleteAction;
34
    bool isInEditMode;
35 36
    QString qgcToolWidgetItemName;
    UASInterface* uas;
37 38 39 40 41 42 43
    int _component;          ///< The MAV component (the process or device ID)

    void contextMenuEvent (QContextMenuEvent* event);

};

#endif // QGCTOOLWIDGETITEM_H