libs/main

KoDocumentEntry Class Reference

Represents an available KOffice component that supports the document interface. More...

#include <KoDocumentEntry.h>

List of all members.

Public Types

enum  QueryFlag { AllEntries = 0, OnlyEmbeddableDocuments = 1 }

Public Member Functions

 KoDocumentEntry (const KService::Ptr &service)
 KoDocumentEntry ()
 ~KoDocumentEntry ()
KoDocumentcreateDoc (QString *errorMsg=0, KoDocument *parent=0) const
bool isEmpty () const
QStringList mimeTypes () const
QString name () const
KService::Ptr service () const
bool supportsMimeType (const QString &_mimetype) const

Static Public Member Functions

static QList< KoDocumentEntryquery (QueryFlags flags, const QString &_constr=QString())
static KoDocumentEntry queryByMimeType (const QString &mimetype)

Detailed Description

Represents an available KOffice component that supports the document interface.

Definition at line 37 of file KoDocumentEntry.h.


Member Enumeration Documentation

Enumerator:
AllEntries 
OnlyEmbeddableDocuments 

OnlyEmbeddableDocuments specifies if only KOffice Parts should be listed which are embeddable into other koDocuments, or all (if false) (eg.

: it makes no sense to embed Kexi into KWord, but it makes sense to embed it into KoShell)

Definition at line 89 of file KoDocumentEntry.h.


Constructor & Destructor Documentation

KoDocumentEntry::KoDocumentEntry (  )  [explicit]

Represents an invalid entry (as returned by queryByMimeType for instance).

Port from KOffice Trader to KTrader/KActivator (kded) by Simon Hausmann (c) 1999 Simon Hausmann <hausmann@kde.org> Port to KService and simplifications by David Faure <faure@kde.org>.

Definition at line 41 of file KoDocumentEntry.cpp.

KoDocumentEntry::KoDocumentEntry ( const KService::Ptr &  service  )  [explicit]

Represents a valid entry.

Definition at line 46 of file KoDocumentEntry.cpp.

KoDocumentEntry::~KoDocumentEntry (  ) 

Definition at line 51 of file KoDocumentEntry.cpp.


Member Function Documentation

KoDocument * KoDocumentEntry::createDoc ( QString errorMsg = 0,
KoDocument parent = 0 
) const

Uses the factory of the component to create a document.

If that is not possible, 0 is returned.

Definition at line 55 of file KoDocumentEntry.cpp.

bool KoDocumentEntry::isEmpty (  )  const [inline]
Returns:
TRUE if the service pointer is null

Definition at line 58 of file KoDocumentEntry.h.

QStringList KoDocumentEntry::mimeTypes (  )  const [inline]

Mimetypes (and other service types) which this document can handle.

Definition at line 72 of file KoDocumentEntry.h.

QString KoDocumentEntry::name (  )  const [inline]
Returns:
name of the associated service

Definition at line 65 of file KoDocumentEntry.h.

QList< KoDocumentEntry > KoDocumentEntry::query ( QueryFlags  flags,
const QString _constr = QString() 
) [static]

This function will query ksycoca to find all available components.

The result will only contain parts, which are embeddable into a document

Parameters:
_constr is a constraint expression as used by KTrader. You can use it to set additional restrictions on the available components.

Definition at line 114 of file KoDocumentEntry.cpp.

KoDocumentEntry KoDocumentEntry::queryByMimeType ( const QString mimetype  )  [static]

This is a convenience function.

Returns:
a document entry for the KOffice component that supports the requested mimetype and fits the user best.

Definition at line 87 of file KoDocumentEntry.cpp.

KService::Ptr KoDocumentEntry::service (  )  const [inline]

Definition at line 51 of file KoDocumentEntry.h.

bool KoDocumentEntry::supportsMimeType ( const QString _mimetype  )  const [inline]
Returns:
TRUE if the document can handle the requested mimetype.

Definition at line 79 of file KoDocumentEntry.h.


The documentation for this class was generated from the following files: