0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
[occt.git] / samples / java / jniviewer / jni / OcctJni_MsgPrinter.hxx
1 // Copyright (c) 2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef OcctJni_MsgPrinter_H
15 #define OcctJni_MsgPrinter_H
16
17 #include <Message_Printer.hxx>
18
19 #include <jni.h>
20
21 // Class providing connection between messenger interfaces in C++ and Java layers.
22 class OcctJni_MsgPrinter : public Message_Printer
23 {
24 public:
25
26   //! Default constructor
27   OcctJni_MsgPrinter (JNIEnv* theJEnv,
28                       jobject theJObj);
29
30   //! Destructor.
31   ~OcctJni_MsgPrinter();
32
33   //! Redirection to TCollection_AsciiString method
34   virtual void Send (const TCollection_ExtendedString& theString,
35                      const Message_Gravity             theGravity,
36                      const Standard_Boolean            theToPutEndl) const;
37
38   //! Redirection to TCollection_AsciiString method
39   virtual void Send (const Standard_CString&           theString,
40                      const Message_Gravity             theGravity,
41                      const Standard_Boolean            theToPutEndl) const;
42
43   //! Main printing method
44   virtual void Send (const TCollection_AsciiString&    theString,
45                      const Message_Gravity             theGravity,
46                      const Standard_Boolean            theToPutEndl) const;
47
48 private:
49
50   JNIEnv*   myJEnv;
51   jobject   myJObj;
52   jmethodID myJMet;
53
54 public:
55
56   DEFINE_STANDARD_RTTIEXT(OcctJni_MsgPrinter,Message_Printer)
57
58 };
59
60 DEFINE_STANDARD_HANDLE(OcctJni_MsgPrinter, Message_Printer)
61
62 #endif // OcctJni_MsgPrinter_H