File: qtextcursor_c.cpp

package info (click to toggle)
libqtpas 2.6%2B2.0.8%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,860 kB
  • sloc: cpp: 56,595; pascal: 13,727; sh: 44; makefile: 18
file content (390 lines) | stat: -rw-r--r-- 10,871 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
//******************************************************************************
//  Copyright (c) 2005-2013 by Jan Van hijfte
//
//  See the included file COPYING.TXT for details about the copyright.
//
//  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.
//******************************************************************************


#include "qtextcursor_c.h"

QTextCursorH QTextCursor_Create()
{
	return (QTextCursorH) new QTextCursor();
}

void QTextCursor_Destroy(QTextCursorH handle)
{
	delete (QTextCursor *)handle;
}

QTextCursorH QTextCursor_Create2(QTextDocumentH document)
{
	return (QTextCursorH) new QTextCursor((QTextDocument*)document);
}

QTextCursorH QTextCursor_Create3(QTextFrameH frame)
{
	return (QTextCursorH) new QTextCursor((QTextFrame*)frame);
}

QTextCursorH QTextCursor_Create4(const QTextBlockH block)
{
	return (QTextCursorH) new QTextCursor(*(const QTextBlock*)block);
}

QTextCursorH QTextCursor_Create6(const QTextCursorH cursor)
{
	return (QTextCursorH) new QTextCursor(*(const QTextCursor*)cursor);
}

void QTextCursor_swap(QTextCursorH handle, QTextCursorH other)
{
	((QTextCursor *)handle)->swap(*(QTextCursor*)other);
}

bool QTextCursor_isNull(QTextCursorH handle)
{
	return (bool) ((QTextCursor *)handle)->isNull();
}

void QTextCursor_setPosition(QTextCursorH handle, int pos, QTextCursor::MoveMode mode)
{
	((QTextCursor *)handle)->setPosition(pos, mode);
}

int QTextCursor_position(QTextCursorH handle)
{
	return (int) ((QTextCursor *)handle)->position();
}

int QTextCursor_positionInBlock(QTextCursorH handle)
{
	return (int) ((QTextCursor *)handle)->positionInBlock();
}

int QTextCursor_anchor(QTextCursorH handle)
{
	return (int) ((QTextCursor *)handle)->anchor();
}

void QTextCursor_insertText(QTextCursorH handle, PWideString text)
{
	QString t_text;
	copyPWideStringToQString(text, t_text);
	((QTextCursor *)handle)->insertText(t_text);
}

void QTextCursor_insertText2(QTextCursorH handle, PWideString text, const QTextCharFormatH format)
{
	QString t_text;
	copyPWideStringToQString(text, t_text);
	((QTextCursor *)handle)->insertText(t_text, *(const QTextCharFormat*)format);
}

bool QTextCursor_movePosition(QTextCursorH handle, QTextCursor::MoveOperation op, QTextCursor::MoveMode AnonParam2, int n)
{
	return (bool) ((QTextCursor *)handle)->movePosition(op, AnonParam2, n);
}

bool QTextCursor_visualNavigation(QTextCursorH handle)
{
	return (bool) ((QTextCursor *)handle)->visualNavigation();
}

void QTextCursor_setVisualNavigation(QTextCursorH handle, bool b)
{
	((QTextCursor *)handle)->setVisualNavigation(b);
}

void QTextCursor_setVerticalMovementX(QTextCursorH handle, int x)
{
	((QTextCursor *)handle)->setVerticalMovementX(x);
}

int QTextCursor_verticalMovementX(QTextCursorH handle)
{
	return (int) ((QTextCursor *)handle)->verticalMovementX();
}

void QTextCursor_setKeepPositionOnInsert(QTextCursorH handle, bool b)
{
	((QTextCursor *)handle)->setKeepPositionOnInsert(b);
}

bool QTextCursor_keepPositionOnInsert(QTextCursorH handle)
{
	return (bool) ((QTextCursor *)handle)->keepPositionOnInsert();
}

void QTextCursor_deleteChar(QTextCursorH handle)
{
	((QTextCursor *)handle)->deleteChar();
}

void QTextCursor_deletePreviousChar(QTextCursorH handle)
{
	((QTextCursor *)handle)->deletePreviousChar();
}

void QTextCursor_select(QTextCursorH handle, QTextCursor::SelectionType selection)
{
	((QTextCursor *)handle)->select(selection);
}

bool QTextCursor_hasSelection(QTextCursorH handle)
{
	return (bool) ((QTextCursor *)handle)->hasSelection();
}

bool QTextCursor_hasComplexSelection(QTextCursorH handle)
{
	return (bool) ((QTextCursor *)handle)->hasComplexSelection();
}

void QTextCursor_removeSelectedText(QTextCursorH handle)
{
	((QTextCursor *)handle)->removeSelectedText();
}

void QTextCursor_clearSelection(QTextCursorH handle)
{
	((QTextCursor *)handle)->clearSelection();
}

int QTextCursor_selectionStart(QTextCursorH handle)
{
	return (int) ((QTextCursor *)handle)->selectionStart();
}

int QTextCursor_selectionEnd(QTextCursorH handle)
{
	return (int) ((QTextCursor *)handle)->selectionEnd();
}

void QTextCursor_selectedText(QTextCursorH handle, PWideString retval)
{
	QString t_retval;
	t_retval = ((QTextCursor *)handle)->selectedText();
	copyQStringToPWideString(t_retval, retval);
}

void QTextCursor_selection(QTextCursorH handle, QTextDocumentFragmentH retval)
{
	*(QTextDocumentFragment *)retval = ((QTextCursor *)handle)->selection();
}

void QTextCursor_selectedTableCells(QTextCursorH handle, int* firstRow, int* numRows, int* firstColumn, int* numColumns)
{
	((QTextCursor *)handle)->selectedTableCells(firstRow, numRows, firstColumn, numColumns);
}

void QTextCursor_block(QTextCursorH handle, QTextBlockH retval)
{
	*(QTextBlock *)retval = ((QTextCursor *)handle)->block();
}

void QTextCursor_charFormat(QTextCursorH handle, QTextCharFormatH retval)
{
	*(QTextCharFormat *)retval = ((QTextCursor *)handle)->charFormat();
}

void QTextCursor_setCharFormat(QTextCursorH handle, const QTextCharFormatH format)
{
	((QTextCursor *)handle)->setCharFormat(*(const QTextCharFormat*)format);
}

void QTextCursor_mergeCharFormat(QTextCursorH handle, const QTextCharFormatH modifier)
{
	((QTextCursor *)handle)->mergeCharFormat(*(const QTextCharFormat*)modifier);
}

void QTextCursor_blockFormat(QTextCursorH handle, QTextBlockFormatH retval)
{
	*(QTextBlockFormat *)retval = ((QTextCursor *)handle)->blockFormat();
}

void QTextCursor_setBlockFormat(QTextCursorH handle, const QTextBlockFormatH format)
{
	((QTextCursor *)handle)->setBlockFormat(*(const QTextBlockFormat*)format);
}

void QTextCursor_mergeBlockFormat(QTextCursorH handle, const QTextBlockFormatH modifier)
{
	((QTextCursor *)handle)->mergeBlockFormat(*(const QTextBlockFormat*)modifier);
}

void QTextCursor_blockCharFormat(QTextCursorH handle, QTextCharFormatH retval)
{
	*(QTextCharFormat *)retval = ((QTextCursor *)handle)->blockCharFormat();
}

void QTextCursor_setBlockCharFormat(QTextCursorH handle, const QTextCharFormatH format)
{
	((QTextCursor *)handle)->setBlockCharFormat(*(const QTextCharFormat*)format);
}

void QTextCursor_mergeBlockCharFormat(QTextCursorH handle, const QTextCharFormatH modifier)
{
	((QTextCursor *)handle)->mergeBlockCharFormat(*(const QTextCharFormat*)modifier);
}

bool QTextCursor_atBlockStart(QTextCursorH handle)
{
	return (bool) ((QTextCursor *)handle)->atBlockStart();
}

bool QTextCursor_atBlockEnd(QTextCursorH handle)
{
	return (bool) ((QTextCursor *)handle)->atBlockEnd();
}

bool QTextCursor_atStart(QTextCursorH handle)
{
	return (bool) ((QTextCursor *)handle)->atStart();
}

bool QTextCursor_atEnd(QTextCursorH handle)
{
	return (bool) ((QTextCursor *)handle)->atEnd();
}

void QTextCursor_insertBlock(QTextCursorH handle)
{
	((QTextCursor *)handle)->insertBlock();
}

void QTextCursor_insertBlock2(QTextCursorH handle, const QTextBlockFormatH format)
{
	((QTextCursor *)handle)->insertBlock(*(const QTextBlockFormat*)format);
}

void QTextCursor_insertBlock3(QTextCursorH handle, const QTextBlockFormatH format, const QTextCharFormatH charFormat)
{
	((QTextCursor *)handle)->insertBlock(*(const QTextBlockFormat*)format, *(const QTextCharFormat*)charFormat);
}

QTextListH QTextCursor_insertList(QTextCursorH handle, const QTextListFormatH format)
{
	return (QTextListH) ((QTextCursor *)handle)->insertList(*(const QTextListFormat*)format);
}

QTextListH QTextCursor_insertList2(QTextCursorH handle, QTextListFormat::Style style)
{
	return (QTextListH) ((QTextCursor *)handle)->insertList(style);
}

QTextListH QTextCursor_createList(QTextCursorH handle, const QTextListFormatH format)
{
	return (QTextListH) ((QTextCursor *)handle)->createList(*(const QTextListFormat*)format);
}

QTextListH QTextCursor_createList2(QTextCursorH handle, QTextListFormat::Style style)
{
	return (QTextListH) ((QTextCursor *)handle)->createList(style);
}

QTextListH QTextCursor_currentList(QTextCursorH handle)
{
	return (QTextListH) ((QTextCursor *)handle)->currentList();
}

QTextTableH QTextCursor_insertTable(QTextCursorH handle, int rows, int cols, const QTextTableFormatH format)
{
	return (QTextTableH) ((QTextCursor *)handle)->insertTable(rows, cols, *(const QTextTableFormat*)format);
}

QTextTableH QTextCursor_insertTable2(QTextCursorH handle, int rows, int cols)
{
	return (QTextTableH) ((QTextCursor *)handle)->insertTable(rows, cols);
}

QTextTableH QTextCursor_currentTable(QTextCursorH handle)
{
	return (QTextTableH) ((QTextCursor *)handle)->currentTable();
}

QTextFrameH QTextCursor_insertFrame(QTextCursorH handle, const QTextFrameFormatH format)
{
	return (QTextFrameH) ((QTextCursor *)handle)->insertFrame(*(const QTextFrameFormat*)format);
}

QTextFrameH QTextCursor_currentFrame(QTextCursorH handle)
{
	return (QTextFrameH) ((QTextCursor *)handle)->currentFrame();
}

void QTextCursor_insertFragment(QTextCursorH handle, const QTextDocumentFragmentH fragment)
{
	((QTextCursor *)handle)->insertFragment(*(const QTextDocumentFragment*)fragment);
}

void QTextCursor_insertHtml(QTextCursorH handle, PWideString html)
{
	QString t_html;
	copyPWideStringToQString(html, t_html);
	((QTextCursor *)handle)->insertHtml(t_html);
}

void QTextCursor_insertImage(QTextCursorH handle, const QTextImageFormatH format, QTextFrameFormat::Position alignment)
{
	((QTextCursor *)handle)->insertImage(*(const QTextImageFormat*)format, alignment);
}

void QTextCursor_insertImage2(QTextCursorH handle, const QTextImageFormatH format)
{
	((QTextCursor *)handle)->insertImage(*(const QTextImageFormat*)format);
}

void QTextCursor_insertImage3(QTextCursorH handle, PWideString name)
{
	QString t_name;
	copyPWideStringToQString(name, t_name);
	((QTextCursor *)handle)->insertImage(t_name);
}

void QTextCursor_insertImage4(QTextCursorH handle, const QImageH image, PWideString name)
{
	QString t_name;
	copyPWideStringToQString(name, t_name);
	((QTextCursor *)handle)->insertImage(*(const QImage*)image, t_name);
}

void QTextCursor_beginEditBlock(QTextCursorH handle)
{
	((QTextCursor *)handle)->beginEditBlock();
}

void QTextCursor_joinPreviousEditBlock(QTextCursorH handle)
{
	((QTextCursor *)handle)->joinPreviousEditBlock();
}

void QTextCursor_endEditBlock(QTextCursorH handle)
{
	((QTextCursor *)handle)->endEditBlock();
}

bool QTextCursor_isCopyOf(QTextCursorH handle, const QTextCursorH other)
{
	return (bool) ((QTextCursor *)handle)->isCopyOf(*(const QTextCursor*)other);
}

int QTextCursor_blockNumber(QTextCursorH handle)
{
	return (int) ((QTextCursor *)handle)->blockNumber();
}

int QTextCursor_columnNumber(QTextCursorH handle)
{
	return (int) ((QTextCursor *)handle)->columnNumber();
}

QTextDocumentH QTextCursor_document(QTextCursorH handle)
{
	return (QTextDocumentH) ((QTextCursor *)handle)->document();
}