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

Last change on this file since 59 was 59, checked in by Thomas Fuhrmann, 5 years ago

Improve ListWidget? + code cleanup + doxygen comments

File size: 1.8 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  */
65  void RemoveItem(void);
66
67private:
68  /*!
69  * \brief XmlEvent from ground station
70  *
71  * Reimplemented from Widget.
72  *
73  */
74  void XmlEvent(void);
75
76  /**
77   * List of items displayed in the ground station.
78   */
79  std::vector<std::string> items;
80  /**
81   * Row of the item currently selected in the list.
82   */
83  uint16_t selectedItemRow;
84  /**
85   * Flag to know if the selected item has changed.
86   */
87  bool selectedItemChanged;
88};
89
90} // end namespace gui
91} // end namespace flair
92
93#endif // LISTWIDGET_H
Note: See TracBrowser for help on using the repository browser.