lib Library API Documentation

KoTextViewIface.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002, Laurent MONTEL <lmontel@mandrakesoft.com>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef KOTEXTVIEW_IFACE_H
00021 #define KOTEXTVIEW_IFACE_H
00022 
00023 #include <KoDocumentIface.h>
00024 #include <dcopref.h>
00025 
00026 #include <qstring.h>
00027 #include <qcolor.h>
00028 #include <korichtext.h>
00029 class KoTextView;
00030 
00031 class KoTextViewIface :  public DCOPObject
00032 {
00033     K_DCOP
00034 public:
00035     KoTextViewIface( KoTextView *_textview );
00036 
00037 k_dcop:
00038     void insertSoftHyphen();
00039     void insertNonbreakingSpace();
00040     void insertText( const QString &text );
00041     void newParagraph();
00042     void setBold(bool b);
00043     void setItalic(bool on);
00044     void setUnderline(bool on);
00045     void setDoubleUnderline(bool on);
00046     void setStrikeOut(bool on);
00047     void setPointSize( int s );
00048     void setTextSubScript(bool on);
00049     void setTextSuperScript(bool on);
00050     void setUnderlineColor( const QColor & color );
00051     void setDefaultFormat();
00052     void setRelativeTextSize( double _size);
00053 
00054     QColor textColor() const;
00055     QString textFontFamily()const;
00056     QColor textBackgroundColor()const;
00057     QColor textUnderlineColor() const;
00058     bool textDoubleUnderline() const;
00059 
00060     bool textItalic() const;
00061     bool textBold() const;
00062     bool textUnderline()const;
00063     bool textStrikeOut()const;
00064     bool textSubScript() const;
00065     bool textSuperScript() const;
00066     // TODO text shadow
00067     double relativeTextSize() const;
00068     bool wordByWord() const;
00069 
00070     void setWordByWord( bool _b );
00071     void setTextColor(const QColor &color);
00072     void setTextBackgroundColor(const QColor &);
00073     void setAlign(int align);
00074     void setAlign(const QString &);
00075 
00076     bool isReadWrite() const ;
00077     void setReadWrite( bool b );
00078 
00079     void hideCursor();
00080     void showCursor();
00081 
00082     void moveCursorLeft(bool select);
00083     void moveCursorRight(bool select);
00084     void moveCursorUp(bool select);
00085     void moveCursorDown(bool select);
00086     void moveCursorHome(bool select);
00087     void moveCursorEnd(bool select);
00088     void moveCursorWordRight(bool select);
00089     void moveCursorWordLeft(bool select);
00090     void moveCursorLineEnd(bool select);
00091     void moveCursorLineStart(bool select);
00092 
00093     bool paragraphHasBorder() const;
00094 
00095     //return line spacing in pt
00096     double lineSpacing() const;
00097 
00098     double rightMargin() const;
00099     double leftMargin() const;
00100     double marginFirstLine() const;
00101     double spaceAfterParag() const;
00102     double spaceBeforeParag() const;
00103 
00104     void setMarginFirstLine(double pt);
00105     void setLineSpacing(double pt);
00106     void setLeftMargin(double pt);
00107     void setRightMargin(double pt);
00108     void setSpaceBeforeParag(double pt);
00109     void setSpaceAfterParag(double pt);
00110 
00111     // apply border, for the futur add border style
00112     void setLeftBorder( const QColor & c,double width );
00113     void setRightBorder( const QColor & c,double width );
00114 
00115     void setTopBorder( const QColor & c,double width );
00116     void setBottomBorder(const QColor & c,double width );
00117 
00118     void setLeftBorderColor( const QColor & c );
00119     void setRightBorderColor( const QColor & c );
00120     void setTopBorderColor( const QColor & c);
00121     void setBottomBorderColor(const QColor & c );
00122     void setLeftBorderWidth( double _witdh );
00123     void setRightBorderWidth( double _witdh );
00124     void setTopBorderWidth( double _witdh );
00125     void setBottomBorderWidth( double _witdh );
00126 
00127 
00128     //return border width in pt
00129     double leftBorderWidth() const ;
00130     double rightBorderWidth() const;
00131     double topBorderWidth() const;
00132     double bottomBorderWidth() const;
00133 
00134     QColor leftBorderColor() const ;
00135     QColor rightBorderColor() const;
00136     QColor topBorderColor() const;
00137     QColor bottomBorderColor() const;
00138 
00139     void changeCaseOfText( const QString & caseType);
00140     bool isALinkVariable() const;
00141     //return false if there is not a link
00142     bool changeLinkVariableUrl( const QString & _url) const;
00143     //return false if there is not a link
00144     bool changeLinkVariableName( const QString & _name) const;
00145 
00146     //be carefull these functions return QString::null when there is not
00147     //a variable
00148     QString linkVariableUrl( ) const;
00149     QString linkVariableName( ) const;
00150 
00151     bool isANoteVariable() const ;
00152     QString noteVariableText() const;
00153     //return false if there is not a note variable
00154     bool setNoteVariableText(const QString & note) const;
00155 
00156     void removeComment();
00157     QString underlineStyle() const;
00158     QString strikeOutStyle()const;
00159 
00160     void setLanguage(const QString & _lang);
00161     QString language() const;
00162     void addBookmarks(const QString &url);
00163     void copyLink();
00164     void removeLink();
00165     void copyTextOfComment();
00166     QString fontAttibute()const;
00167 private:
00168     KoTextView *m_textView;
00169 protected:
00170     //QString lineStyleToString( KoTextFormat::LineStyle _style ) const;
00171 };
00172 
00173 #endif
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Mar 11 11:47:44 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003