0029018: Documentation - Provide user guide for Qt browser
[occt.git] / tools / DFBrowser / DFBrowser_ItemApplication.hxx
CommitLineData
14bbbdcb 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 DFBrowser_ItemApplication_H
17#define DFBrowser_ItemApplication_H
18
0cb512c0 19#include <inspector/DFBrowser_ItemBase.hxx>
20
14bbbdcb 21#include <TDocStd_Application.hxx>
22
23class DFBrowser_ItemApplication;
24typedef QExplicitlySharedDataPointer<DFBrowser_ItemApplication> DFBrowser_ItemApplicationPtr;
25
26//! \class DFBrowser_ItemApplication
27//! \brief Declaration of the tree model root item.
28//! This item is connected to the main label of the document.
29class DFBrowser_ItemApplication : public DFBrowser_ItemBase
30{
31public:
32
33 //! Creates an item wrapped by a shared pointer
34 static DFBrowser_ItemApplicationPtr CreateItem (TreeModel_ItemBasePtr theParent)
35 { return DFBrowser_ItemApplicationPtr (new DFBrowser_ItemApplication (theParent)); }
36
37 //! Destructor
38 virtual ~DFBrowser_ItemApplication() Standard_OVERRIDE {};
39
40 //! Sets the item label
41 //! \param theLabel an object where the child items structure is found
42 void SetApplication (const Handle(TDocStd_Application)& theApplication) { myApplication = theApplication; }
43
44 //! Returns the current label
45 //! \return a label
46 const Handle(TDocStd_Application)& GetApplication() const { return myApplication; }
47
48protected:
49
50 //! Returns number of documents if the application is not NULL
51 //! \return rows count
52 virtual int initRowCount() const Standard_OVERRIDE;
53
54 //! Returns fixed item text or empty.
55 //! \param theItemRole a value role
56 //! \return the value
57 virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
58
59protected:
60
61 //! Creates a child item in the given position.
62 //! \param theRow the child row position
63 //! \param theColumn the child column position
64 //! \return the created item
65 virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE;
66
67private:
68
69 //! Constructor
70 //! param theParent a parent item
71 DFBrowser_ItemApplication(TreeModel_ItemBasePtr theParent) : DFBrowser_ItemBase(theParent, 0, 0) {}
72
73private:
74
75 Handle(TDocStd_Application) myApplication; //!<! OCAF application
76};
77
78#endif