Diffstat (limited to 'noncore/apps/tinykate/libkate/interfaces') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/libkate/interfaces/document.h | 103 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/interfaces/interfaces.cpp | 51 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/interfaces/view.h | 160 |
3 files changed, 314 insertions, 0 deletions
diff --git a/noncore/apps/tinykate/libkate/interfaces/document.h b/noncore/apps/tinykate/libkate/interfaces/document.h new file mode 100644 index 0000000..cbfd1b3 --- a/dev/null +++ b/noncore/apps/tinykate/libkate/interfaces/document.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /*************************************************************************** | ||
2 | document.h - description | ||
3 | ------------------- | ||
4 | begin : Mon Jan 15 2001 | ||
5 | copyright : (C) 2001 by Christoph "Crossfire" Cullmann | ||
6 | (C) 2002 by Joseph Wenninger | ||
7 | email : crossfire@babylon2k.de | ||
8 | jowenn@kde.org | ||
9 | ***************************************************************************/ | ||
10 | |||
11 | /*************************************************************************** | ||
12 | This library is free software; you can redistribute it and/or | ||
13 | modify it under the terms of the GNU Library General Public | ||
14 | License as published by the Free Software Foundation; either | ||
15 | version 2 of the License, or (at your option) any later version. | ||
16 | |||
17 | This library is distributed in the hope that it will be useful, | ||
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
20 | Library General Public License for more details. | ||
21 | |||
22 | You should have received a copy of the GNU Library General Public License | ||
23 | along with this library; see the file COPYING.LIB. If not, write to | ||
24 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | ***************************************************************************/ | ||
27 | |||
28 | #ifndef _KATE_DOCUMENT_INCLUDE_ | ||
29 | #define _KATE_DOCUMENT_INCLUDE_ | ||
30 | |||
31 | #include <ktexteditor.h> | ||
32 | |||
33 | class KConfig; | ||
34 | |||
35 | namespace Kate | ||
36 | { | ||
37 | |||
38 | /** internal class for document bookmarks. */ | ||
39 | class Mark | ||
40 | { | ||
41 | public: | ||
42 | uint line; | ||
43 | uint type; | ||
44 | }; | ||
45 | |||
46 | /** This interface provedes access to the Kate Document class. | ||
47 | */ | ||
48 | class Document : public KTextEditor::Document | ||
49 | { | ||
50 | Q_OBJECT | ||
51 | |||
52 | public: | ||
53 | Document (); | ||
54 | virtual ~Document (); | ||
55 | |||
56 | public: | ||
57 | /** Read document config. | ||
58 | */ | ||
59 | virtual void readConfig () { ; }; | ||
60 | /** Save document config. | ||
61 | */ | ||
62 | virtual void writeConfig () { ; }; | ||
63 | |||
64 | /** Read document session config. | ||
65 | */ | ||
66 | virtual void readSessionConfig (KConfig *) { ; }; | ||
67 | /** Save document session config. | ||
68 | */ | ||
69 | virtual void writeSessionConfig (KConfig *) { ; }; | ||
70 | |||
71 | /** Returns the document ID. | ||
72 | */ | ||
73 | virtual uint docID () { return 0L; }; | ||
74 | |||
75 | /** Defines possible mark types. A line can have marks of different types. | ||
76 | */ | ||
77 | enum marks | ||
78 | { | ||
79 | Bookmark = 1, | ||
80 | Breakpoint = 2, | ||
81 | markType0 = 4, | ||
82 | markType1 = 8, | ||
83 | markType2 = 16, | ||
84 | markType3 = 32, | ||
85 | markType4 = 64, | ||
86 | markType5 = 128, | ||
87 | markType6 = 256, | ||
88 | markType7 = 512, | ||
89 | markType8 = 1024 | ||
90 | }; | ||
91 | |||
92 | /** A list of all marks in a document. Use binary comparing to find marks of a specific type. | ||
93 | */ | ||
94 | virtual QList<Mark> marks () { QList<Mark> l; return l; }; | ||
95 | |||
96 | public slots: | ||
97 | // clear buffer/filename - update the views | ||
98 | virtual void flush () { ; }; | ||
99 | }; | ||
100 | |||
101 | }; | ||
102 | |||
103 | #endif | ||
diff --git a/noncore/apps/tinykate/libkate/interfaces/interfaces.cpp b/noncore/apps/tinykate/libkate/interfaces/interfaces.cpp new file mode 100644 index 0000000..4fdd252 --- a/dev/null +++ b/noncore/apps/tinykate/libkate/interfaces/interfaces.cpp | |||
@@ -0,0 +1,51 @@ | |||
1 | /*************************************************************************** | ||
2 | interfaces.cpp - description | ||
3 | ------------------- | ||
4 | begin : Mon Jan 15 2001 | ||
5 | copyright : (C) 2001 by Christoph "Crossfire" Cullmann | ||
6 | (C) 2002 by Joseph Wenninger | ||
7 | email : crossfire@babylon2k.de | ||
8 | jowenn@kde.org | ||
9 | ***************************************************************************/ | ||
10 | |||
11 | /*************************************************************************** | ||
12 | This library is free software; you can redistribute it and/or | ||
13 | modify it under the terms of the GNU Library General Public | ||
14 | License as published by the Free Software Foundation; either | ||
15 | version 2 of the License, or (at your option) any later version. | ||
16 | |||
17 | This library is distributed in the hope that it will be useful, | ||
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
20 | Library General Public License for more details. | ||
21 | |||
22 | You should have received a copy of the GNU Library General Public License | ||
23 | along with this library; see the file COPYING.LIB. If not, write to | ||
24 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | ***************************************************************************/ | ||
27 | |||
28 | #include "document.h" | ||
29 | |||
30 | #include "view.h" | ||
31 | |||
32 | namespace Kate | ||
33 | { | ||
34 | |||
35 | Document::Document () : KTextEditor::Document (0L, 0L) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | Document::~Document () | ||
40 | { | ||
41 | } | ||
42 | |||
43 | View::View ( KTextEditor::Document *doc, QWidget *parent, const char *name ) : KTextEditor::View (doc, parent, name) | ||
44 | { | ||
45 | } | ||
46 | |||
47 | View::~View () | ||
48 | { | ||
49 | } | ||
50 | |||
51 | }; | ||
diff --git a/noncore/apps/tinykate/libkate/interfaces/view.h b/noncore/apps/tinykate/libkate/interfaces/view.h new file mode 100644 index 0000000..5b24bb5 --- a/dev/null +++ b/noncore/apps/tinykate/libkate/interfaces/view.h | |||
@@ -0,0 +1,160 @@ | |||
1 | /*************************************************************************** | ||
2 | view.h - description | ||
3 | ------------------- | ||
4 | begin : Mon Jan 15 2001 | ||
5 | copyright : (C) 2001 by Christoph "Crossfire" Cullmann | ||
6 | (C) 2002 by Joseph Wenninger | ||
7 | email : crossfire@babylon2k.de | ||
8 | jowenn@kde.org | ||
9 | ***************************************************************************/ | ||
10 | |||
11 | /*************************************************************************** | ||
12 | This library is free software; you can redistribute it and/or | ||
13 | modify it under the terms of the GNU Library General Public | ||
14 | License as published by the Free Software Foundation; either | ||
15 | version 2 of the License, or (at your option) any later version. | ||
16 | |||
17 | This library is distributed in the hope that it will be useful, | ||
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
20 | Library General Public License for more details. | ||
21 | |||
22 | You should have received a copy of the GNU Library General Public License | ||
23 | along with this library; see the file COPYING.LIB. If not, write to | ||
24 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | ***************************************************************************/ | ||
27 | |||
28 | #ifndef _KATE_VIEW_INCLUDE_ | ||
29 | #define _KATE_VIEW_INCLUDE_ | ||
30 | |||
31 | #include <ktexteditor.h> | ||
32 | |||
33 | class KConfig; | ||
34 | |||
35 | namespace Kate | ||
36 | { | ||
37 | |||
38 | class Document; | ||
39 | class Mark; | ||
40 | |||
41 | /** This interface provides access to the view. | ||
42 | */ | ||
43 | class View : public KTextEditor::View | ||
44 | { | ||
45 | Q_OBJECT | ||
46 | |||
47 | public: | ||
48 | View ( KTextEditor::Document *doc, QWidget *parent, const char *name = 0 ); | ||
49 | virtual ~View (); | ||
50 | |||
51 | /** Returns a pointer to the document of the view. | ||
52 | */ | ||
53 | virtual Document *getDoc () { return 0L; }; | ||
54 | |||
55 | /** Returns the marked text in the view. | ||
56 | */ | ||
57 | virtual QString markedText () { return 0L; }; | ||
58 | |||
59 | public slots: | ||
60 | /** popup a config dialog for the editor part. | ||
61 | */ | ||
62 | virtual void configDialog () { ; }; | ||
63 | |||
64 | // Highlighting slots | ||
65 | virtual void setHl (int) { ; }; | ||
66 | virtual int getHl () { return 0; }; | ||
67 | virtual int getHlCount () { return 0; }; | ||
68 | virtual QString getHlName (int) { return 0L; }; | ||
69 | virtual QString getHlSection (int) { return 0L; }; | ||
70 | |||
71 | // undo/redo stuff | ||
72 | virtual void undo () { ; }; | ||
73 | virtual void redo () { ; }; | ||
74 | virtual void undoHistory() { ; }; | ||
75 | |||
76 | public: | ||
77 | // read/save config of the view | ||
78 | virtual void readConfig () { ; }; | ||
79 | virtual void writeConfig () { ; }; | ||
80 | |||
81 | // read/save sessionconfig of the view | ||
82 | virtual void readSessionConfig (KConfig *) { ; }; | ||
83 | virtual void writeSessionConfig (KConfig *) { ; }; | ||
84 | |||
85 | public slots: | ||
86 | // some simply key commands | ||
87 | virtual void keyReturn () { ; }; | ||
88 | virtual void keyDelete () { ; }; | ||
89 | virtual void backspace () { ; }; | ||
90 | virtual void killLine () { ; }; | ||
91 | |||
92 | // move cursor in the view | ||
93 | virtual void cursorLeft () { ; }; | ||
94 | virtual void shiftCursorLeft () { ; }; | ||
95 | virtual void cursorRight () { ; }; | ||
96 | virtual void shiftCursorRight () { ; }; | ||
97 | virtual void wordLeft () { ; }; | ||
98 | virtual void shiftWordLeft () { ; }; | ||
99 | virtual void wordRight () { ; }; | ||
100 | virtual void shiftWordRight () { ; }; | ||
101 | virtual void home () { ; }; | ||
102 | virtual void shiftHome () { ; }; | ||
103 | virtual void end () { ; }; | ||
104 | virtual void shiftEnd () { ; }; | ||
105 | virtual void up () { ; }; | ||
106 | virtual void shiftUp () { ; }; | ||
107 | virtual void down () { ; }; | ||
108 | virtual void shiftDown () { ; }; | ||
109 | virtual void scrollUp () { ; }; | ||
110 | virtual void scrollDown () { ; }; | ||
111 | virtual void topOfView () { ; }; | ||
112 | virtual void bottomOfView () { ; }; | ||
113 | virtual void pageUp () { ; }; | ||
114 | virtual void shiftPageUp () { ; }; | ||
115 | virtual void pageDown () { ; }; | ||
116 | virtual void shiftPageDown () { ; }; | ||
117 | virtual void top () { ; }; | ||
118 | virtual void shiftTop () { ; }; | ||
119 | virtual void bottom () { ; }; | ||
120 | virtual void shiftBottom () { ; }; | ||
121 | |||
122 | public slots: | ||
123 | // edit command popup window | ||
124 | virtual void slotEditCommand () { ; }; | ||
125 | |||
126 | // icon border enable/disable | ||
127 | virtual void setIconBorder (bool) { ; }; | ||
128 | virtual void toggleIconBorder () { ; }; | ||
129 | |||
130 | // goto mark | ||
131 | virtual void gotoMark (Mark *) { ; }; | ||
132 | |||
133 | // toggle current line bookmark or clear all bookmarks | ||
134 | virtual void toggleBookmark () { ; }; | ||
135 | virtual void clearBookmarks () { ; }; | ||
136 | |||
137 | public: | ||
138 | // is iconborder visible ? | ||
139 | virtual bool iconBorder() { return false; }; | ||
140 | |||
141 | public slots: | ||
142 | /** | ||
143 | Flushes the document of the text widget. The user is given | ||
144 | a chance to save the current document if the current document has | ||
145 | been modified. | ||
146 | */ | ||
147 | virtual void flush () { ; }; | ||
148 | |||
149 | public: | ||
150 | /** | ||
151 | Returns true if the current document can be | ||
152 | discarded. If the document is modified, the user is asked if he wants | ||
153 | to save it. On "cancel" the function returns false. | ||
154 | */ | ||
155 | virtual bool canDiscard() { return false; }; | ||
156 | }; | ||
157 | |||
158 | }; | ||
159 | |||
160 | #endif | ||