~neon/pykde4/master

« back to all changes in this revision

Viewing changes to docs/html/ktexteditor/KTextEditor.MdiContainer.html

  • Committer: Simon Edwards
  • Date: 2013-05-17 19:15:12 UTC
  • Revision ID: git-v1:a46160bff9c0346159e2d50fd33680a25403b964
Updated the ktexteditor bindings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 
4
 
 
5
<head>
 
6
  <title>KTextEditor.MdiContainer</title>
 
7
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
8
  <meta http-equiv="Content-Style-Type" content="text/css" />
 
9
  <link rel="stylesheet" type="text/css" href="../common/doxygen.css" />
 
10
  <link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" />
 
11
</head>
 
12
<body>
 
13
<div id="container">
 
14
<div id="header">
 
15
  <div id="header_top">
 
16
    <div>
 
17
      <div>
 
18
        <img alt ="" src="../common/top-kde.jpg"/>
 
19
        KDE 4.9 PyKDE API Reference
 
20
      </div>
 
21
    </div>
 
22
  </div>
 
23
  <div id="header_bottom">
 
24
    <div id="location">
 
25
      <ul>
 
26
        <li>KDE's Python API</li>
 
27
      </ul>
 
28
    </div>
 
29
 
 
30
    <div id="menu">
 
31
      <ul>
 
32
        <li><a href="../modules.html">Overview</a></li>
 
33
<li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li>
 
34
<li><a href="http://kde.org/family/">Sitemap</a></li>
 
35
<li><a href="http://kde.org/contact/">Contact Us</a></li>
 
36
</ul>
 
37
    </div>
 
38
  </div>
 
39
</div>
 
40
 
 
41
<div id="body_wrapper">
 
42
<div id="body">
 
43
<div id="right">
 
44
<div class="content">
 
45
<div id="main">
 
46
<div class="clearer">&nbsp;</div>
 
47
 
 
48
<h1>MdiContainer Class Reference</h1>
 
49
<code>from PyKDE4.ktexteditor import *</code>
 
50
<p>
 
51
 
 
52
 
 
53
Namespace: <a href="../ktexteditor/KTextEditor.html">KTextEditor</a><br />
 
54
<h2>Detailed Description</h2>
 
55
 
 
56
<p>A container for MDI-capable kpart hosts.
 
57
</p>
 
58
<p>
 
59
The kpart container for the KTextEditor interface may have different
 
60
capabilities. For example, inside KDevelop or Kate, the container can
 
61
manage multiple views and multiple documents. However, if the kpart text
 
62
is used inside konqueror as a replacement of the text entry in html
 
63
forms, the container will only support one view with one document.
 
64
</p>
 
65
<p>
 
66
This class allows the kpart component to create and delete views, create
 
67
and delete documents, fetch and set the current view. Note that the
 
68
ktexteditor framework already supports multiple document and views and
 
69
that the kpart host can create them and delete them as it wishes. What
 
70
this class provides is the ability for the &lt;i&gt;kpart component&lt;/i&gt; being
 
71
hosted to do the same.
 
72
</p>
 
73
<p>
 
74
An instance of this extension should be set with
 
75
ContainerInterface.setContainerExtension().Check ContainerInterface() to
 
76
see how to obtain an instance of ContainerInterface. The instance should
 
77
inherit QObject, inherit MdiContainer, declare the Q_OBJECT macro and
 
78
declare a Q_INTERFACES(KTextEditor.MdiContainer) .
 
79
</p>
 
80
<p>
 
81
Code example to support MdiContainer (in the kpart host):
 
82
<pre class="fragment">
 
83
 class MyMdiContainer : public QObject,
 
84
                        public MdiContainer
 
85
 {
 
86
   Q_OBJECT
 
87
   Q_INTERFACES( KTextEditor.MdiContainer )
 
88
 
 
89
   public:
 
90
     // ...
 
91
 }
 
92
</pre>
 
93
</p>
 
94
<p>
 
95
To check if the kpart hosts supports the MDI container:
 
96
<pre class="fragment">
 
97
 Editor * editor = KTextEditor.EditorChooser.editor();
 
98
 ContainerInterface * iface = qobject_cast&lt;ContainerInterface *&gt;( editor );
 
99
 if (iface) {
 
100
   MdiContainer * mdiContainer = qobject_cast&lt;MdiContainer *&gt;( iface-&gt;container() );
 
101
   if (MdiContainer != NULL ) {
 
102
    // great, I can create additional views
 
103
    // ...
 
104
   }
 
105
 }
 
106
</pre>
 
107
</p>
 
108
<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Methods</h2></td></tr>
 
109
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#MdiContainer">__init__</a> (self)</td></tr>
 
110
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../ktexteditor/KTextEditor.View.html">KTextEditor.View</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#activeView">activeView</a> (self)</td></tr>
 
111
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#closeDocument">closeDocument</a> (self, <a href="../ktexteditor/KTextEditor.Document.html">KTextEditor.Document</a> doc)</td></tr>
 
112
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#closeView">closeView</a> (self, <a href="../ktexteditor/KTextEditor.View.html">KTextEditor.View</a> view)</td></tr>
 
113
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../ktexteditor/KTextEditor.Document.html">KTextEditor.Document</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#createDocument">createDocument</a> (self)</td></tr>
 
114
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../ktexteditor/KTextEditor.View.html">KTextEditor.View</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#createView">createView</a> (self, <a href="../ktexteditor/KTextEditor.Document.html">KTextEditor.Document</a> doc)</td></tr>
 
115
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setActiveView">setActiveView</a> (self, <a href="../ktexteditor/KTextEditor.View.html">KTextEditor.View</a> view)</td></tr>
 
116
</table>
 
117
<hr><h2>Method Documentation</h2><a class="anchor" name="MdiContainer"></a>
 
118
<div class="memitem">
 
119
<div class="memproto">
 
120
<table class="memname"><tr>
 
121
<td class="memname">__init__</td>
 
122
<td>(</td>
 
123
<td class="paramtype">&nbsp;</td>
 
124
<td class="paramname"><em>self</em>&nbsp;)</td>
 
125
<td width="100%"> </td>
 
126
</tr>
 
127
</table>
 
128
</div>
 
129
<div class="memdoc"><p>Constructor
 
130
</p></div></div><a class="anchor" name="activeView"></a>
 
131
<div class="memitem">
 
132
<div class="memproto">
 
133
<table class="memname"><tr>
 
134
<td class="memname"><a href="../ktexteditor/KTextEditor.View.html">KTextEditor.View</a> activeView</td>
 
135
<td>(</td>
 
136
<td class="paramtype">&nbsp;</td>
 
137
<td class="paramname"><em>self</em>&nbsp;)</td>
 
138
<td width="100%"> </td>
 
139
</tr>
 
140
</table>
 
141
</div>
 
142
<div class="memdoc"><dl compact><dt><b>Abstract method:</b></dt><dd>This method is abstract and can be overridden but not called directly.</dd></dl><p>Get the current activew view.
 
143
</p>
 
144
<p>
 
145
<dl class="return" compact><dt><b>Returns:</b></dt><dd> the active view.
 
146
</dd></dl> </p>
 
147
<p>
 
148
\sa setActiveView
 
149
</p></div></div><a class="anchor" name="closeDocument"></a>
 
150
<div class="memitem">
 
151
<div class="memproto">
 
152
<table class="memname"><tr>
 
153
<td class="memname">bool closeDocument</td>
 
154
<td>(</td>
 
155
<td class="paramtype">&nbsp;<em>self</em>, </td>
 
156
<td class="paramname"></td>
 
157
</tr><tr>
 
158
<td class="memname"></td>
 
159
<td></td>
 
160
<td class="paramtype"><a href="../ktexteditor/KTextEditor.Document.html">KTextEditor.Document</a>&nbsp;</td>
 
161
<td class="paramname"><em>doc</em></td>
 
162
</tr>
 
163
<tr>
 
164
<td></td>
 
165
<td>)</td>
 
166
<td></td>
 
167
<td></td>
 
168
<td width="100%"> </td>
 
169
</tr></table>
 
170
</div>
 
171
<div class="memdoc"><dl compact><dt><b>Abstract method:</b></dt><dd>This method is abstract and can be overridden but not called directly.</dd></dl><p>Closes of document <b>doc</b> .
 
172
</p>
 
173
<p>
 
174
The document is about to be closed but is still valid when this
 
175
call is made. The Document does not contain any view when this
 
176
call is made (closeView() has been called on all the views of the
 
177
document previously).
 
178
</p>
 
179
<p>
 
180
The signal aboutToClose() is emitted before this method is
 
181
called.
 
182
</p>
 
183
<p>
 
184
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if the removal is authorized and acted, or
 
185
false if removing documents by the kpart is not supported
 
186
by the container.
 
187
</dd></dl>
 
188
</p></div></div><a class="anchor" name="closeView"></a>
 
189
<div class="memitem">
 
190
<div class="memproto">
 
191
<table class="memname"><tr>
 
192
<td class="memname">bool closeView</td>
 
193
<td>(</td>
 
194
<td class="paramtype">&nbsp;<em>self</em>, </td>
 
195
<td class="paramname"></td>
 
196
</tr><tr>
 
197
<td class="memname"></td>
 
198
<td></td>
 
199
<td class="paramtype"><a href="../ktexteditor/KTextEditor.View.html">KTextEditor.View</a>&nbsp;</td>
 
200
<td class="paramname"><em>view</em></td>
 
201
</tr>
 
202
<tr>
 
203
<td></td>
 
204
<td>)</td>
 
205
<td></td>
 
206
<td></td>
 
207
<td width="100%"> </td>
 
208
</tr></table>
 
209
</div>
 
210
<div class="memdoc"><dl compact><dt><b>Abstract method:</b></dt><dd>This method is abstract and can be overridden but not called directly.</dd></dl><p>Closes the View <b>view</b> .
 
211
</p>
 
212
<p>
 
213
The view is still valid when this call is made but will be deleted
 
214
shortly after.
 
215
</p>
 
216
<p>
 
217
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if the removal is authorized and acted, or
 
218
false if the container does not support view removing from
 
219
the kpart, or
 
220
</dd></dl>
 
221
</p></div></div><a class="anchor" name="createDocument"></a>
 
222
<div class="memitem">
 
223
<div class="memproto">
 
224
<table class="memname"><tr>
 
225
<td class="memname"><a href="../ktexteditor/KTextEditor.Document.html">KTextEditor.Document</a> createDocument</td>
 
226
<td>(</td>
 
227
<td class="paramtype">&nbsp;</td>
 
228
<td class="paramname"><em>self</em>&nbsp;)</td>
 
229
<td width="100%"> </td>
 
230
</tr>
 
231
</table>
 
232
</div>
 
233
<div class="memdoc"><dl compact><dt><b>Abstract method:</b></dt><dd>This method is abstract and can be overridden but not called directly.</dd></dl><p>Create a new Document and return it to the kpart.
 
234
</p>
 
235
<p>
 
236
Canonical implementation is:
 
237
<pre class="fragment">
 
238
 Document * createDocument()
 
239
 {
 
240
     Document * doc;
 
241
     // set parentQObject to relevant value
 
242
     doc = editor-&gt;createDocument( parentQObject );
 
243
     // integrate the new document in the document list of the
 
244
     // container, ...
 
245
     return doc;
 
246
 }
 
247
</pre>
 
248
</p>
 
249
<p>
 
250
The signal documentCreated() will be emitted during the creation.
 
251
</p>
 
252
<p>
 
253
<dl class="return" compact><dt><b>Returns:</b></dt><dd> a pointer to the new Document object.
 
254
</dd></dl>
 
255
</p></div></div><a class="anchor" name="createView"></a>
 
256
<div class="memitem">
 
257
<div class="memproto">
 
258
<table class="memname"><tr>
 
259
<td class="memname"><a href="../ktexteditor/KTextEditor.View.html">KTextEditor.View</a> createView</td>
 
260
<td>(</td>
 
261
<td class="paramtype">&nbsp;<em>self</em>, </td>
 
262
<td class="paramname"></td>
 
263
</tr><tr>
 
264
<td class="memname"></td>
 
265
<td></td>
 
266
<td class="paramtype"><a href="../ktexteditor/KTextEditor.Document.html">KTextEditor.Document</a>&nbsp;</td>
 
267
<td class="paramname"><em>doc</em></td>
 
268
</tr>
 
269
<tr>
 
270
<td></td>
 
271
<td>)</td>
 
272
<td></td>
 
273
<td></td>
 
274
<td width="100%"> </td>
 
275
</tr></table>
 
276
</div>
 
277
<div class="memdoc"><dl compact><dt><b>Abstract method:</b></dt><dd>This method is abstract and can be overridden but not called directly.</dd></dl><p>Creates a new View and return it to the kpart.
 
278
</p>
 
279
<p>
 
280
Canonical implementation is:
 
281
<pre class="fragment">
 
282
 View * createView( Document * doc )
 
283
 {
 
284
     // set parentWidget to relevant value
 
285
     return doc-&gt;createView( parentWidget );
 
286
 }
 
287
</pre>
 
288
</p>
 
289
<p>
 
290
The signal viewCreated() will be emitted during the createView()
 
291
call.
 
292
</p>
 
293
<p>
 
294
<dl class="return" compact><dt><b>Returns:</b></dt><dd> a pointer to the new View created.
 
295
</dd></dl>
 
296
</p></div></div><a class="anchor" name="setActiveView"></a>
 
297
<div class="memitem">
 
298
<div class="memproto">
 
299
<table class="memname"><tr>
 
300
<td class="memname"> setActiveView</td>
 
301
<td>(</td>
 
302
<td class="paramtype">&nbsp;<em>self</em>, </td>
 
303
<td class="paramname"></td>
 
304
</tr><tr>
 
305
<td class="memname"></td>
 
306
<td></td>
 
307
<td class="paramtype"><a href="../ktexteditor/KTextEditor.View.html">KTextEditor.View</a>&nbsp;</td>
 
308
<td class="paramname"><em>view</em></td>
 
309
</tr>
 
310
<tr>
 
311
<td></td>
 
312
<td>)</td>
 
313
<td></td>
 
314
<td></td>
 
315
<td width="100%"> </td>
 
316
</tr></table>
 
317
</div>
 
318
<div class="memdoc"><dl compact><dt><b>Abstract method:</b></dt><dd>This method is abstract and can be overridden but not called directly.</dd></dl><p>Set the <b>view</b> requested by the part as the active view.
 
319
</p>
 
320
<p>
 
321
\sa activeView
 
322
</p></div></div>
 
323
</div>
 
324
</div>
 
325
</div>
 
326
 
 
327
<div id="left">
 
328
 
 
329
<div class="menu_box">
 
330
<div class="nav_list">
 
331
<ul>
 
332
<li><a href="../allclasses.html">Full Index</a></li>
 
333
</ul>
 
334
</div>
 
335
 
 
336
<a name="cp-menu" /><div class="menutitle"><div>
 
337
  <h2 id="cp-menu-project">Modules</h2>
 
338
</div></div>
 
339
<div class="nav_list">
 
340
<ul><li><a href="../akonadi/index.html">akonadi</a></li>
 
341
<li><a href="../dnssd/index.html">dnssd</a></li>
 
342
<li><a href="../kdecore/index.html">kdecore</a></li>
 
343
<li><a href="../kdeui/index.html">kdeui</a></li>
 
344
<li><a href="../khtml/index.html">khtml</a></li>
 
345
<li><a href="../kio/index.html">kio</a></li>
 
346
<li><a href="../knewstuff/index.html">knewstuff</a></li>
 
347
<li><a href="../kparts/index.html">kparts</a></li>
 
348
<li><a href="../kutils/index.html">kutils</a></li>
 
349
<li><a href="../nepomuk/index.html">nepomuk</a></li>
 
350
<li><a href="../phonon/index.html">phonon</a></li>
 
351
<li><a href="../plasma/index.html">plasma</a></li>
 
352
<li><a href="../polkitqt/index.html">polkitqt</a></li>
 
353
<li><a href="../solid/index.html">solid</a></li>
 
354
<li><a href="../soprano/index.html">soprano</a></li>
 
355
</ul></div></div>
 
356
 
 
357
</div>
 
358
 
 
359
</div>
 
360
  <div class="clearer"/>
 
361
</div>
 
362
 
 
363
<div id="end_body"></div>
 
364
</div>
 
365
<div id="footer"><div id="footer_text">
 
366
This documentation is maintained by <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;simon&#64;simonzone&#46;com">Simon Edwards</a>.<br />
 
367
        KDE<sup>&#174;</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>&#174;</sup> logo</a> are registered trademarks of <a href="http://ev.kde.org/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
 
368
        <a href="http://www.kde.org/contact/impressum.php">Legal</a>
 
369
    </div></div>
 
370
</body>
 
371
</html>