Debian Codegraph @

src/Gui/GuiConsole.h

raw
1 /***************************************************************************
2 * Copyright (c) 2004 Jürgen Riegel <[email protected]> *
3 * *
4 * This file is part of the FreeCAD CAx development system. *
5 * *
6 * This library is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Library General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2 of the License, or (at your option) any later version. *
10 * *
11 * This library is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU Library General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Library General Public *
17 * License along with this library; see the file COPYING.LIB. If not, *
18 * write to the Free Software Foundation, Inc., 59 Temple Place, *
19 * Suite 330, Boston, MA 02111-1307, USA *
20 * *
21 ***************************************************************************/
22
23
24 #ifndef GUI_GUICONSOLE_H
25 #define GUI_GUICONSOLE_H
26
27
28 #include <Base/Console.h>
29
30 namespace Gui
31 {
32
33 /** The console window class
34 * This class opens a console window when instantiated
35 * and redirects the stdio streams to it as long it exists.
36 * This is for Windows only!
37 * After instantiation it automatically registers itself at
38 * the FCConsole class and gets all the FCConsoleObserver
39 * messages. The class must not used directly! Only the
40 * FCConsole class is allowed!
41 * @see FCConsole
42 * \author Jürgen Riegel
43 */
44 class GuiExport GUIConsole: public Base::ILogger
45 {
46 public:
47 /// Constructor
48 GUIConsole();
49 /// Destructor
50 ~GUIConsole() override;
51 void sendLog(
52 const std::string& notifiername,
53 const std::string& msg,
54 Base::LogStyle level,
55 Base::IntendedRecipient recipient,
56 Base::ContentType content
57 ) override;
58 const char* name() override
59 {
60 return "GUIConsole";
61 }
62
63 protected:
64 static const unsigned int s_nMaxLines;
65 static unsigned int s_nRefCount;
66 };
67
68 } // namespace Gui
69
70 #endif // GUI_GUICONSOLE_H