00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KOTEXTVIEW_IFACE_H
00021 #define KOTEXTVIEW_IFACE_H
00022
00023 #include <KoDocumentIface.h>
00024
00025
00026 #include <QString>
00027 #include <QColor>
00028 #include <KoRichText.h>
00029 #include <koffice_export.h>
00030 class KoTextView;
00031
00032 class KOTEXT_EXPORT KoTextViewIface
00033 {
00034
00035 public:
00036 KoTextViewIface( KoTextView *_textview );
00037
00038
00039 void insertSoftHyphen();
00040 void insertNonbreakingSpace();
00041 void insertNonbreakingHyphen();
00042 void insertText( const QString &text );
00043 void newParagraph();
00044 void setBold(bool b);
00045 void setItalic(bool on);
00046 void setUnderline(bool on);
00047 void setDoubleUnderline(bool on);
00048 void setStrikeOut(bool on);
00049 void setPointSize( int s );
00050 void setTextSubScript(bool on);
00051 void setTextSuperScript(bool on);
00052 void setUnderlineColor( const QColor & color );
00053 void setDefaultFormat();
00054 void setRelativeTextSize( double _size);
00055
00056 QColor textColor() const;
00057 QString textFontFamily()const;
00058 QColor textBackgroundColor()const;
00059 QColor textUnderlineColor() const;
00060 bool textDoubleUnderline() const;
00061
00062 bool textItalic() const;
00063 bool textBold() const;
00064 bool textUnderline()const;
00065 bool textStrikeOut()const;
00066 bool textSubScript() const;
00067 bool textSuperScript() const;
00068
00069 double relativeTextSize() const;
00070 bool wordByWord() const;
00071
00072 void setWordByWord( bool _b );
00073 void setTextColor(const QColor &color);
00074 void setTextBackgroundColor(const QColor &);
00075 void setAlign(int align);
00076 void setAlign(const QString &);
00077
00078 bool isReadWrite() const ;
00079 void setReadWrite( bool b );
00080
00081 void hideCursor();
00082 void showCursor();
00083
00084 int cursorParagraph() const;
00085 int cursorIndex() const;
00086
00087 void moveCursorLeft(bool select);
00088 void moveCursorRight(bool select);
00089 void moveCursorUp(bool select);
00090 void moveCursorDown(bool select);
00091 void moveCursorHome(bool select);
00092 void moveCursorEnd(bool select);
00093 void moveCursorWordRight(bool select);
00094 void moveCursorWordLeft(bool select);
00095 void moveCursorLineEnd(bool select);
00096 void moveCursorLineStart(bool select);
00097
00098 bool paragraphHasBorder() const;
00099
00100
00101 double lineSpacing() const;
00102
00103 double rightMargin() const;
00104 double leftMargin() const;
00105 double marginFirstLine() const;
00106 double spaceAfterParag() const;
00107 double spaceBeforeParag() const;
00108
00109 void setMarginFirstLine(double pt);
00110 void setLineSpacing(double pt);
00111 void setLeftMargin(double pt);
00112 void setRightMargin(double pt);
00113 void setSpaceBeforeParag(double pt);
00114 void setSpaceAfterParag(double pt);
00115
00116
00117 void setLeftBorder( const QColor & c,double width );
00118 void setRightBorder( const QColor & c,double width );
00119
00120 void setTopBorder( const QColor & c,double width );
00121 void setBottomBorder(const QColor & c,double width );
00122
00123 void setLeftBorderColor( const QColor & c );
00124 void setRightBorderColor( const QColor & c );
00125 void setTopBorderColor( const QColor & c);
00126 void setBottomBorderColor(const QColor & c );
00127 void setLeftBorderWidth( double _witdh );
00128 void setRightBorderWidth( double _witdh );
00129 void setTopBorderWidth( double _witdh );
00130 void setBottomBorderWidth( double _witdh );
00131
00132
00133
00134 double leftBorderWidth() const ;
00135 double rightBorderWidth() const;
00136 double topBorderWidth() const;
00137 double bottomBorderWidth() const;
00138
00139 QColor leftBorderColor() const ;
00140 QColor rightBorderColor() const;
00141 QColor topBorderColor() const;
00142 QColor bottomBorderColor() const;
00143
00144 void changeCaseOfText( const QString & caseType);
00145 bool isALinkVariable() const;
00146
00147 bool changeLinkVariableUrl( const QString & _url) const;
00148
00149 bool changeLinkVariableName( const QString & _name) const;
00150
00151
00152
00153 QString linkVariableUrl( ) const;
00154 QString linkVariableName( ) const;
00155
00156 bool isANoteVariable() const ;
00157 QString noteVariableText() const;
00158
00159 bool setNoteVariableText(const QString & note) const;
00160
00161 void removeComment();
00162 QString underlineStyle() const;
00163 QString strikeOutStyle()const;
00164
00165 void setLanguage(const QString & _lang);
00166 QString language() const;
00167 void addBookmarks(const QString &url);
00168 void copyLink();
00169 void removeLink();
00170 void copyTextOfComment();
00171 QString fontAttibute()const;
00172 private:
00173 KoTextView *m_textView;
00174 protected:
00175
00176 };
00177
00178 #endif