00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_VIEW_WIDGETS_LOGVIEW_H
00008 #define BALL_VIEW_WIDGETS_LOGVIEW_H
00009
00010 #ifndef BALL_COMMON_H
00011 # include <BALL/common.h>
00012 #endif
00013
00014 #ifdef BALL_HAS_SSTREAM
00015 # include <sstream>
00016 #else
00017 # include <strstream>
00018 #endif
00019
00020 #ifndef BALL_VIEW_WIDGETS_DOCKWIDGET_H
00021 # include <BALL/VIEW/WIDGETS/dockWidget.h>
00022 #endif
00023
00024 #include <QtGui/QTextBrowser>
00025 #include <QtGui/QDragEnterEvent>
00026 #include <QtGui/QDragLeaveEvent>
00027 #include <QtGui/QDropEvent>
00028
00029 namespace BALL
00030 {
00031 namespace VIEW
00032 {
00033 class DragLogView
00034 : public QTextBrowser
00035 {
00036 Q_OBJECT
00037
00038 public:
00039
00040 DragLogView(QWidget* parent);
00041
00042 public slots:
00043 virtual void contentsDragEnterEvent(QDragEnterEvent* e);
00044 virtual void contentsDragLeaveEvent(QDragLeaveEvent* e);
00045 virtual void contentsDropEvent(QDropEvent* e);
00046 virtual void setSource(const QUrl& name);
00047 };
00048
00065 class BALL_VIEW_EXPORT LogView
00066 : public DockWidget,
00067 public LogStreamNotifier
00068 {
00069 Q_OBJECT
00070
00071 public:
00072
00073 BALL_EMBEDDABLE(LogView,DockWidget)
00074
00075
00082 LogView(QWidget *parent = 0, const char *name = 0);
00083
00088 LogView(const LogView& view);
00089
00093 virtual ~LogView();
00094
00097 virtual void initializeWidget(MainControl& main_control);
00098
00101 virtual void finalizeWidget(MainControl& main_control);
00102
00103
00104 void logString(const String& text);
00105
00106 public slots:
00107
00108 virtual void showGuestContextMenu(const QPoint&);
00109
00111 bool eventFilter(QObject*, QEvent*);
00112
00113 protected:
00114
00121 void logNotify();
00122
00123 private:
00124
00125 QTextEdit* text_edit_;
00126 };
00127
00128 } }
00129
00130 #endif // BALL_VIEW_WIDGETS_LOGVIEW_H