org.kde.koala
Class ReadOnlyPart
public
class
ReadOnlyPart
extends Part
Base class for any "viewer" part.
This class takes care of network transparency for you,
in the simplest way (synchronously).
To use the built-in network transparency, you only need to implement
openFile(), not openURL().
To prevent network transparency, or to implement it another way
(e.g. asynchronously), override openURL().
KParts Application can use the signals to show feedback while the URL is being loaded.
ReadOnlyPart handles the window caption by setting it to the current URL
(set in openURL(), and each time the part is activated).
If you want another caption, set it in openFile() and
(if the part might ever be used with a part manager) in guiActivateEvent()
See
ReadOnlyPartSignals for signals emitted by ReadOnlyPart
UNKNOWN: Base class for any "viewer" part.
Method Summary |
String | className() |
boolean | closeStream()
Terminate the sending of data to the part.
|
boolean | 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).
|
boolean | isProgressInfoEnabled()
Returns whether the part shows the progress info dialog used by internal
KIO job. |
QMetaObject | metaObject() |
boolean | openStream(String mimeType, KURL url)
Initiate sending data to this part.
|
boolean | openURL(KURL url)
Only reimplement openURL if you don't want synchronous network transparency
Otherwise, reimplement openFile() only .
|
void | setProgressInfoEnabled(boolean show)
Call this to turn off the progress info dialog used by
the internal KIO job. |
void | showProgressInfo(boolean show) |
KURL | url()
Returns the currently in part used URL. |
boolean | writeStream(byte[] data)
Send some data to the part. openStream must have been called previously,
and must have returned true. |
protected ReadOnlyPart(Class dummy)
public String className()
public boolean closeStream()
Terminate the sending of data to the part.
With some data types (text, html...) closeStream might never actually be called,
in the case of continuous streams, for instance plain text or HTML data.
UNKNOWN: Terminate the sending of data to the part.
public boolean 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.
Deletes the temporary file used when the url is remote.
Returns: always true, but the return value exists for reimplementations
UNKNOWN: Called when closing the current url (e.
public boolean isProgressInfoEnabled()
Returns whether the part shows the progress info dialog used by internal
KIO job.
UNKNOWN: Returns whether the part shows the progress info dialog used by internal KIO job.
public QMetaObject metaObject()
public boolean openStream(String mimeType,
KURL url)
Initiate sending data to this part.
This is an alternative to openURL, which allows the user of the part
to load the data itself, and send it progressively to the part.
Parameters: mimeType the type of data that is going to be sent to this part. url the URL representing this data. Although not directly used,
every ReadOnlyPart has a URL (see url()), so this simply sets it.
Returns: true if the part supports progressive loading and accepts data, false otherwise.
UNKNOWN: Initiate sending data to this part.
public boolean openURL(
KURL url)
Only reimplement openURL if you don't want synchronous network transparency
Otherwise, reimplement openFile() only .
If you reimplement it, don't forget to set the caption, usually with
emit setWindowCaption( url.prettyURL() );
UNKNOWN: Only reimplement openURL if you don't want synchronous network transparency Otherwise, reimplement openFile() only .
public void setProgressInfoEnabled(boolean show)
Call this to turn off the progress info dialog used by
the internal KIO job. Use this if you provide another way
of displaying progress info (e.g. a statusbar), using the
signals emitted by this class, and/or those emitted by
the Job given by started.
UNKNOWN: Call this to turn off the progress info dialog used by the internal KIO job.
public void showProgressInfo(boolean show)
Returns the currently in part used URL.
Returns: The current used URL.
UNKNOWN: Returns the currently in part used URL.
public boolean writeStream(byte[] data)
Send some data to the part. openStream must have been called previously,
and must have returned true.
Returns: true if the data was accepted by the part. If false is returned,
the application should stop sending data, and doesn't have to call closeStream.
UNKNOWN: Send some data to the part.