| 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 Layout.h
|
---|
| 7 | * \brief Abstract class to display a layout on the ground station
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2011/10/07
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef LAYOUT_H
|
---|
| 14 | #define LAYOUT_H
|
---|
| 15 |
|
---|
| 16 | #include <Widget.h>
|
---|
| 17 | #include <Mutex.h>
|
---|
| 18 |
|
---|
| 19 | namespace flair
|
---|
| 20 | {
|
---|
| 21 | namespace gui
|
---|
| 22 | {
|
---|
| 23 | class LayoutPosition;
|
---|
| 24 |
|
---|
| 25 | /*! \class Layout
|
---|
| 26 | *
|
---|
| 27 | * \brief Abstract class to display a layout on the ground station
|
---|
| 28 | *
|
---|
| 29 | * This is an abstract class to display layouts (like GridLayout, GroupBox, etc). \n
|
---|
| 30 | * A layout can contains Widgets (Box, DataPlot, Picture, etc). \n
|
---|
| 31 | * Layout holds a Mutex, which can be used to protect access to Box's value for example.
|
---|
| 32 | */
|
---|
| 33 | class Layout: public Widget
|
---|
| 34 | {
|
---|
| 35 | friend class Box;
|
---|
| 36 |
|
---|
| 37 | public:
|
---|
| 38 | /*!
|
---|
| 39 | * \brief Constructor
|
---|
| 40 | *
|
---|
| 41 | * Construct a Layout. Type is a predifined one, and will be
|
---|
| 42 | * interpreted by the ground station.
|
---|
| 43 | *
|
---|
| 44 | * \param parent parent
|
---|
| 45 | * \param name name
|
---|
| 46 | * \param type type of layout
|
---|
| 47 | */
|
---|
| 48 | Layout(const Widget* parent,std::string name,std::string type);
|
---|
| 49 |
|
---|
| 50 | /*!
|
---|
| 51 | * \brief Destructor
|
---|
| 52 | *
|
---|
| 53 | */
|
---|
| 54 | ~Layout();
|
---|
| 55 |
|
---|
| 56 | /*!
|
---|
| 57 | * \brief Last Row and Col LayoutPosition
|
---|
| 58 | *
|
---|
| 59 | * Get a LayoutPosition at the last row and col.
|
---|
| 60 | *
|
---|
| 61 | * \return the LayoutPosition
|
---|
| 62 | */
|
---|
| 63 | LayoutPosition* LastRowLastCol(void) const;
|
---|
| 64 |
|
---|
| 65 | /*!
|
---|
| 66 | * \brief New Row LayoutPosition
|
---|
| 67 | *
|
---|
| 68 | * Get a LayoutPosition at a new row and first col. This new row will be at the last position.
|
---|
| 69 | *
|
---|
| 70 | * \return the LayoutPosition
|
---|
| 71 | */
|
---|
| 72 | LayoutPosition* NewRow(void) const;
|
---|
| 73 |
|
---|
| 74 | /*!
|
---|
| 75 | * \brief LayoutPosition at specified position
|
---|
| 76 | *
|
---|
| 77 | * Get a LayoutPosition at specified row and col.
|
---|
| 78 | *
|
---|
| 79 | * \param row row
|
---|
| 80 | * \param col col
|
---|
| 81 | *
|
---|
| 82 | * \return the LayoutPosition
|
---|
| 83 | */
|
---|
| 84 | LayoutPosition* At(uint16_t row,uint16_t col) const;
|
---|
| 85 |
|
---|
| 86 | private:
|
---|
| 87 | /*!
|
---|
| 88 | * \brief Mutex
|
---|
| 89 | *
|
---|
| 90 | * This Mutex can be used by friends class like Box to protect access
|
---|
| 91 | * to Box's value.
|
---|
| 92 | */
|
---|
| 93 | core::Mutex* mutex;
|
---|
| 94 | };
|
---|
| 95 |
|
---|
| 96 | } // end namespace gui
|
---|
| 97 | } // end namespace flair
|
---|
| 98 |
|
---|
| 99 | #endif // LAYOUT_H
|
---|