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">
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" />
18
<img alt ="" src="../common/top-kde.jpg"/>
19
KDE 4.9 PyKDE API Reference
23
<div id="header_bottom">
26
<li>KDE's Python API</li>
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>
41
<div id="body_wrapper">
46
<div class="clearer"> </div>
48
<h1>MdiContainer Class Reference</h1>
49
<code>from PyKDE4.ktexteditor import *</code>
53
Namespace: <a href="../ktexteditor/KTextEditor.html">KTextEditor</a><br />
54
<h2>Detailed Description</h2>
56
<p>A container for MDI-capable kpart hosts.
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.
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 <i>kpart component</i> being
71
hosted to do the same.
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) .
81
Code example to support MdiContainer (in the kpart host):
82
<pre class="fragment">
83
class MyMdiContainer : public QObject,
87
Q_INTERFACES( KTextEditor.MdiContainer )
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<ContainerInterface *>( editor );
100
MdiContainer * mdiContainer = qobject_cast<MdiContainer *>( iface->container() );
101
if (MdiContainer != NULL ) {
102
// great, I can create additional views
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"> </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> </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 </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 </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> </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> </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"> </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>
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>
123
<td class="paramtype"> </td>
124
<td class="paramname"><em>self</em> )</td>
125
<td width="100%"> </td>
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>
136
<td class="paramtype"> </td>
137
<td class="paramname"><em>self</em> )</td>
138
<td width="100%"> </td>
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.
145
<dl class="return" compact><dt><b>Returns:</b></dt><dd> the active view.
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>
155
<td class="paramtype"> <em>self</em>, </td>
156
<td class="paramname"></td>
158
<td class="memname"></td>
160
<td class="paramtype"><a href="../ktexteditor/KTextEditor.Document.html">KTextEditor.Document</a> </td>
161
<td class="paramname"><em>doc</em></td>
168
<td width="100%"> </td>
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> .
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).
180
The signal aboutToClose() is emitted before this method is
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
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>
194
<td class="paramtype"> <em>self</em>, </td>
195
<td class="paramname"></td>
197
<td class="memname"></td>
199
<td class="paramtype"><a href="../ktexteditor/KTextEditor.View.html">KTextEditor.View</a> </td>
200
<td class="paramname"><em>view</em></td>
207
<td width="100%"> </td>
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> .
213
The view is still valid when this call is made but will be deleted
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
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>
227
<td class="paramtype"> </td>
228
<td class="paramname"><em>self</em> )</td>
229
<td width="100%"> </td>
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.
236
Canonical implementation is:
237
<pre class="fragment">
238
Document * createDocument()
241
// set parentQObject to relevant value
242
doc = editor->createDocument( parentQObject );
243
// integrate the new document in the document list of the
250
The signal documentCreated() will be emitted during the creation.
253
<dl class="return" compact><dt><b>Returns:</b></dt><dd> a pointer to the new Document object.
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>
261
<td class="paramtype"> <em>self</em>, </td>
262
<td class="paramname"></td>
264
<td class="memname"></td>
266
<td class="paramtype"><a href="../ktexteditor/KTextEditor.Document.html">KTextEditor.Document</a> </td>
267
<td class="paramname"><em>doc</em></td>
274
<td width="100%"> </td>
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.
280
Canonical implementation is:
281
<pre class="fragment">
282
View * createView( Document * doc )
284
// set parentWidget to relevant value
285
return doc->createView( parentWidget );
290
The signal viewCreated() will be emitted during the createView()
294
<dl class="return" compact><dt><b>Returns:</b></dt><dd> a pointer to the new View created.
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>
302
<td class="paramtype"> <em>self</em>, </td>
303
<td class="paramname"></td>
305
<td class="memname"></td>
307
<td class="paramtype"><a href="../ktexteditor/KTextEditor.View.html">KTextEditor.View</a> </td>
308
<td class="paramname"><em>view</em></td>
315
<td width="100%"> </td>
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.
329
<div class="menu_box">
330
<div class="nav_list">
332
<li><a href="../allclasses.html">Full Index</a></li>
336
<a name="cp-menu" /><div class="menutitle"><div>
337
<h2 id="cp-menu-project">Modules</h2>
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>
360
<div class="clearer"/>
363
<div id="end_body"></div>
365
<div id="footer"><div id="footer_text">
366
This documentation is maintained by <a href="mailto:simon@simonzone.com">Simon Edwards</a>.<br />
367
KDE<sup>®</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>®</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>