File: qtextboundaryfinder.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (68 lines) | stat: -rw-r--r-- 12,024 bytes parent folder | download
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
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTextBoundaryFinder Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTextBoundaryFinder Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QTextBoundaryFinder class provides a way of finding Unicode text boundaries in a string. <a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qtextboundaryfinder.html#BoundaryReason-enum">BoundaryReason</a></b> { NotAtBoundary, StartWord, EndWord }</li><li><div class="fn" />class <b><a href="qtextboundaryfinder-boundaryreasons.html">BoundaryReasons</a></b></li><li><div class="fn" />enum <b><a href="qtextboundaryfinder.html#BoundaryType-enum">BoundaryType</a></b> { Grapheme, Word, Line, Sentence }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtextboundaryfinder.html#QTextBoundaryFinder">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextboundaryfinder.html#QTextBoundaryFinder-2">__init__</a></b> (<i>self</i>, QTextBoundaryFinder)</li><li><div class="fn" /><b><a href="qtextboundaryfinder.html#QTextBoundaryFinder-3">__init__</a></b> (<i>self</i>, BoundaryType, QString)</li><li><div class="fn" />BoundaryReasons <b><a href="qtextboundaryfinder.html#boundaryReasons">boundaryReasons</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextboundaryfinder.html#isAtBoundary">isAtBoundary</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextboundaryfinder.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextboundaryfinder.html#position">position</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextboundaryfinder.html#setPosition">setPosition</a></b> (<i>self</i>, int)</li><li><div class="fn" />QString <b><a href="qtextboundaryfinder.html#string">string</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextboundaryfinder.html#toEnd">toEnd</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextboundaryfinder.html#toNextBoundary">toNextBoundary</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextboundaryfinder.html#toPreviousBoundary">toPreviousBoundary</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextboundaryfinder.html#toStart">toStart</a></b> (<i>self</i>)</li><li><div class="fn" />BoundaryType <b><a href="qtextboundaryfinder.html#type">type</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTextBoundaryFinder class provides a way of finding Unicode text boundaries in a string.</p>
<p>QTextBoundaryFinder allows to find Unicode text boundaries in a string, similar to the Unicode text boundary specification (see http://www.unicode.org/reports/tr29/tr29-11.html).</p>
<p>QTextBoundaryFinder can operate on a <a href="qstring.html">QString</a> in four possible modes depending on the value of <i>BoundaryType</i>.</p>
<p>Units of Unicode characters that make up what the user thinks of as a character or basic unit of the language are here called Grapheme clusters. The two unicode characters 'A' + diaeresis do for example form one grapheme cluster as the user thinks of them as one character, yet it is in this case represented by two unicode code points.</p>
<p>Word boundaries are there to locate the start and end of what a language considers to be a word.</p>
<p>Line break boundaries give possible places where a line break might happen and sentence boundaries will show the beginning and end of whole sentences.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="BoundaryReason-enum" />QTextBoundaryFinder.BoundaryReason</h3><p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QTextBoundaryFinder.NotAtBoundary</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The boundary finder is not at a boundary position.</td></tr>
<tr><td valign="top"><tt>QTextBoundaryFinder.StartWord</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The boundary finder is at the start of a word.</td></tr>
<tr><td valign="top"><tt>QTextBoundaryFinder.EndWord</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The boundary finder is at the end of a word.</td></tr>
</table></p>
<p>The BoundaryReasons type is a typedef for <a href="qflags.html">QFlags</a>&lt;BoundaryReason&gt;. It stores an OR combination of BoundaryReason values.</p>
<a name="//apple_ref/cpp/tag/QTextBoundaryFinder/BoundaryType" />
<a name="//apple_ref/cpp/econst/QTextBoundaryFinder/Grapheme" />
<a name="//apple_ref/cpp/econst/QTextBoundaryFinder/Word" />
<a name="//apple_ref/cpp/econst/QTextBoundaryFinder/Line" />
<a name="//apple_ref/cpp/econst/QTextBoundaryFinder/Sentence" />
<h3 class="fn"><a name="BoundaryType-enum" />QTextBoundaryFinder.BoundaryType</h3><p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QTextBoundaryFinder.Grapheme</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Finds a grapheme which is the smallest boundary. It including letters, punctation marks, numerals and more.</td></tr>
<tr><td valign="top"><tt>QTextBoundaryFinder.Word</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Finds a word.</td></tr>
<tr><td valign="top"><tt>QTextBoundaryFinder.Line</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Finds possible positions for breaking the text into multiple lines.</td></tr>
<tr><td valign="top"><tt>QTextBoundaryFinder.Sentence</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Finds sentence boundaries. These include periods, question marks etc.</td></tr>
</table></p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTextBoundaryFinder" />QTextBoundaryFinder.__init__ (<i>self</i>)</h3><p>Constructs an invalid <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a> object.</p>
<h3 class="fn"><a name="QTextBoundaryFinder-2" />QTextBoundaryFinder.__init__ (<i>self</i>, <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a>)</h3><p>Copies the <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a> object, <i>other</i>.</p>
<h3 class="fn"><a name="QTextBoundaryFinder-3" />QTextBoundaryFinder.__init__ (<i>self</i>, <a href="qtextboundaryfinder.html#BoundaryType-enum">BoundaryType</a>, QString)</h3><p>Creates a <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a> object of <i>type</i> operating on <i>string</i>.</p>
<h3 class="fn"><a name="boundaryReasons" /><a href="qtextboundaryfinder-boundaryreasons.html">BoundaryReasons</a> QTextBoundaryFinder.boundaryReasons (<i>self</i>)</h3><p>Returns the reasons for the boundary finder to have chosen the current position as a boundary.</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/isAtBoundary" />
<h3 class="fn"><a name="isAtBoundary" />bool QTextBoundaryFinder.isAtBoundary (<i>self</i>)</h3><p>Returns true if the object's <a href="qtextboundaryfinder.html#position">position</a>() is currently at a valid text boundary.</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/isValid" />
<h3 class="fn"><a name="isValid" />bool QTextBoundaryFinder.isValid (<i>self</i>)</h3><p>Returns true if the text boundary finder is valid; otherwise returns false. A default <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a> is invalid.</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/position" />
<h3 class="fn"><a name="position" />int QTextBoundaryFinder.position (<i>self</i>)</h3><p>Returns the current position of the <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a>.</p>
<p>The range is from 0 (the beginning of the string) to the length of the string inclusive.</p>
<p>See also <a href="qtextboundaryfinder.html#setPosition">setPosition</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/setPosition" />
<h3 class="fn"><a name="setPosition" />QTextBoundaryFinder.setPosition (<i>self</i>, int)</h3><p>Sets the current position of the <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a> to <i>position</i>.</p>
<p>If <i>position</i> is out of bounds, it will be bound to only valid positions. In this case, valid positions are from 0 to the length of the string inclusive.</p>
<p>See also <a href="qtextboundaryfinder.html#position">position</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/string" />
<h3 class="fn"><a name="string" />QString QTextBoundaryFinder.string (<i>self</i>)</h3><p>Returns the string the <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a> object operates on.</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/toEnd" />
<h3 class="fn"><a name="toEnd" />QTextBoundaryFinder.toEnd (<i>self</i>)</h3><p>Moves the finder to the end of the string. This is equivalent to setPosition(string.length()).</p>
<p>See also <a href="qtextboundaryfinder.html#setPosition">setPosition</a>() and <a href="qtextboundaryfinder.html#position">position</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/toNextBoundary" />
<h3 class="fn"><a name="toNextBoundary" />int QTextBoundaryFinder.toNextBoundary (<i>self</i>)</h3><p>Moves the <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a> to the next boundary position and returns that position.</p>
<p>Returns -1 is there is no next boundary.</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/toPreviousBoundary" />
<h3 class="fn"><a name="toPreviousBoundary" />int QTextBoundaryFinder.toPreviousBoundary (<i>self</i>)</h3><p>Moves the <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a> to the previous boundary position and returns that position.</p>
<p>Returns -1 is there is no previous boundary.</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/toStart" />
<h3 class="fn"><a name="toStart" />QTextBoundaryFinder.toStart (<i>self</i>)</h3><p>Moves the finder to the start of the string. This is equivalent to setPosition(0).</p>
<p>See also <a href="qtextboundaryfinder.html#setPosition">setPosition</a>() and <a href="qtextboundaryfinder.html#position">position</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/type" />
<h3 class="fn"><a name="type" /><a href="qtextboundaryfinder.html#BoundaryType-enum">BoundaryType</a> QTextBoundaryFinder.type (<i>self</i>)</h3><p>Returns the type of the <a href="qtextboundaryfinder.html">QTextBoundaryFinder</a>.</p>
<a name="//apple_ref/cpp/instm/QTextBoundaryFinder/operator=" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>