lib

KoTextViewIface.h
1/* This file is part of the KDE project
2 Copyright (C) 2002, Laurent MONTEL <lmontel@mandrakesoft.com>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KOTEXTVIEW_IFACE_H
21#define KOTEXTVIEW_IFACE_H
22
23#include <KoDocumentIface.h>
24#include <dcopref.h>
25
26#include <tqstring.h>
27#include <tqcolor.h>
28#include <KoRichText.h>
29#include <koffice_export.h>
30class KoTextView;
31
32class KOTEXT_EXPORT KoTextViewIface : public DCOPObject
33{
34 K_DCOP
35public:
36 KoTextViewIface( KoTextView *_textview );
37
38k_dcop:
39 void insertSoftHyphen();
40 void insertNonbreakingSpace();
41 void insertNonbreakingHyphen();
42 void insertText( const TQString &text );
43 void newParagraph();
44 void setBold(bool b);
45 void setItalic(bool on);
46 void setUnderline(bool on);
47 void setDoubleUnderline(bool on);
48 void setStrikeOut(bool on);
49 void setPointSize( int s );
50 void setTextSubScript(bool on);
51 void setTextSuperScript(bool on);
52 void setUnderlineColor( const TQColor & color );
53 void setDefaultFormat();
54 void setRelativeTextSize( double _size);
55
56 TQColor textColor() const;
57 TQString textFontFamily()const;
58 TQColor textBackgroundColor()const;
59 TQColor textUnderlineColor() const;
60 bool textDoubleUnderline() const;
61
62 bool textItalic() const;
63 bool textBold() const;
64 bool textUnderline()const;
65 bool textStrikeOut()const;
66 bool textSubScript() const;
67 bool textSuperScript() const;
68 // TODO text shadow
69 double relativeTextSize() const;
70 bool wordByWord() const;
71
72 void setWordByWord( bool _b );
73 void setTextColor(const TQColor &color);
74 void setTextBackgroundColor(const TQColor &);
75 void setAlign(int align);
76 void setAlign(const TQString &);
77
78 bool isReadWrite() const ;
79 void setReadWrite( bool b );
80
81 void hideCursor();
82 void showCursor();
83
84 int cursorParagraph() const;
85 int cursorIndex() const;
86
87 void moveCursorLeft(bool select);
88 void moveCursorRight(bool select);
89 void moveCursorUp(bool select);
90 void moveCursorDown(bool select);
91 void moveCursorHome(bool select);
92 void moveCursorEnd(bool select);
93 void moveCursorWordRight(bool select);
94 void moveCursorWordLeft(bool select);
95 void moveCursorLineEnd(bool select);
96 void moveCursorLineStart(bool select);
97
98 bool paragraphHasBorder() const;
99
100 //return line spacing in pt
101 double lineSpacing() const;
102
103 double rightMargin() const;
104 double leftMargin() const;
105 double marginFirstLine() const;
106 double spaceAfterParag() const;
107 double spaceBeforeParag() const;
108
109 void setMarginFirstLine(double pt);
110 void setLineSpacing(double pt);
111 void setLeftMargin(double pt);
112 void setRightMargin(double pt);
113 void setSpaceBeforeParag(double pt);
114 void setSpaceAfterParag(double pt);
115
116 // apply border, for the futur add border style
117 void setLeftBorder( const TQColor & c,double width );
118 void setRightBorder( const TQColor & c,double width );
119
120 void setTopBorder( const TQColor & c,double width );
121 void setBottomBorder(const TQColor & c,double width );
122
123 void setLeftBorderColor( const TQColor & c );
124 void setRightBorderColor( const TQColor & c );
125 void setTopBorderColor( const TQColor & c);
126 void setBottomBorderColor(const TQColor & c );
127 void setLeftBorderWidth( double _witdh );
128 void setRightBorderWidth( double _witdh );
129 void setTopBorderWidth( double _witdh );
130 void setBottomBorderWidth( double _witdh );
131
132
133 //return border width in pt
134 double leftBorderWidth() const ;
135 double rightBorderWidth() const;
136 double topBorderWidth() const;
137 double bottomBorderWidth() const;
138
139 TQColor leftBorderColor() const ;
140 TQColor rightBorderColor() const;
141 TQColor topBorderColor() const;
142 TQColor bottomBorderColor() const;
143
144 void changeCaseOfText( const TQString & caseType);
145 bool isALinkVariable() const;
146 //return false if there is not a link
147 bool changeLinkVariableUrl( const TQString & _url) const;
148 //return false if there is not a link
149 bool changeLinkVariableName( const TQString & _name) const;
150
151 //be carefull these functions return TQString() when there is not
152 //a variable
153 TQString linkVariableUrl( ) const;
154 TQString linkVariableName( ) const;
155
156 bool isANoteVariable() const ;
157 TQString noteVariableText() const;
158 //return false if there is not a note variable
159 bool setNoteVariableText(const TQString & note) const;
160
161 void removeComment();
162 TQString underlineStyle() const;
163 TQString strikeOutStyle()const;
164
165 void setLanguage(const TQString & _lang);
166 TQString language() const;
167 void addBookmarks(const TQString &url);
168 void copyLink();
169 void removeLink();
170 void copyTextOfComment();
171 TQString fontAttibute()const;
172private:
173 KoTextView *m_textView;
174protected:
175 //TQString lineStyleToString( KoTextFormat::LineStyle _style ) const;
176};
177
178#endif
Object that is created to edit a KoTextObject.
Definition KoTextView.h:54