Choreonoid  1.5
MessageView.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_MESSAGE_VIEW_H
6 #define CNOID_BASE_MESSAGE_VIEW_H
7 
8 #include <cnoid/View>
9 #include <string>
10 #include <iosfwd>
11 #include <boost/format.hpp>
12 #include <QString>
13 #include "exportdecl.h"
14 
15 namespace cnoid {
16 
17 class MessageViewImpl;
18 
20 {
21 public:
22  static void initializeClass(ExtensionManager* ext);
23 
24  static MessageView* mainInstance();
25  static MessageView* instance();
26 
27  MessageView();
28  ~MessageView();
29 
30 #if defined(_WIN32) && defined(ERROR)
31 #undef ERROR
32 #endif
33 
34  enum MessageType { NORMAL, ERROR, WARNING, HIGHLIGHT };
35 
36  void put(const char* message);
37  void put(const std::string& message);
38  void put(const boost::format& message);
39  void put(const QString& message);
40 
41  void put(int type, const char* message);
42  void put(int type, const std::string& message);
43  void put(int type, const boost::format& message);
44  void put(int type, const QString& message);
45 
46  void putln();
47  void putln(const char* message);
48  void putln(const std::string& message);
49  void putln(const boost::format& message);
50  void putln(const QString& message);
51 
52  void putln(int type, const char* message);
53  void putln(int type, const std::string& message);
54  void putln(int type, const boost::format& message);
55  void putln(int type, const QString& message);
56 
57  void notify(const char* message);
58  void notify(const std::string& message);
59  void notify(const boost::format& message);
60  void notify(const QString& message);
61 
62  /*
63  int start(const char* message);
64  int start(const std::string& message);
65  int start(const boost::format& message);
66  int start(const QString& message);
67 
68  void progress(int id, const char* message);
69  void progress(int id, const std::string& message);
70  void progress(int id, const boost::format& message);
71  void progress(int id, const QString& message);
72 
73  void finish(int id, const char* message);
74  void finish(int id, const std::string& message);
75  void finish(int id, const boost::format& message);
76  void finish(int id, const QString& message);
77  */
78 
79  int currentColumn();
80 
81  void flush();
82  void clear();
83 
84  std::ostream& cout(bool doFlush = false);
85 
86  void beginStdioRedirect();
87  void endStdioRedirect();
88 
90 
91  static bool isFlushing();
92  static SignalProxy<void()> sigFlushFinished();
93 
94 protected:
95  virtual bool event(QEvent* e);
96 
97 private:
98  MessageViewImpl* impl;
99 };
100 
101 #ifndef CNOID_BASE_MVOUT_DECLARED
102 #define CNOID_BASE_MVOUT_DECLARED
103 CNOID_EXPORT std::ostream& mvout(bool doFlush = false);
104 #endif
105 
106 CNOID_EXPORT void showMessageBox(const std::string& message);
107 CNOID_EXPORT void showMessageBox(const boost::format& message);
108 CNOID_EXPORT void showMessageBox(const char* message);
109 CNOID_EXPORT void showMessageBox(const QString& message);
110 
111 CNOID_EXPORT void showWarningDialog(const std::string& message);
112 CNOID_EXPORT void showWarningDialog(const boost::format& message);
113 CNOID_EXPORT void showWarningDialog(const char* message);
114 CNOID_EXPORT void showWarningDialog(const QString& message);
115 
116 CNOID_EXPORT bool showConfirmDialog(const char* caption, const char* message);
117 CNOID_EXPORT bool showConfirmDialog(const std::string& caption, const std::string& message);
118 CNOID_EXPORT bool showConfirmDialog(const QString& caption, const QString& message);
119 }
120 
121 #endif
MessageType
Definition: MessageView.h:34
CNOID_EXPORT bool showConfirmDialog(const char *caption, const char *message)
Definition: MessageView.cpp:1091
Definition: ExtensionManager.h:26
CNOID_EXPORT std::ostream & mvout(bool doFlush=false)
Definition: MessageView.cpp:1025
CNOID_EXPORT void showMessageBox(const std::string &message)
Definition: MessageView.cpp:1042
CNOID_EXPORT void showWarningDialog(const std::string &message)
Definition: MessageView.cpp:1064
Definition: MessageView.h:19
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
Definition: MessageView.h:34
Definition: View.h:28
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37
Definition: Signal.h:380