#include <klflibview.h>
Public Member Functions | |
KLFLibViewFactory (const QStringList &viewTypeIdentifiers, QObject *parent=NULL) | |
virtual | ~KLFLibViewFactory () |
virtual QStringList | viewTypeIdentifiers () |
virtual QString | viewTypeTitle (const QString &viewTypeIdent) const =0 |
virtual bool | canCreateLibView (const QString &viewTypeIdent, KLFLibResourceEngine *engine)=0 |
virtual KLFAbstractLibView * | createLibView (const QString &viewTypeIdent, QWidget *parent, KLFLibResourceEngine *resourceEngine)=0 |
Static Public Member Functions | |
static QString | defaultViewTypeIdentifier () |
static KLFLibViewFactory * | findFactoryFor (const QString &viewTypeIdentifier) |
static QStringList | allSupportedViewTypeIdentifiers () |
static QList< KLFLibViewFactory * > | allFactories () |
Definition at line 261 of file klflibview.h.
KLFLibViewFactory::KLFLibViewFactory | ( | const QStringList & | viewTypeIdentifiers, |
QObject * | parent = NULL |
||
) |
Definition at line 213 of file klflibview.cpp.
KLFLibViewFactory::~KLFLibViewFactory | ( | ) | [virtual] |
Definition at line 219 of file klflibview.cpp.
static QList<KLFLibViewFactory*> KLFLibViewFactory::allFactories | ( | ) | [inline, static] |
Returns the full list of installed factories.
Definition at line 303 of file klflibview.h.
QStringList KLFLibViewFactory::allSupportedViewTypeIdentifiers | ( | ) | [static] |
Returns a combined list of all view type identifiers that the installed factories support. ie. returns a list of all view type idents. we're capable of creating.
Definition at line 249 of file klflibview.cpp.
References QList::size(), and viewTypeIdentifiers().
Referenced by KLFLibBrowserViewContainer::KLFLibBrowserViewContainer().
virtual bool KLFLibViewFactory::canCreateLibView | ( | const QString & | viewTypeIdent, |
KLFLibResourceEngine * | engine | ||
) | [pure virtual] |
This function may return false, for example if this widget factory creates a specialized kind of widget that can only work with a given engine.
Implemented in KLFLibDefaultViewFactory.
Referenced by KLFLibBrowserViewContainer::KLFLibBrowserViewContainer(), and KLFLibBrowser::openResource().
virtual KLFAbstractLibView* KLFLibViewFactory::createLibView | ( | const QString & | viewTypeIdent, |
QWidget * | parent, | ||
KLFLibResourceEngine * | resourceEngine | ||
) | [pure virtual] |
Create a library view with the given widget parent
. The view should reflect the contents given by the resource engine resourceEngine
.
Implemented in KLFLibDefaultViewFactory.
Referenced by KLFLibBrowserViewContainer::openView().
QString KLFLibViewFactory::defaultViewTypeIdentifier | ( | ) | [static] |
Returns the default view type identifier. Create this view if you don't have any idea which view you prefer.
This actually returns the first view type identifier of the first registered factory.
Definition at line 225 of file klflibview.cpp.
References QList::size().
Referenced by KLFLibBrowser::openResource().
KLFLibViewFactory * KLFLibViewFactory::findFactoryFor | ( | const QString & | viewTypeIdentifier | ) | [static] |
Returns the factory that can handle the URL scheme urlScheme
, or NULL if no such factory exists (ie. has been registered).
Definition at line 232 of file klflibview.cpp.
References QStringList::contains(), QString::isEmpty(), QList::size(), and viewTypeIdentifiers().
Referenced by KLFLibBrowserViewContainer::KLFLibBrowserViewContainer(), KLFLibBrowser::openResource(), and KLFLibBrowserViewContainer::openView().
virtual QStringList KLFLibViewFactory::viewTypeIdentifiers | ( | ) | [inline, virtual] |
A list of view type identifiers that this factory can create.
Individual view widget types are identified by their "view type identifiers". They are not meant to be human-readable (eg. "LibModel+CategoryTree" or whatever)
Definition at line 272 of file klflibview.h.
Referenced by allSupportedViewTypeIdentifiers(), and findFactoryFor().
virtual QString KLFLibViewFactory::viewTypeTitle | ( | const QString & | viewTypeIdent | ) | const [pure virtual] |
A translated string to be shown to user (in a choice box for ex.) for the given view widget type. (eg. tr("Tree View")
)
Implemented in KLFLibDefaultViewFactory.
Referenced by KLFLibBrowserViewContainer::KLFLibBrowserViewContainer().