• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeparts
 

tdeparts

  • KParts
  • ReadOnlyPart
Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Friends | List of all members
KParts::ReadOnlyPart Class Referenceabstract

#include <part.h>

Inheritance diagram for KParts::ReadOnlyPart:
KParts::Part KParts::PartBase KXMLGUIClient KParts::ReadWritePart

Public Slots

virtual bool openURL (const KURL &url)
 

Signals

void started (TDEIO::Job *)
 
void completed ()
 
void completed (bool pendingAction)
 
void canceled (const TQString &errMsg)
 
- Signals inherited from KParts::Part
void setWindowCaption (const TQString &caption)
 
void setStatusBarText (const TQString &text)
 

Public Member Functions

 ReadOnlyPart (TQObject *parent=0, const char *name=0)
 
virtual ~ReadOnlyPart ()
 
void setProgressInfoEnabled (bool show)
 
bool isProgressInfoEnabled () const
 
void showProgressInfo (bool show)
 
KURL url () const
 
virtual bool closeURL ()
 
bool openStream (const TQString &mimeType, const KURL &url)
 
bool writeStream (const TQByteArray &data)
 
bool closeStream ()
 
- Public Member Functions inherited from KParts::Part
 Part (TQObject *parent=0, const char *name=0)
 
virtual ~Part ()
 
virtual void embed (TQWidget *parentWidget)
 
virtual TQWidget * widget ()
 
virtual void setManager (PartManager *manager)
 
PartManager * manager () const
 
virtual Part * hitTest (TQWidget *widget, const TQPoint &globalPos)
 
virtual void setSelectable (bool selectable)
 
bool isSelectable () const
 
- Public Member Functions inherited from KParts::PartBase
 PartBase ()
 
virtual ~PartBase ()
 
void setPartObject (TQObject *object)
 
TQObject * partObject () const
 
- Public Member Functions inherited from KXMLGUIClient
 KXMLGUIClient (KXMLGUIClient *parent)
 
TDEAction * action (const char *name) const
 
virtual TDEAction * action (const TQDomElement &element) const
 
virtual TDEActionCollection * actionCollection () const
 
virtual TDEInstance * instance () const
 
virtual TQDomDocument domDocument () const
 
virtual TQString xmlFile () const
 
void setXMLGUIBuildDocument (const TQDomDocument &doc)
 
TQDomDocument xmlguiBuildDocument () const
 
void setFactory (KXMLGUIFactory *factory)
 
KXMLGUIFactory * factory () const
 
KXMLGUIClient * parentClient () const
 
void insertChildClient (KXMLGUIClient *child)
 
void removeChildClient (KXMLGUIClient *child)
 
const TQPtrList< KXMLGUIClient > * childClients ()
 
void setClientBuilder (KXMLGUIBuilder *builder)
 
KXMLGUIBuilder * clientBuilder () const
 
void reloadXML ()
 
void plugActionList (const TQString &name, const TQPtrList< TDEAction > &actionList)
 
void unplugActionList (const TQString &name)
 
void beginXMLPlug (TQWidget *)
 
void endXMLPlug ()
 
void prepareXMLUnplug (TQWidget *)
 

Protected Slots

void slotJobFinished (TDEIO::Job *job)
 

Protected Member Functions

virtual bool openFile ()=0
 
void abortLoad ()
 
virtual void guiActivateEvent (GUIActivateEvent *event)
 
- Protected Member Functions inherited from KParts::Part
virtual void setWidget (TQWidget *widget)
 
virtual void customEvent (TQCustomEvent *event)
 
virtual void partActivateEvent (PartActivateEvent *event)
 
virtual void partSelectEvent (PartSelectEvent *event)
 
virtual void guiActivateEvent (GUIActivateEvent *event)
 
TQWidget * hostContainer (const TQString &containerName)
 
- Protected Member Functions inherited from KParts::PartBase
virtual void setInstance (TDEInstance *instance)
 
virtual void setInstance (TDEInstance *instance, bool loadPlugins)
 
void loadPlugins (TQObject *parent, KXMLGUIClient *parentGUIClient, TDEInstance *instance)
 
void setPluginLoadingMode (PluginLoadingMode loadingMode)
 
- Protected Member Functions inherited from KXMLGUIClient
virtual void setInstance (TDEInstance *instance)
 
virtual void setXMLFile (const TQString &file, bool merge=false, bool setXMLDoc=true)
 
virtual void setXML (const TQString &document, bool merge=false)
 
virtual void setDOMDocument (const TQDomDocument &document, bool merge=false)
 
virtual void conserveMemory ()
 
virtual void stateChanged (const TQString &newstate, ReverseStateChange reverse=StateNoReverse)
 

Protected Attributes

KURL m_url
 
TQString m_file
 
bool m_bTemp
 

Friends

class ReadWritePart
 

Additional Inherited Members

- Protected Types inherited from KParts::PartBase
enum  PluginLoadingMode { DoNotLoadPlugins = 0 , LoadPlugins = 1 , LoadPluginsIfEnabled = 2 }
 

Detailed Description

Base class for any "viewer" part.

This class takes care of network transparency for you, in the simplest way (downloading to a temporary file, then letting the part load from the temporary file). To use the built-in network transparency, you only need to implement openFile(), not openURL().

To implement network transparency differently (e.g. for progressive loading, like a web browser does for instance), or to prevent network transparency (but why would you do that?), you can 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()

Definition at line 338 of file part.h.

Constructor & Destructor Documentation

◆ ReadOnlyPart()

ReadOnlyPart::ReadOnlyPart ( TQObject *  parent = 0,
const char *  name = 0 
)

Constructor See also Part for the setXXX methods to call.

Definition at line 304 of file part.cpp.

◆ ~ReadOnlyPart()

ReadOnlyPart::~ReadOnlyPart ( )
virtual

Destructor.

Definition at line 310 of file part.cpp.

Member Function Documentation

◆ abortLoad()

void ReadOnlyPart::abortLoad ( )
protected

Definition at line 375 of file part.cpp.

◆ canceled

void KParts::ReadOnlyPart::canceled ( const TQString &  errMsg)
signal

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

Parameters
errMsgthe error message, empty if the user canceled the loading voluntarily.

◆ closeStream()

bool ReadOnlyPart::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.

Definition at line 440 of file part.cpp.

◆ closeURL()

bool ReadOnlyPart::closeURL ( )
virtual

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

Reimplemented in KParts::ReadWritePart.

Definition at line 385 of file part.cpp.

◆ completed [1/2]

void KParts::ReadOnlyPart::completed ( )
signal

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 [2/2]

void KParts::ReadOnlyPart::completed ( bool  pendingAction)
signal

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.

Parameters
pendingActiontrue if a pending action exists, false otherwise.

◆ guiActivateEvent()

void ReadOnlyPart::guiActivateEvent ( GUIActivateEvent *  event)
protectedvirtual

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)

Reimplemented from KParts::Part.

Definition at line 415 of file part.cpp.

◆ isProgressInfoEnabled()

bool ReadOnlyPart::isProgressInfoEnabled ( ) const

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

Definition at line 321 of file part.cpp.

◆ openFile()

virtual bool KParts::ReadOnlyPart::openFile ( )
protectedpure virtual

If the part uses the standard implementation of openURL(), it must reimplement this, to open m_file.

Otherwise simply define it to { return false; }

◆ openStream()

bool ReadOnlyPart::openStream ( const TQString &  mimeType,
const 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
mimeTypethe type of data that is going to be sent to this part.
urlthe 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.

Definition at line 427 of file part.cpp.

◆ openURL

bool ReadOnlyPart::openURL ( const KURL &  url)
virtualslot

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() );

Definition at line 333 of file part.cpp.

◆ setProgressInfoEnabled()

void ReadOnlyPart::setProgressInfoEnabled ( bool  show)

Call this to turn off the progress info dialog used by the internal TDEIO 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.

Definition at line 316 of file part.cpp.

◆ showProgressInfo()

void ReadOnlyPart::showProgressInfo ( bool  show)

Definition at line 327 of file part.cpp.

◆ slotJobFinished

void ReadOnlyPart::slotJobFinished ( TDEIO::Job *  job)
protectedslot

Definition at line 400 of file part.cpp.

◆ started

void KParts::ReadOnlyPart::started ( TDEIO::Job *  )
signal

The part emits this when starting data.

If using a TDEIO::Job, it sets the job in the signal, so that progress information can be shown. Otherwise, job is 0.

◆ url()

KURL KParts::ReadOnlyPart::url ( ) const
inline

Returns the currently in part used URL.

Returns
The current used URL.

Definition at line 390 of file part.h.

◆ writeStream()

bool ReadOnlyPart::writeStream ( const TQByteArray &  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.

Definition at line 435 of file part.cpp.

Friends And Related Function Documentation

◆ ReadWritePart

friend class ReadWritePart
friend

Definition at line 341 of file part.h.

Member Data Documentation

◆ m_bTemp

bool KParts::ReadOnlyPart::m_bTemp
protected

If true, m_file is a temporary file that needs to be deleted later.

Definition at line 523 of file part.h.

◆ m_file

TQString KParts::ReadOnlyPart::m_file
protected

Local file - the only one the part implementation should deal with.

Definition at line 519 of file part.h.

◆ m_url

KURL KParts::ReadOnlyPart::m_url
protected

Remote (or local) url - the one displayed to the user.

Definition at line 515 of file part.h.


The documentation for this class was generated from the following files:
  • part.h
  • part.cpp

tdeparts

Skip menu "tdeparts"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeparts

Skip menu "tdeparts"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeparts by doxygen 1.9.4
This website is maintained by Timothy Pearson.