You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pytqt/sip/qt/qtextedit.sip

438 lines
12 KiB

// This is the SIP interface definition for TQTextEdit.
//
// Copyright (c) 2007
// Riverbank Computing Limited <info@riverbankcomputing.co.uk>
//
// This file is part of PyTQt.
//
// This copy of PyTQt is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2, or (at your option) any later
// version.
//
// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
%ExportedDoc
<Sect2><Title>TQTextEdit (TQt v3+)</Title>
<FuncSynopsis>
<FuncDef>int <Function>charAt</Function></FuncDef>
<ParamDef>const TQPoint &amp;<Parameter>pos</Parameter></ParamDef>
<ParamDef>int *<Parameter>para</Parameter> = 0</ParamDef>
</FuncSynopsis>
<Para>
This takes only the <Literal>pos</Literal> parameter and returns a tuple of the
value returned via the <Literal>para</Literal> pointer and the int result.
</Para>
<FuncSynopsis>
<FuncDef>void <Function>del</Function></FuncDef>
<ParamDef></ParamDef>
</FuncSynopsis>
<Para>
This has been renamed <Literal>delChar</Literal> in Python.
</Para>
<FuncSynopsis>
<FuncDef>virtual bool <Function>find</Function></FuncDef>
<ParamDef>const TQString &amp;<Parameter>expr</Parameter></ParamDef>
<ParamDef>bool <Parameter>cs</Parameter></ParamDef>
<ParamDef>bool <Parameter>wo</Parameter></ParamDef>
<ParamDef>bool <Parameter>forward</Parameter> = TRUE</ParamDef>
<ParamDef>int *<Parameter>para</Parameter> = 0</ParamDef>
<ParamDef>int *<Parameter>index</Parameter> = 0</ParamDef>
</FuncSynopsis>
<Para>
If the <Literal>para</Literal> and <Literal>index</Literal> parameters are
omitted then the bool result is returned. If both are supplied (as integers)
then a tuple of the bool result and the modified values of
<Literal>para</Literal> and <Literal>index</Literal> is returned.
</Para>
<FuncSynopsis>
<FuncDef>void <Function>getCursorPosition</Function></FuncDef>
<ParamDef>int *<Parameter>para</Parameter></ParamDef>
<ParamDef>int *<Parameter>index</Parameter></ParamDef>
</FuncSynopsis>
<Para>
This takes no parameters and returns a tuple of the values returned via the
<Literal>para</Literal> and <Literal>index</Literal> pointers.
</Para>
<FuncSynopsis>
<FuncDef>void <Function>getSelection</Function></FuncDef>
<ParamDef>int *<Parameter>paraFrom</Parameter></ParamDef>
<ParamDef>int *<Parameter>indexFrom</Parameter></ParamDef>
<ParamDef>int *<Parameter>paraTo</Parameter></ParamDef>
<ParamDef>int *<Parameter>indexTo</Parameter></ParamDef>
<ParamDef>int <Parameter>selNum</Parameter> = 0</ParamDef>
</FuncSynopsis>
<Para>
This takes only the <Literal>selNum</Literal> parameter and returns a tuple of
the <Literal>paraFrom</Literal>, <Literal>indexFrom</Literal>,
<Literal>paraTo</Literal> and <Literal>indexTo</Literal> values.
</Para>
</Sect2>
%End
%If (TQt_3_0_0 -)
// These aren't part of the public API in the TQt3 beta, so define them as
// opaque for the moment.
class TQTextDocument;
class TQTextCursor;
class TQTextEdit : TQScrollView
{
%TypeHeaderCode
#include <tqtextedit.h>
%End
public:
enum WordWrap {
NoWrap,
WidgetWidth,
FixedPixelWidth,
FixedColumnWidth
};
enum WrapPolicy {
AtWordBoundary,
Anywhere,
AtWhiteSpace,
%If (TQt_3_1_0 -)
AtWordOrDocumentBoundary
%End
};
%If (TQt_3_1_0 -)
enum AutoFormatting {
AutoNone,
AutoBulletList,
AutoAll
};
%End
enum KeyboardAction {
ActionBackspace,
ActionDelete,
ActionReturn,
ActionKill,
%If (TQt_3_1_0 -)
ActionWordBackspace,
ActionWordDelete
%End
};
enum CursorAction {
MoveBackward,
MoveForward,
MoveWordBackward,
MoveWordForward,
MoveUp,
MoveDown,
MoveLineStart,
MoveLineEnd,
MoveHome,
MoveEnd,
MovePgUp,
MovePgDown
};
enum VerticalAlignment {
AlignNormal,
AlignSuperScript,
AlignSubScript
};
%If (TQt_3_1_0 -)
enum TextInsertionFlags {
RedoIndentation,
CheckNewLines,
RemoveSelected
};
%End
TQTextEdit(const TQString &,const TQString & = TQString::null,
TQWidget * /TransferThis/ = 0,const char * = 0);
TQTextEdit(TQWidget * /TransferThis/ = 0,const char * = 0);
void setPalette(const TQPalette &);
TQString text() const;
TQString text(int) const;
TextFormat textFormat() const;
TQString context() const;
TQString documentTitle() const;
void getSelection(int *,int *,int *,int *,int = 0) const;
// We implement find() as two separate methods as it's the easiest way
// to handle the somewhat strange TQt interface.
virtual bool find(const TQString &,bool,bool,bool = 1);
virtual bool find(const TQString &,bool,bool,bool,int * /In,Out/,
int * /In,Out/);
int paragraphs() const;
int lines() const;
int linesOfParagraph(int) const;
int lineOfChar(int,int);
int length() const;
TQRect paragraphRect(int) const;
int paragraphAt(const TQPoint &) const;
// Note that this is handwritten code because the generated code would
// return the values in the (correct but) reverse order.
SIP_PYTUPLE charAt(const TQPoint &) const;
%MethodCode
int para, index;
Py_BEGIN_ALLOW_THREADS
index = sipCpp -> TQTextEdit::charAt(*a0,&para);
Py_END_ALLOW_THREADS
sipRes = sipBuildResult(&sipIsErr,"(ii)",para,index);
%End
int paragraphLength(int) const;
TQStyleSheet *styleSheet() const;
TQMimeSourceFactory *mimeSourceFactory() const;
TQBrush paper() const;
bool linkUnderline() const;
int heightForWidth(int) const;
bool hasSelectedText() const;
TQString selectedText() const;
bool isUndoAvailable() const;
bool isRedoAvailable() const;
WordWrap wordWrap() const;
int wrapColumnOrWidth() const;
WrapPolicy wrapPolicy() const;
int tabStopWidth() const;
TQString anchorAt(const TQPoint &);
%If (TQt_3_1_0 -)
TQString anchorAt(const TQPoint &,AnchorAttribute);
%End
TQSize sizeHint() const;
bool isReadOnly() const;
void getCursorPosition(int *,int *) const;
bool isModified() const;
bool italic() const;
bool bold() const;
bool underline() const;
TQString family() const;
int pointSize() const;
TQColor color() const;
TQFont font() const;
%If (TQt_3_1_0 -)
TQFont currentFont() const;
%End
int alignment() const;
int undoDepth() const;
// These are undocumented and marked as "don't use".
//virtual bool getFormat(int,int,TQFont *,TQColor *,VerticalAlignment *);
//virtual bool getParagraphFormat(int,TQFont *,TQColor *,
// VerticalAlignment *,int *,
// TQStyleSheetItem::DisplayMode *,
// TQStyleSheetItem::ListStyle *,
// int *);
bool isOverwriteMode() const;
TQColor paragraphBackgroundColor(int) const;
bool isUndoRedoEnabled() const;
bool eventFilter(TQObject *,TQEvent *);
%If (TQt_3_1_0 -)
bool tabChangesFocus() const;
// TQt defines the following as uint rather than int because it uses the
// AutoFormatting enum as a set of flags. Because SIP implements enums
// as a subclass of int they are always signed. AutoAll is defined as
// 0xffffffff which Python converts to -1 and then fails to convert it
// to an unsigned. For the moment we just lie to SIP about the type
// and let the compiler handle it.
void setAutoFormatting(int);
int autoFormatting() const;
%End
%If (TQt_3_3_0 -)
TQSyntaxHighlighter *syntaxHighlighter() const;
%End
public slots:
void setEnabled(bool);
virtual void setMimeSourceFactory(TQMimeSourceFactory *);
virtual void setStyleSheet(TQStyleSheet *);
virtual void scrollToAnchor(const TQString &);
virtual void setPaper(const TQBrush &);
virtual void setLinkUnderline(bool);
virtual void setWordWrap(WordWrap);
virtual void setWrapColumnOrWidth(int);
virtual void setWrapPolicy(WrapPolicy);
virtual void copy();
virtual void append(const TQString &);
void setText(const TQString &);
virtual void setText(const TQString &,const TQString &);
virtual void setTextFormat(TextFormat);
virtual void selectAll(bool = 1);
virtual void setTabStopWidth(int);
virtual void zoomIn(int);
virtual void zoomIn();
virtual void zoomOut(int);
virtual void zoomOut();
virtual void zoomTo(int);
virtual void sync();
virtual void setReadOnly(bool);
virtual void undo();
virtual void redo();
virtual void cut();
virtual void paste();
virtual void pasteSubType(const TQCString &);
virtual void clear();
virtual void del() /PyName=delChar/;
virtual void indent();
virtual void setItalic(bool);
virtual void setBold(bool);
virtual void setUnderline(bool);
virtual void setFamily(const TQString &);
virtual void setPointSize(int);
virtual void setColor(const TQColor &);
virtual void setFont(const TQFont &);
virtual void setVerticalAlignment(VerticalAlignment);
virtual void setAlignment(int);
virtual void setParagType(TQStyleSheetItem::DisplayMode,
TQStyleSheetItem::ListStyle);
virtual void setCursorPosition(int,int);
virtual void setSelection(int,int,int,int,int = 0);
virtual void setSelectionAttributes(int,const TQColor &,bool);
virtual void setModified(bool);
virtual void resetFormat();
virtual void setUndoDepth(int);
// Marked as internal in the TQt3 beta.
// virtual void setFormat(TQTextFormat *,int);
virtual void ensureCursorVisible();
virtual void placeCursor(const TQPoint &,TQTextCursor * = 0);
virtual void moveCursor(CursorAction,bool);
virtual void doKeyboardAction(KeyboardAction);
virtual void removeSelectedText(int = 0);
virtual void removeSelection(int = 0);
virtual void setCurrentFont(const TQFont &);
virtual void setOverwriteMode(bool);
virtual void scrollToBottom();
%If (TQt_3_1_0 -)
void insert(const TQString &,uint = CheckNewLines | RemoveSelected);
virtual void insert(const TQString &,bool,bool = 1,bool = 1);
%End
%If (- TQt_3_1_0)
virtual void insert(const TQString &,bool = 0,bool = 1,bool = 1);
%End
virtual void insertAt(const TQString &,int,int);
virtual void removeParagraph(int);
virtual void insertParagraph(const TQString &,int);
virtual void setParagraphBackgroundColor(int,const TQColor &);
virtual void clearParagraphBackground(int);
virtual void setUndoRedoEnabled(bool);
%If (TQt_3_1_0 -)
void setTabChangesFocus(bool);
void polish();
%End
%If (TQt_3_2_0 -)
void setMaxLogLines(int);
int maxLogLines();
%End
signals:
void textChanged();
void selectionChanged();
void copyAvailable(bool);
void undoAvailable(bool);
void redoAvailable(bool);
void currentFontChanged(const TQFont &);
void currentColorChanged(const TQColor &);
void currentAlignmentChanged(int);
void currentVerticalAlignmentChanged(VerticalAlignment);
void cursorPositionChanged(TQTextCursor *);
void cursorPositionChanged(int,int);
void returnPressed();
void modificationChanged(bool);
%If (TQt_3_1_0 -)
void clicked(int,int);
void doubleClicked(int,int);
%End
protected:
void repaintChanged();
void updateStyles();
void drawContents(TQPainter *,int,int,int,int);
bool event(TQEvent *);
void keyPressEvent(TQKeyEvent *);
void resizeEvent(TQResizeEvent *);
void viewportResizeEvent(TQResizeEvent *);
void contentsMousePressEvent(TQMouseEvent *);
void contentsMouseMoveEvent(TQMouseEvent *);
void contentsMouseReleaseEvent(TQMouseEvent *);
void contentsMouseDoubleClickEvent(TQMouseEvent *);
void contentsWheelEvent(TQWheelEvent *);
void imStartEvent(TQIMEvent *);
void imComposeEvent(TQIMEvent *);
void imEndEvent(TQIMEvent *);
void contentsDragEnterEvent(TQDragEnterEvent *);
void contentsDragMoveEvent(TQDragMoveEvent *);
void contentsDragLeaveEvent(TQDragLeaveEvent *);
void contentsDropEvent(TQDropEvent *);
void contentsContextMenuEvent(TQContextMenuEvent *);
bool focusNextPrevChild(bool);
TQTextDocument *document() const;
TQTextCursor *textCursor() const;
void setDocument(TQTextDocument *);
virtual TQPopupMenu *createPopupMenu(const TQPoint &) /Factory/;
virtual TQPopupMenu *createPopupMenu() /Factory/;
void drawCursor(bool);
void windowActivationChange(bool);
protected slots:
virtual void doChangeInterval();
%If (TQt_3_1_0 -)
void sliderReleased();
%End
private:
%If (TQt_3_1_0 -)
TQTextEdit(const TQTextEdit &);
%End
};
%End