BALL  1.4.1
logView.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_VIEW_WIDGETS_LOGVIEW_H
00006 #define BALL_VIEW_WIDGETS_LOGVIEW_H
00007 
00008 #ifndef BALL_COMMON_H
00009 # include <BALL/common.h>
00010 #endif
00011 
00012 #ifdef BALL_HAS_SSTREAM
00013 # include <sstream>
00014 #else
00015 # include <strstream>
00016 #endif
00017 
00018 #ifndef BALL_VIEW_WIDGETS_DOCKWIDGET_H
00019 # include <BALL/VIEW/WIDGETS/dockWidget.h>
00020 #endif
00021 
00022 #include <QtGui/QTextBrowser>
00023 #include <QtGui/QDragEnterEvent>
00024 #include <QtGui/QDragLeaveEvent>
00025 #include <QtGui/QDropEvent>
00026 
00027 namespace BALL
00028 {
00029   namespace VIEW
00030   {
00031     class DragLogView
00032       : public QTextBrowser
00033     {
00034       Q_OBJECT
00035 
00036       public:
00037 
00038       DragLogView(QWidget* parent);
00039 
00040       public slots:
00041       virtual void contentsDragEnterEvent(QDragEnterEvent* e);
00042       virtual void contentsDragLeaveEvent(QDragLeaveEvent* e);
00043       virtual void contentsDropEvent(QDropEvent* e);
00044       virtual void setSource(const QUrl& name);
00045     };
00046 
00063     class BALL_VIEW_EXPORT LogView
00064       : public DockWidget,
00065         public LogStreamNotifier
00066     {
00067       Q_OBJECT
00068 
00069       public:
00070 
00071       BALL_EMBEDDABLE(LogView,DockWidget)
00072     
00073       
00080       LogView(QWidget *parent = 0, const char *name = 0);
00081 
00086       LogView(const LogView& view);
00087 
00091       virtual ~LogView();
00092 
00095       virtual void initializeWidget(MainControl& main_control);
00096 
00099       virtual void finalizeWidget(MainControl& main_control);
00100 
00101       // output a string
00102       void logString(const String& text);
00103 
00104       public slots:
00105 
00106       virtual void showGuestContextMenu(const QPoint&);
00107       
00109       bool eventFilter(QObject*, QEvent*);
00110 
00111       protected:
00112 
00119       void logNotify();
00120 
00121       private:
00122 
00123       QTextEdit* text_edit_;
00124     };
00125     
00126 } } // namespaces
00127 
00128 #endif // BALL_VIEW_WIDGETS_LOGVIEW_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines