~vcs-imports/bibletime/trunk

« back to all changes in this revision

Viewing changes to bibletime/frontend/display/cplainwritedisplay.h

  • Committer: mgruner
  • Date: 2007-05-08 15:51:07 UTC
  • Revision ID: vcs-imports@canonical.com-20070508155107-0rj7jdmm5ivf8685
-imported source and data files to new svn module
-this is where KDE4-based development will take place

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********
 
2
*
 
3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
 
4
*
 
5
* Copyright 1999-2006 by the BibleTime developers.
 
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
 
7
*
 
8
**********/
 
9
 
 
10
 
 
11
 
 
12
#ifndef CPLAINWRITEDISPLAY_H
 
13
#define CPLAINWRITEDISPLAY_H
 
14
 
 
15
//Bibletime include files
 
16
#include "cwritedisplay.h"
 
17
 
 
18
//Qt includes
 
19
#include <qwidget.h>
 
20
#include <qtextedit.h>
 
21
 
 
22
class CHTMLWriteDisplay;
 
23
class KAction;
 
24
 
 
25
/** The write display implementation for plain source code editing.
 
26
  * @author The BibleTime team
 
27
  */
 
28
class CPlainWriteDisplay : public QTextEdit, public CWriteDisplay  {
 
29
public:
 
30
        /**
 
31
        * Reimplementation.
 
32
        */
 
33
        virtual void selectAll();
 
34
        /**
 
35
        * Sets the new text for this display widget.
 
36
        */
 
37
        virtual void setText( const QString& newText );
 
38
        /**
 
39
        * Returns true if the display widget has a selection. Otherwise false.
 
40
        */
 
41
        virtual const bool hasSelection();
 
42
        /**
 
43
        * Returns the view of this display widget.
 
44
        */
 
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 );
 
48
        /**
 
49
        * Reimplementation.
 
50
        */
 
51
        virtual const bool isModified() const;
 
52
        /**
 
53
        * Sets the current status of the edit widget.
 
54
        */
 
55
        virtual void setModified( const bool modified );
 
56
        /**
 
57
        * Returns the text of this edit widget.
 
58
        */
 
59
        virtual const QString plainText();
 
60
        /**
 
61
        * Creates the necessary action objects and puts them on the toolbar.
 
62
        */
 
63
        virtual void setupToolbar(KToolBar * bar, KActionCollection * actionCollection);
 
64
 
 
65
protected:
 
66
        friend class CDisplay;
 
67
        friend class CHTMLWriteDisplay;
 
68
 
 
69
        CPlainWriteDisplay(CWriteWindow* parentWindow, QWidget* parent);
 
70
        virtual ~CPlainWriteDisplay();
 
71
        /**
 
72
        * Reimplementation from QTextEdit. Provides an popup menu for the given position.
 
73
        */
 
74
        virtual QPopupMenu* createPopupMenu( const QPoint& pos );
 
75
        /**
 
76
        * Reimplementation from QTextEdit. Provides an popup menu.
 
77
        */
 
78
        virtual QPopupMenu* createPopupMenu();
 
79
        /**
 
80
        * Reimplementation to manage drops of our drag and drop objects.
 
81
        */
 
82
        virtual void contentsDropEvent( QDropEvent* e );
 
83
        /**
 
84
        * Reimplementation to insert the text of a dragged reference into the edit view.
 
85
        */
 
86
        virtual void contentsDragEnterEvent( QDragEnterEvent* e );
 
87
        /**
 
88
        * Reimplementation to insert the text of a dragged reference into the edit view.
 
89
        */
 
90
        virtual void contentsDragMoveEvent( QDragMoveEvent* e );
 
91
 
 
92
};
 
93
 
 
94
#endif