3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
5
* Copyright 1999-2006 by the BibleTime developers.
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
12
#ifndef CPLAINWRITEDISPLAY_H
13
#define CPLAINWRITEDISPLAY_H
15
//Bibletime include files
16
#include "cwritedisplay.h"
20
#include <qtextedit.h>
22
class CHTMLWriteDisplay;
25
/** The write display implementation for plain source code editing.
26
* @author The BibleTime team
28
class CPlainWriteDisplay : public QTextEdit, public CWriteDisplay {
33
virtual void selectAll();
35
* Sets the new text for this display widget.
37
virtual void setText( const QString& newText );
39
* Returns true if the display widget has a selection. Otherwise false.
41
virtual const bool hasSelection();
43
* Returns the view of this display widget.
45
virtual QWidget* view();
46
virtual const QString text( const CDisplay::TextType format = CDisplay::HTMLText, const CDisplay::TextPart part = CDisplay::Document );
47
virtual void print( const CDisplay::TextPart, CSwordBackend::DisplayOptions displayOptions, CSwordBackend::FilterOptions filterOptions );
51
virtual const bool isModified() const;
53
* Sets the current status of the edit widget.
55
virtual void setModified( const bool modified );
57
* Returns the text of this edit widget.
59
virtual const QString plainText();
61
* Creates the necessary action objects and puts them on the toolbar.
63
virtual void setupToolbar(KToolBar * bar, KActionCollection * actionCollection);
66
friend class CDisplay;
67
friend class CHTMLWriteDisplay;
69
CPlainWriteDisplay(CWriteWindow* parentWindow, QWidget* parent);
70
virtual ~CPlainWriteDisplay();
72
* Reimplementation from QTextEdit. Provides an popup menu for the given position.
74
virtual QPopupMenu* createPopupMenu( const QPoint& pos );
76
* Reimplementation from QTextEdit. Provides an popup menu.
78
virtual QPopupMenu* createPopupMenu();
80
* Reimplementation to manage drops of our drag and drop objects.
82
virtual void contentsDropEvent( QDropEvent* e );
84
* Reimplementation to insert the text of a dragged reference into the edit view.
86
virtual void contentsDragEnterEvent( QDragEnterEvent* e );
88
* Reimplementation to insert the text of a dragged reference into the edit view.
90
virtual void contentsDragMoveEvent( QDragMoveEvent* e );