1 // Created on: 2001-01-06
2 // Created by: OCC Team
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _Message_Printer_HeaderFile
17 #define _Message_Printer_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <Message_Gravity.hxx>
23 #include <Standard_Transient.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_CString.hxx>
26 class TCollection_ExtendedString;
27 class TCollection_AsciiString;
30 class Message_Printer;
31 DEFINE_STANDARD_HANDLE(Message_Printer, Standard_Transient)
33 //! Abstract interface class defining printer as output context for text messages
35 //! The message, besides being text string, has associated gravity
36 //! level, which can be used by printer to decide either to process a message or ignore it.
37 class Message_Printer : public Standard_Transient
39 DEFINE_STANDARD_RTTIEXT(Message_Printer, Standard_Transient)
42 //! Return trace level used for filtering messages;
43 //! messages with lover gravity will be ignored.
44 Message_Gravity GetTraceLevel() const { return myTraceLevel; }
46 //! Set trace level used for filtering messages.
47 //! By default, trace level is Message_Info, so that all messages are output
48 void SetTraceLevel (const Message_Gravity theTraceLevel) { myTraceLevel = theTraceLevel; }
50 //! Send a string message with specified trace level.
51 //! The last Boolean argument is deprecated and unused.
52 //! Default implementation redirects to send().
53 Standard_EXPORT virtual void Send (const TCollection_ExtendedString& theString,
54 const Message_Gravity theGravity) const;
56 //! Send a string message with specified trace level.
57 //! The last Boolean argument is deprecated and unused.
58 //! Default implementation redirects to send().
59 Standard_EXPORT virtual void Send (const Standard_CString theString,
60 const Message_Gravity theGravity) const;
62 //! Send a string message with specified trace level.
63 //! The last Boolean argument is deprecated and unused.
64 //! Default implementation redirects to send().
65 Standard_EXPORT virtual void Send (const TCollection_AsciiString& theString,
66 const Message_Gravity theGravity) const;
70 //! Empty constructor with Message_Info trace level
71 Standard_EXPORT Message_Printer();
73 //! Send a string message with specified trace level.
74 //! This method must be redefined in descentant.
75 Standard_EXPORT virtual void send (const TCollection_AsciiString& theString,
76 const Message_Gravity theGravity) const = 0;
80 Message_Gravity myTraceLevel;
84 #endif // _Message_Printer_HeaderFile