0031362: Inspectors - MessageView plugin for message alerts
[occt.git] / tools / VInspector / VInspector_ViewModelHistory.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_ViewModelHistory_H
17 #define VInspector_ViewModelHistory_H
18
19 #include <Standard.hxx>
20 #include <inspector/VInspector_ItemBase.hxx>
21 #include <inspector/VInspector_CallBackMode.hxx>
22
23 #include <Standard_WarningsDisable.hxx>
24 #include <QByteArray>
25 #include <QHash>
26 #include <QMap>
27 #include <QObject>
28 #include <Standard_WarningsRestore.hxx>
29
30 #include <inspector/TreeModel_ModelBase.hxx>
31
32 //! \class VInspector_ViewModelHistory
33 //! The class that visualizes methods called in AIS interactive context.
34 class VInspector_ViewModelHistory : public TreeModel_ModelBase
35 {
36   Q_OBJECT
37
38 public:
39
40   //! Constructor
41   Standard_EXPORT VInspector_ViewModelHistory (QObject* theParent, const int theHistoryTypesMaxAmount = 50);
42
43   //! Destructor
44   virtual ~VInspector_ViewModelHistory() {}
45
46   //! Creates model columns and root items.
47   Standard_EXPORT virtual void InitColumns() Standard_OVERRIDE;
48
49   //! Append new element under the root item
50   Standard_EXPORT void AddElement (const VInspector_CallBackMode& theMode, const QList<QVariant>& theInfo);
51
52   //! Returns container of pointer information for selected presentation or owner item
53   //! \param theIndex an index of tree view model
54   //! \param container of strings
55   Standard_EXPORT QStringList GetSelectedPointers (const QModelIndex& theIndex);
56
57 protected:
58
59   //! Creates root item
60   //! \param theColumnId index of a column
61   Standard_EXPORT virtual TreeModel_ItemBasePtr createRootItem (const int theColumnId) Standard_OVERRIDE;
62
63 private:
64   int myHistoryTypesMaxAmount; //!< maximum types in history
65 };
66
67 #endif