0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
[occt.git] / src / Draw / Draw_ProgressIndicator.hxx
CommitLineData
42cf5bc1 1// Created on: 2008-06-25
2// Created by: data exchange team
3// Copyright (c) 2008-2014 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 _Draw_ProgressIndicator_HeaderFile
17#define _Draw_ProgressIndicator_HeaderFile
18
19#include <Standard.hxx>
42cf5bc1 20
42cf5bc1 21#include <Message_ProgressIndicator.hxx>
22#include <Draw_Interpretor.hxx>
23
42cf5bc1 24class Draw_ProgressIndicator;
25DEFINE_STANDARD_HANDLE(Draw_ProgressIndicator, Message_ProgressIndicator)
26
27//! Implements ProgressIndicator (interface provided by Message)
28//! for DRAW, with possibility to output to TCL window
29//! and/or trace file
30class Draw_ProgressIndicator : public Message_ProgressIndicator
31{
32
33public:
34
35
36 //! Creates a progress indicator and remembers pointer to
37 //! Draw_Interpretor
38 //! The updateTime, if given, defines time interval between
39 //! updates of the indicator (in seconds)
40 Standard_EXPORT Draw_ProgressIndicator(const Draw_Interpretor& di, const Standard_Integer updateTime = 0);
41
42 //! Destructor; calls Reset()
43 Standard_EXPORT void Destroy();
44~Draw_ProgressIndicator()
45{
46 Destroy();
47}
48
49 //! Sets text output mode (on/off)
50 Standard_EXPORT void SetTextMode (const Standard_Boolean theTextMode);
51
52 //! Gets text output mode (on/off)
53 Standard_EXPORT Standard_Boolean GetTextMode() const;
54
55 //! Sets graphical output mode (on/off)
56 Standard_EXPORT void SetGraphMode (const Standard_Boolean theGraphMode);
57
58 //! Gets graphical output mode (on/off)
59 Standard_EXPORT Standard_Boolean GetGraphMode() const;
60
61 //! Clears/erases opened TCL windows if any
62 //! and sets myBreak to False
63 Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
64
65 //! Defines method Show of Progress Indicator
66 Standard_EXPORT virtual Standard_Boolean Show (const Standard_Boolean force = Standard_True) Standard_OVERRIDE;
67
68 //! Redefines method UserBreak of Progress Indicator
69 Standard_EXPORT virtual Standard_Boolean UserBreak() Standard_OVERRIDE;
70
71 Standard_EXPORT static Standard_Boolean& DefaultTextMode();
72
73 //! Get/Set default values for output modes
74 Standard_EXPORT static Standard_Boolean& DefaultGraphMode();
75
68299304 76 //! Internal method for implementation of UserBreak mechanism;
77 //! note that it uses static variable and thus not thread-safe!
78 Standard_EXPORT static Standard_Address& StopIndicator();
42cf5bc1 79
92efcf78 80 DEFINE_STANDARD_RTTIEXT(Draw_ProgressIndicator,Message_ProgressIndicator)
42cf5bc1 81
42cf5bc1 82private:
42cf5bc1 83 Standard_Boolean myTextMode;
84 Standard_Boolean myGraphMode;
85 Standard_Address myDraw;
86 Standard_Boolean myShown;
87 Standard_Boolean myBreak;
88 Standard_Integer myUpdateTime;
89 Standard_Size myLastUpdate;
90 Standard_Size myStartTime;
42cf5bc1 91};
92
42cf5bc1 93#endif // _Draw_ProgressIndicator_HeaderFile