# class ReadOnlyPart

### abstract

Module | kparts
Namespace | KParts
Class | ReadOnlyPart
Inherits | KParts::Part

### methods

- ReadOnlyPart (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QObject | 0

  Constructor See also Part for the setXXX methods to call.

- ReadOnlyPart (dd, parent)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dd | ReadOnlyPartPrivate |
  parent | QObject |

- ReadOnlyPart (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KParts.ReadOnlyPart |

- ReadOnlyPart (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QObject | 0

- abortLoad ( )

  returns Nothing

  Internal

- arguments ( )

  returns KParts.OpenUrlArguments

  Returns the arguments that were used to open this URL.

- browserExtension ( )

  returns KParts.BrowserExtension

  This convenience method returns the browserExtension for this part, or 0 if there isn't any.

- canceled (errMsg)

  returns Nothing
  SIGNAL ("canceled (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  errMsg | QString |

  Emit this if loading is canceled by the user or by an error.

  errMsg - the error message, empty if the user canceled the loading voluntarily.

- closeStream ( )

  returns bool

  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.

- closeUrl ( )

  returns bool

  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

- completed ( )

  returns Nothing
  SIGNAL ("completed ()")

  Emit this when you have completed loading data. Hosting apps will want to know when the process of loading the data is finished, so that they can access the data when everything is loaded.

- completed (pendingAction)

  returns Nothing
  SIGNAL ("completed (bool)")

  Argument | Type | Default
  --- | --- | ---
  pendingAction | bool |

  Same as the above signal except it indicates whether there is a pending action to be executed on a delay timer. An example of this is the meta-refresh tags on web pages used to reload/redirect after a certain period of time. This signal is useful if you want to give the user the ability to cancel such pending actions.

  pendingAction true if a pending action exists, false otherwise.

- guiActivateEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | KParts.GUIActivateEvent |

  Reimplemented from Part, so that the window caption is set to the current url (decoded) when the part is activated This is the usual behavior in 99% of the apps Reimplement if you don't like it - test for event->activated() !

  Technical note : this is done with GUIActivateEvent and not with PartActivateEvent because it's handled by the mainwindow (which gets the even after the PartActivateEvent events have been sent)

- isLocalFileTemporary ( )

  returns bool

  Internal

- isProgressInfoEnabled ( )

  returns bool

  Returns whether the part shows the progress info dialog used by internal KIO job.

- localFilePath ( )

  returns QString

  Returns the local file path associated with this part.

- openFile ( )

  returns bool
  pure virtual

  If the part uses the standard implementation of openUrl(), it must reimplement this, to open the local file. Otherwise simply define it to { return false; }

- openStream (mimeType, url)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  mimeType | QString |
  url | KUrl |

  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.

  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.

- openUrl (url)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  Only reimplement openUrl if you don't want the network transparency support to download from the url into a temporary file (when the url isn't local). Otherwise, reimplement openFile() only .

  If you reimplement it, don't forget to set the caption, usually with emit setWindowCaption( url.prettyUrl() );

- setArguments (arguments)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  arguments | KParts.OpenUrlArguments |

  Sets the arguments to use for the next openUrl call.

- setLocalFilePath (localFilePath)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  localFilePath | QString |

  Sets the local file path associated with this part.

- setLocalFileTemporary (temp)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  temp | bool |

  Internal

- setProgressInfoEnabled (show)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  show | bool |

  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.

- setUrl (url)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  Sets the url associated with this part.

- showProgressInfo (show)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  show | bool |

- started (a0)

  returns Nothing
  SIGNAL ("started (Job*)")

  Argument | Type | Default
  --- | --- | ---
  a0 | KIO.Job |

  The part emits this when starting data. If using a KIO.Job, it sets the job in the signal, so that progress information can be shown. Otherwise, job is 0.

- url ( )

  returns KUrl

  Returns the URL currently opened in this part.

  Returns The current URL.

- writeStream (data)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  data | QByteArray |

  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.