0029025: TInspector include files are not installed to inc directory by CMake
[occt.git] / tools / VInspector / VInspector_ItemHistoryElement.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 VInspector_ItemHistoryElement_H
17 #define VInspector_ItemHistoryElement_H
18
19 #include <Standard.hxx>
20 #include <inspector/VInspector_ItemBase.hxx>
21
22 class VInspector_ItemHistoryElement;
23 typedef QExplicitlySharedDataPointer<VInspector_ItemHistoryElement> VInspector_ItemHistoryElementPtr;
24
25 //! \class VInspector_ItemHistoryElement
26 //! Item shows name, pointer and shape type values of item history type information
27 //! Parent is item history type, there are no children.
28 class VInspector_ItemHistoryElement : public VInspector_ItemBase
29 {
30
31 public:
32
33   //! Creates an item wrapped by a shared pointer
34   static VInspector_ItemHistoryElementPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
35   { return VInspector_ItemHistoryElementPtr (new VInspector_ItemHistoryElement (theParent, theRow, theColumn)); }
36
37   //! Destructor
38   virtual ~VInspector_ItemHistoryElement() Standard_OVERRIDE {};
39
40   //! Inits the item, fills internal containers
41   Standard_EXPORT virtual void Init() Standard_OVERRIDE;
42
43   //! Resets cached values
44   virtual void Reset() Standard_OVERRIDE { TreeModel_ItemBase::Reset(); }
45
46   //! Returns pointer string value
47   QString PointerInfo() const { return myPointerInfo; }
48
49   //! \return number of children.
50   virtual int initRowCount() const Standard_OVERRIDE { return 0; }
51
52   //! Returns item information for the given role. Fills internal container if it was not filled yet
53   //! \param theItemRole a value role
54   //! \return the value
55   Standard_EXPORT virtual QVariant initValue(const int theItemRole) const Standard_OVERRIDE;
56
57 protected:
58
59   //! Initialize the current item. It is empty because Reset() is also empty.
60   virtual void initItem() const Standard_OVERRIDE;
61
62   //! Creates a child item in the given position.
63   //! \param theRow the child row position
64   //! \param theColumn the child column position
65   //! \return the created item
66   virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE
67   { (void)theRow; (void)theColumn; return TreeModel_ItemBasePtr(); }
68
69   //! Returns the item text value, initialize item if it has not been initialized yet
70   QString getName() const;
71
72   //! Returns the item pointer value, initialize item if it has not been initialized yet
73   QString GetPointerInfo() const;
74
75   //! Returns the shape type text value, initialize item if it has not been initialized yet
76   QString GetShapeTypeInfo() const;
77
78 private:
79
80   //! Constructor
81   //! param theParent a parent item
82   VInspector_ItemHistoryElement(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
83   : VInspector_ItemBase(theParent, theRow, theColumn) {}
84
85 private:
86
87   QString myName;  //!< cached text value
88   QString myPointerInfo;  //!< cached pointer text value
89   QString myShapeTypeInfo;  //!<cached shape type text value 
90 };
91
92 #endif