QGCToolWidgetItem.h 1.04 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
    ~QGCToolWidgetItem();

17 18 19
    int component() {
        return _component;
    }
20 21 22 23

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

lm's avatar
lm committed
31 32 33
signals:
    void editingFinished();

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

    void contextMenuEvent (QContextMenuEvent* event);

};

#endif // QGCTOOLWIDGETITEM_H