source: flair-src/branches/mavlink/lib/FlairCore/src/ListWidget.h@ 63

Last change on this file since 63 was 63, checked in by Thomas Fuhrmann, 6 years ago

Save config on target and save all locally are now working

File size: 1.9 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5/*!
6 * \file ListWidget.h
7 * \brief Class displaying a QListWidget on the ground station
8 * \author Thomas Fuhrmann, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2016/07/26
10 * \version 1.0
11 */
12
13#ifndef LISTWIDGET_H
14#define LISTWIDGET_H
15
16#include <Widget.h>
17
18namespace flair {
19namespace gui {
20
21class LayoutPosition;
22
23/*! \class ListWidget
24 *
25 * \brief Class displaying a QListWidget on the ground station
26 *
27 * The internal list (called items) contains the same elements
28 * as the list of the QListWidget on the ground station.
29 * To do that, each action done on the ground station has to
30 * applied thanks to a click on the "apply" button.
31 *
32 */
33class ListWidget : public Widget {
34public:
35 /*!
36 * \brief Constructor
37 *
38 * Construct a QListWidget at given position.
39 *
40 * \param position position to display the QListWidget
41 * \param name name
42 */
43 ListWidget(const LayoutPosition *position, std::string name);
44
45 /*!
46 * \brief Destructor
47 *
48 */
49 ~ListWidget();
50
51 /*!
52 * \brief Add an item
53 *
54 * Add an item to the end of the list.
55 *
56 * \param name item nam
57 */
58 void AddItem(std::string name);
59
60 /*!
61 * \brief Remove an item
62 *
63 * Remove the currently selected item.
64 * The item is not removed from the internal xml file,
65 * because the xml is override by the GUI.
66 */
67 void RemoveItem(void);
68
69private:
70 /*!
71 * \brief XmlEvent from ground station
72 *
73 * Reimplemented from Widget.
74 *
75 */
76 void XmlEvent(void);
77
78 /**
79 * List of items displayed in the ground station.
80 */
81 std::vector<std::string> items;
82 /**
83 * Row of the item currently selected in the list.
84 */
85 uint16_t selectedItemRow;
86 /**
87 * Flag to know if the selected item has changed.
88 */
89 bool selectedItemChanged;
90};
91
92} // end namespace gui
93} // end namespace flair
94
95#endif // LISTWIDGET_H
Note: See TracBrowser for help on using the repository browser.