Files
harbour-core/harbour/contrib/hbqt/qth/QTextCursor.qth
2010-06-14 19:01:41 +00:00

197 lines
6.8 KiB
Plaintext

/*
* $Id$
*/
/*
* Harbour Project source code:
* QT Source Generator for Harbour
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* www - http://www.harbour-project.org
*
* This program 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.
*
* This program is distributed 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 this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/*----------------------------------------------------------------------*/
;
; Header File to Generate QT Wrapper Sources
;
<CLASS>
QObject = no
Inherits =
Type = PlainObject
New =
</CLASS>
<DOC>
oTextCursor := QTextCursor():new()
oTextCursor := QTextCursor():new( pQTextCursor )
oTextCursor := QTextCursor():new( "QTextDocument", pQTextDocument )
oTextCursor := QTextCursor():new( "QTextBlock" , pQTextBlock )
oTextCursor := QTextCursor():new( "QTextFrame" , pQTextFrame )
</DOC>
<CODE>
#include <QtGui/QTextBlock>
#include <QtGui/QTextCursor>
#include <QtGui/QTextDocumentFragment>
/*
* QTextCursor ()
* QTextCursor ( QTextDocument * document )
* QTextCursor ( QTextFrame * frame )
* QTextCursor ( const QTextBlock & block )
* QTextCursor ( const QTextCursor & cursor )
* ~QTextCursor ()
*/
HB_FUNC( QT_QTEXTCURSOR )
{
if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) )
{
hb_retptr( ( QTextCursor* ) new QTextCursor( *hbqt_par_QTextCursor( 1 ) ) );
}
else if( hb_pcount() == 2 && HB_ISCHAR( 1 ) && HB_ISPOINTER( 2 ) )
{
QString object = hbqt_par_QString( 1 );
if( object == ( QString ) "QTextDocument" )
{
hb_retptr( ( QTextCursor* ) new QTextCursor( hbqt_par_QTextDocument( 2 ) ) );
}
if( object == ( QString ) "QTextBlock" )
{
hb_retptr( ( QTextCursor* ) new QTextCursor( *hbqt_par_QTextBlock( 2 ) ) );
}
if( object == ( QString ) "QTextFrame" )
{
hb_retptr( ( QTextCursor* ) new QTextCursor( hbqt_par_QTextFrame( 2 ) ) );
}
else
{
hb_retptr( ( QTextCursor* ) new QTextCursor() );
}
}
else
{
hb_retptr( ( QTextCursor* ) new QTextCursor() );
}
}
</CODE>
<ENUMS>
enum MoveMode { MoveAnchor, KeepAnchor }
enum MoveOperation { NoMove, Start, StartOfLine, StartOfBlock, ..., PreviousRow }
enum SelectionType { Document, BlockUnderCursor, LineUnderCursor, WordUnderCursor }
</ENUMS>
<PROTOS>
int anchor () const
bool atBlockEnd () const
bool atBlockStart () const
bool atEnd () const
bool atStart () const
void beginEditBlock ()
#
QTextBlock block () const
#
QTextCharFormat blockCharFormat () const
QTextBlockFormat blockFormat () const
int blockNumber () const
QTextCharFormat charFormat () const
void clearSelection ()
int columnNumber () const
QTextList * createList ( const QTextListFormat & format )
QTextList * createList ( QTextListFormat::Style style )
QTextFrame * currentFrame () const
QTextList * currentList () const
//QTextTable * currentTable () const
void deleteChar ()
void deletePreviousChar ()
QTextDocument * document () const
void endEditBlock ()
bool hasComplexSelection () const
bool hasSelection () const
void insertBlock ()
void insertBlock ( const QTextBlockFormat & format )
void insertBlock ( const QTextBlockFormat & format, const QTextCharFormat & charFormat )
void insertFragment ( const QTextDocumentFragment & fragment )
QTextFrame * insertFrame ( const QTextFrameFormat & format )
void insertHtml ( const QString & html )
void insertImage ( const QString & name )
void insertImage ( const QTextImageFormat & format )
void insertImage ( const QTextImageFormat & format, QTextFrameFormat::Position alignment )
void insertImage ( const QImage & image, const QString & name = QString() )
QTextList * insertList ( const QTextListFormat & format )
QTextList * insertList ( QTextListFormat::Style style )
//QTextTable * insertTable ( int rows, int columns, const QTextTableFormat & format )
//QTextTable * insertTable ( int rows, int columns )
void insertText ( const QString & text )
void insertText ( const QString & text, const QTextCharFormat & format )
bool isCopyOf ( const QTextCursor & other ) const
bool isNull () const
void joinPreviousEditBlock ()
void mergeBlockCharFormat ( const QTextCharFormat & modifier )
void mergeBlockFormat ( const QTextBlockFormat & modifier )
void mergeCharFormat ( const QTextCharFormat & modifier )
bool movePosition ( MoveOperation operation, MoveMode mode = MoveAnchor, int n = 1 )
int position () const
void removeSelectedText ()
void select ( SelectionType selection )
void selectedTableCells ( int * firstRow, int * numRows, int * firstColumn, int * numColumns ) const
QString selectedText () const
QTextDocumentFragment selection () const
int selectionEnd () const
int selectionStart () const
void setBlockCharFormat ( const QTextCharFormat & format )
void setBlockFormat ( const QTextBlockFormat & format )
void setCharFormat ( const QTextCharFormat & format )
void setPosition ( int pos, MoveMode m = MoveAnchor )
void setVisualNavigation ( bool b )
bool visualNavigation () const
</PROTOS>
<SLOTS>
</SLOTS>
<SIGNALS>
</SIGNALS>