<HTML> <HEAD> <TITLE>class ReadWritePart</TITLE> <META NAME="Generator" CONTENT="KDOC "> </HEAD> <BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff"> <TABLE WIDTH="100%" BORDER="0"> <TR> <TD> <TABLE BORDER="0"> <TR><TD valign="top" align="left" cellspacing="10"> <h1>class ReadWritePart</h1> </TD> <TD valign="top" align="right" colspan="1"> Base class for an "editor" part. <small><A HREF="#longdesc">More...</A></small></TD></TR> </TABLE> <HR> <TABLE BORDER="0"> <TR><TH colspan="2">Contains pure virtuals</TH></TR><TR><TH>Full name</TH><TD><code><A HREF="KParts.html">KParts</A>::ReadWritePart</code></TD></TR> <TR><TH>Definition</TH><TD><code>#include <<A HREF="part_h.html">part.h</A>></code></TD></TR> <TR><TH>Inherits</TH><TD><i><A HREF="KParts__ReadOnlyPart.html">KParts::ReadOnlyPart</A></i> <small>[public ]</small></TD></TR> <TR><TH><A HREF="full-list-KParts__ReadWritePart.html">List of all Methods</A></TH></TR> </TABLE> </TD> <TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR> <TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR> <TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR> <TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR> <TR><TD><small><A HREF="index.html">Index</A></small></TD></TR> </TABLE></TD></TR></TABLE> <h4>Public Methods</h4><ul><LI> <b><A HREF="#ref1">ReadWritePart</A></b> ( <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qobject.html">QObject</A> *parent = 0, const char *name = 0 ) </LI> <LI>virtual <b><A HREF="#ref2">~ReadWritePart</A></b> () </LI> <LI>virtual bool <b><A HREF="#ref3">isReadWrite</A></b> () const </LI> <LI>virtual void <b><A HREF="#ref4">setReadWrite</A></b> ( bool readwrite = true ) </LI> <LI>virtual bool <b><A HREF="#ref5">isModified</A></b> () const </LI> <LI>virtual bool <b><A HREF="#ref6">closeURL</A></b> () </LI> <LI>virtual bool <b><A HREF="#ref7">saveAs</A></b> ( const <A HREF="../kdecore/KURL.html">KURL</A> &url ) </LI> <LI>virtual void <b><A HREF="#ref8">setModified</A></b> ( bool modified ) </LI> </ul><h4>Public Slots</h4><ul><LI>virtual void <b><A HREF="#ref9">setModified</A></b> () </LI> <LI>virtual bool <b><A HREF="#ref10">save</A></b> () </LI> </ul><h4>Protected Methods</h4><ul><LI>virtual bool <b><i><A HREF="#ref11">saveFile</A></i></b> () </LI> <LI>virtual bool <b><A HREF="#ref12">saveToURL</A></b> () </LI> </ul><h4>Protected Slots</h4><ul><LI>void <b><A HREF="#ref13">slotUploadFinished</A></b> ( <A HREF="KIO.html#Job">KIO::Job</A> * job ) </LI> </ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p> Base class for an "editor" part. </p> <p> This class handles network transparency for you. Anything that can open a URL, allow modifications, and save (to the same URL or a different one). </p> <p> A read-write part can be set to read-only mode, using <A HREF="KParts__ReadWritePart.html#setReadWrite">setReadWrite</A>(). </p> <p> Part writers : Any part inheriting ReadWritePart should check <A HREF="KParts__ReadWritePart.html#isReadWrite">isReadWrite</A> before allowing any action that modifies the part. The part probably wants to reimplement <A HREF="KParts__ReadWritePart.html#setReadWrite">setReadWrite</A>, disable those actions. Don't forget to call the parent <A HREF="KParts__ReadWritePart.html#setReadWrite">setReadWrite</A>. </p> <A NAME="ReadWritePart"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>ReadWritePart</strong> ( <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qobject.html">QObject</A> *parent = 0, const char *name = 0 ) <br></td><td align="right"><h3><strong>ReadWritePart</strong></h3></td></tr></table><p></p><p> Constructor See parent constructor for instructions. </p> <A NAME="~ReadWritePart"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>~ReadWritePart</strong> () <br></td><td align="right"><h3><strong>~ReadWritePart</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p> Destructor Applications using a ReadWritePart should make sure, before destroying it, to call <A HREF="KParts__ReadWritePart.html#closeURL">closeURL</A>(). In <A HREF="../kdeui/KMainWindow.html#queryClose">KMainWindow::queryClose</A>(), for instance, they should allow closing only if the return value of <A HREF="KParts__ReadWritePart.html#closeURL">closeURL</A>() was true. This allows to cancel. </p> <A NAME="isReadWrite"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>isReadWrite</strong> () <br></td><td align="right"><h3><strong>isReadWrite</strong></h3></td></tr></table><p> <small>[const virtual]</small></p><p> </p> <p><b>Returns</b>: true if the part is in read-write mode </p> <A NAME="setReadWrite"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td> void <strong>setReadWrite</strong> ( bool readwrite = true ) <br></td><td align="right"><h3><strong>setReadWrite</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p> Changes the behaviour of this part to readonly or readwrite. </p> <p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5"> <TR><TD align="left" valign="top"><i>readwrite</i></TD><TD align="left" valign="top">set to true to enable readwrite mode </TD></TR> </TABLE></P> <A NAME="isModified"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>isModified</strong> () <br></td><td align="right"><h3><strong>isModified</strong></h3></td></tr></table><p> <small>[const virtual]</small></p><p> </p> <p><b>Returns</b>: true if the document has been modified. </p> <A NAME="closeURL"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>closeURL</strong> () <br></td><td align="right"><h3><strong>closeURL</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p> Called when closing the current url (e.g. document), for instance when switching to another url (note that openURL() calls it automatically in this case). If the current URL is not fully loaded yet, aborts loading. Reimplemented from ReadOnlyPart, to handle modified parts (and suggest saving in this case, with yes/no/cancel). </p> <p><b>Returns</b>: false on cancel </p> <p>Reimplemented from <A HREF="KParts__ReadOnlyPart.html#closeURL">ReadOnlyPart</A>.</p> <A NAME="saveAs"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>saveAs</strong> ( const <A HREF="../kdecore/KURL.html">KURL</A> &url ) <br></td><td align="right"><h3><strong>saveAs</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p> Save the file to a new location. </p> <p> Calls <A HREF="KParts__ReadWritePart.html#save">save</A>(), no need to reimplement </p> <A NAME="setModified"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td> void <strong>setModified</strong> ( bool modified ) <br></td><td align="right"><h3><strong>setModified</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p> Sets the modified flag of the part. </p> <A NAME="setModified"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td> void <strong>setModified</strong> () <br></td><td align="right"><h3><strong>setModified</strong></h3></td></tr></table><p> <small>[virtual slot]</small></p><p> Call <A HREF="KParts__ReadWritePart.html#setModified">setModified</A>() whenever the contents get modified. This is a slot for convenience, so that you can connect it to a signal, like textChanged(). </p> <A NAME="save"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>save</strong> () <br></td><td align="right"><h3><strong>save</strong></h3></td></tr></table><p> <small>[virtual slot]</small></p><p> Save the file in the location from which it was opened. You can connect this to the "save" action. Calls <A HREF="KParts__ReadWritePart.html#saveFile">saveFile</A>() and <A HREF="KParts__ReadWritePart.html#saveToURL">saveToURL</A>(), no need to reimplement. </p> <A NAME="saveFile"></A><A NAME="ref11"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <i><strong>saveFile</strong></i> () <br></td><td align="right"><h3><i><strong>saveFile</strong></i></h3></td></tr></table><p> <small>[protected pure virtual]</small></p><p> Save to a local file. You need to implement it, to save to <code>m_file</code>. The framework takes care of re-uploading afterwards. </p> <A NAME="saveToURL"></A><A NAME="ref12"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>saveToURL</strong> () <br></td><td align="right"><h3><strong>saveToURL</strong></h3></td></tr></table><p> <small>[protected virtual]</small></p><p> Save the file. </p> <p> Uploads the file, if <code>m_url</code> is remote. This will emit started(), and either completed() or canceled(), in case you want to provide feedback. </p> <A NAME="slotUploadFinished"></A><A NAME="ref13"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>slotUploadFinished</strong> ( <A HREF="KIO.html#Job">KIO::Job</A> * job ) <br></td><td align="right"><h3><strong>slotUploadFinished</strong></h3></td></tr></table><p> <small>[protected slots slot]</small></p><p> </p> <HR> <table> <tr><td><small>Generated by: qateam on updates.mandrakesoft.com on Mon Dec 30 16:09:25 2002, using kdoc 2.0a53.</small></td></tr> </table> </BODY> </HTML>