0029018: Documentation - Provide user guide for Qt browser
[occt.git] / tools / DFBrowserPane / DFBrowserPane_HelperArray.hxx
1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement. 
15
16 #ifndef DFBrowserPane_HelperArray_H
17 #define DFBrowserPane_HelperArray_H
18
19 #include <Standard.hxx>
20 #include <TDF_Attribute.hxx>
21
22 class DFBrowserPane_AttributePaneModel;
23 class DFBrowserPane_TableView;
24
25 class QWidget;
26
27 #ifdef _MSC_VER
28 #pragma warning(disable : 4127) // conditional expression is constant
29 #endif
30 #include <QList>
31 #include <QVariant>
32
33 //! \class DFBrowserPane_HelperArray
34 //! \brief Class that is used for list and array attributes. Two tables, the first for bounds, the second for values.
35 //! Bound table contains two values: Lower and Upper values of the container.
36 //! So, the first and the second values in GetValue() are these bounds, other values are used to fill usual table view.
37 class DFBrowserPane_HelperArray
38 {
39 public:
40
41   //! Constructor
42   Standard_EXPORT DFBrowserPane_HelperArray(DFBrowserPane_AttributePaneModel* theValuesModel);
43
44   //! Destructor
45   virtual ~DFBrowserPane_HelperArray() {}
46
47   //! Creates bounds table view and grid layout, where the bounds view and the values view are shown
48   //! \param theParent a parent widget
49   //! \param theValuesView a view of values(table view filled by myValuesModel)
50   Standard_EXPORT void CreateWidget(QWidget* theParent, DFBrowserPane_TableView* theValuesView);
51
52   //! Fills bounds model by firsth and second values, fills values model by left values
53   //! \param theValues values to fill views
54   Standard_EXPORT void Init(const QList<QVariant>& theValues);
55
56   //! Returns only values of values view model
57   //! \param theAttribute a current attribute
58   //! \param theValues a container of result values
59   Standard_EXPORT virtual void GetShortAttributeInfo(const Handle(TDF_Attribute)& theAttribute, QList<QVariant>& theValues);
60
61 private:
62
63   DFBrowserPane_AttributePaneModel* myValuesModel; //!< model of table view
64   DFBrowserPane_AttributePaneModel* myBoundsModel; //!< model of bounds view
65   DFBrowserPane_TableView* myArrayBounds; //!< bounds view
66   DFBrowserPane_TableView* myValuesView; //!< values view
67 };
68 #endif