F:/KPlato/koffice/libs/kotext/KoTextViewIface.h

Aller à la documentation de ce fichier.
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., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, 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>
00027 #include <QColor>
00028 #include <KoRichText.h>
00029 #include <koffice_export.h>
00030 class KoTextView;
00031 
00032 class KOTEXT_EXPORT KoTextViewIface /*:  public DCOPObject*/
00033 {
00034 //     K_DCOP
00035 public:
00036     KoTextViewIface( KoTextView *_textview );
00037 
00038 // k_dcop:
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     // TODO text shadow
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     //return line spacing in pt
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     // apply border, for the futur add border style
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     //return border width in pt
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     //return false if there is not a link
00147     bool changeLinkVariableUrl( const QString & _url) const;
00148     //return false if there is not a link
00149     bool changeLinkVariableName( const QString & _name) const;
00150 
00151     //be careful these functions return QString::null when there is not
00152     //a variable
00153     QString linkVariableUrl( ) const;
00154     QString linkVariableName( ) const;
00155 
00156     bool isANoteVariable() const ;
00157     QString noteVariableText() const;
00158     //return false if there is not a note variable
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     //QString lineStyleToString( KoTextFormat::LineStyle _style ) const;
00176 };
00177 
00178 #endif

Généré le Wed Nov 22 23:41:10 2006 pour KPlato par  doxygen 1.5.1-p1