source: flair-src/trunk/lib/FlairCore/src/ListWidget.h@ 456

Last change on this file since 456 was 88, checked in by Sanahuja Guillaume, 5 years ago

m

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