#include <part.h>
Inheritance diagram for KParts::ReadWritePart:

Public Slots | |
| virtual void | setModified () |
| virtual bool | save () |
Public Methods | |
| ReadWritePart (QObject *parent=0, const char *name=0) | |
| virtual | ~ReadWritePart () |
| bool | isReadWrite () const |
| virtual void | setReadWrite (bool readwrite=true) |
| bool | isModified () const |
| bool | queryClose () |
| virtual bool | closeURL () |
| bool | closeURL (bool promptToSave) |
| virtual bool | saveAs (const KURL &url) |
| virtual void | setModified (bool modified) |
Protected Methods | |
| virtual bool | saveFile ()=0 |
| virtual bool | saveToURL () |
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).
A read-write part can be set to read-only mode, using setReadWrite().
Part writers : Any part inheriting ReadWritePart should check isReadWrite before allowing any action that modifies the part. The part probably wants to reimplement setReadWrite, disable those actions. Don't forget to call the parent setReadWrite.
Definition at line 498 of file part.h.
|
||||||||||||
|
Constructor See parent constructor for instructions. |
|
|
Destructor Applications using a ReadWritePart should make sure, before destroying it, to call closeURL(). In KMainWindow::queryClose(), for instance, they should allow closing only if the return value of closeURL() was true. This allows to cancel. |
|
|
Call this method instead of the above if you need control if the save prompt is shown. For example, if you call queryClose() from KMainWindow::queryClose(), you would not want to prompt again when closing the url. Equivalent to promptToSave ? closeURL() : ReadOnlyPart::closeURL()
|
|
|
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. If isModified(), queryClose() will be called.
Reimplemented from KParts::ReadOnlyPart. |
|
|
|
|
|
|
|
|
If the document has been modified, ask the user to save changes. This method is meant to be called from KMainWindow::queryClose(). It will also be called from closeURL().
|
|
|
Save the file in the location from which it was opened. You can connect this to the "save" action. Calls saveFile() and saveToURL(), no need to reimplement. |
|
|
Save the file to a new location. Calls save(), no need to reimplement |
|
|
Save to a local file. You need to implement it, to save to |
|
|
Save the file.
Uploads the file, if |
|
|
Call setModified() whenever the contents get modified. This is a slot for convenience, so that you can connect it to a signal, like textChanged(). |
|
|
Sets the modified flag of the part. |
|
|
Changes the behaviour of this part to readonly or readwrite.
Referenced by KParts::GenericFactory< T >::createPartObject(). |
1.2.18