UASMessageView.h 1.35 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
9 10


11 12 13 14 15 16 17
#ifndef QGCMESSAGEVIEW_H
#define QGCMESSAGEVIEW_H

#include <QWidget>
#include <UASInterface.h>
#include <QVBoxLayout>
#include <QAction>
18

19
#include "QGCUnconnectedInfoWidget.h"
20
#include "UASMessageHandler.h"
21

22
class UASMessage;
23

24
namespace Ui {
25
class UASMessageView;
26 27
}

28
// Message View base class
29
class UASMessageView : public QWidget
30 31
{
    Q_OBJECT
dogmaphobic's avatar
dogmaphobic committed
32

33
public:
34 35 36
    explicit UASMessageView(QWidget *parent = 0);
    virtual ~UASMessageView();
    Ui::UASMessageView* ui() { return _ui; }
37

38
private:
39
    Ui::UASMessageView* _ui;
40
};
41

42
// Message View Widget (used in the Info View tabbed Widget)
43
class UASMessageViewWidget : public UASMessageView
44 45
{
    Q_OBJECT
46

47
public:
48
    explicit UASMessageViewWidget(UASMessageHandler* uasMessageHandler, QWidget *parent = 0);
49
    ~UASMessageViewWidget();
50

51
public slots:
52
    void handleTextMessage(UASMessage* message);
53
    void clearMessages();
54

55
private:
56 57
    QGCUnconnectedInfoWidget*   _unconnectedWidget;
    UASMessageHandler*          _uasMessageHandler;
58
};
59 60

#endif // QGCMESSAGEVIEW_H