[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Classes | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes

KLFLibBasicWidgetFactory Class Reference

Provides some basic UIs to access resources. More...

#include <klflibview.h>

Inheritance diagram for KLFLibBasicWidgetFactory:
Inheritance graph
[legend]
Collaboration diagram for KLFLibBasicWidgetFactory:
Collaboration graph
[legend]

List of all members.

Classes

struct  LocalFileType
 A known local file type for KLFLibBasicWidgetFactory-created widgets. More...

Public Member Functions

 KLFLibBasicWidgetFactory (QObject *parent=NULL)
virtual ~KLFLibBasicWidgetFactory ()
virtual QStringList supportedTypes () const
virtual QString widgetTypeTitle (const QString &wtype) const
virtual QWidgetcreatePromptUrlWidget (QWidget *parent, const QString &scheme, QUrl defaultlocation=QUrl())
virtual QUrl retrieveUrlFromWidget (const QString &scheme, QWidget *widget)
virtual bool hasCreateWidget (const QString &) const
virtual QWidgetcreatePromptCreateParametersWidget (QWidget *parent, const QString &scheme, const Parameters &defaultparameters=Parameters())
virtual Parameters retrieveCreateParametersFromWidget (const QString &wtype, QWidget *widget)

Static Public Member Functions

static void addLocalFileType (const LocalFileType &fileType)
static QList< LocalFileTypelocalFileTypes ()
static QString guessLocalFileScheme (const QString &fileName)

Static Protected Member Functions

static void addLocalFileSchemeGuesser (KLFLibLocalFileSchemeGuesser *schemeguesser)
static void removeLocalFileSchemeGuesser (KLFLibLocalFileSchemeGuesser *schemeguesser)

Static Protected Attributes

static QList< LocalFileTypepLocalFileTypes
static QList
< KLFLibLocalFileSchemeGuesser * > 
pSchemeGuessers

Detailed Description

Provides some basic UIs to access resources.

Provides the following widget types for opening/creating/saving resources:

Note:
Sub-resources are handled in KLFLibOpenResourceDlg.
Todo:
TODO: remote connections to eg. DB ..........

Definition at line 1132 of file klflibview.h.


Constructor & Destructor Documentation

KLFLibBasicWidgetFactory::KLFLibBasicWidgetFactory ( QObject parent = NULL)

Definition at line 4757 of file klflibview.cpp.

KLFLibBasicWidgetFactory::~KLFLibBasicWidgetFactory ( ) [virtual]

Definition at line 4761 of file klflibview.cpp.


Member Function Documentation

void KLFLibBasicWidgetFactory::addLocalFileSchemeGuesser ( KLFLibLocalFileSchemeGuesser schemeguesser) [static, protected]

This function adds a scheme guesser, ie. a functional sub-class of KLFLibLocalFileSchemeGuesser. The instance is NOT deleted after use. schemeguesser could for example also sub-class QObject and set qApp as parent.

Definition at line 4886 of file klflibview.cpp.

References pSchemeGuessers.

Referenced by KLFLibLocalFileSchemeGuesser::KLFLibLocalFileSchemeGuesser().

void KLFLibBasicWidgetFactory::addLocalFileType ( const LocalFileType fileType) [static]

This function should be called for example in KLFLibEngineFactory subclasses' constructor to inform this widget factory of local file types that are known by the various engine factories. This is then eg. used to provide a useful filter choice in file dialogs.

Definition at line 4861 of file klflibview.cpp.

References pLocalFileTypes.

Referenced by KLFLibDBEngineFactory::KLFLibDBEngineFactory(), and KLFLibLegacyEngineFactory::KLFLibLegacyEngineFactory().

QWidget * KLFLibBasicWidgetFactory::createPromptCreateParametersWidget ( QWidget parent,
const QString scheme,
const Parameters defaultparameters = Parameters() 
) [virtual]

See KLFLibWidgetFactory.

Default parameters that can be given in defaultparameters:

  • "Url" (type QUrl): the URL to start with

Reimplemented from KLFLibWidgetFactory.

Definition at line 4807 of file klflibview.cpp.

References pLocalFileTypes, and KLFLibLocalFileOpenWidget::setUrl().

QWidget * KLFLibBasicWidgetFactory::createPromptUrlWidget ( QWidget parent,
const QString scheme,
QUrl  defaultlocation = QUrl() 
) [virtual]

Implements KLFLibWidgetFactory.

Definition at line 4781 of file klflibview.cpp.

References pLocalFileTypes, and KLFLibLocalFileOpenWidget::setUrl().

QString KLFLibBasicWidgetFactory::guessLocalFileScheme ( const QString fileName) [static]

Queries all the instantiated KLFLibLocalFileSchemeGuesser objects to see if one can recognize the file fileName. The first scheme match found is returned. An empty QString is returned if no guesser succeeded to recognize fileName.

Definition at line 4874 of file klflibview.cpp.

References QString::isEmpty(), pSchemeGuessers, and QList::size().

Referenced by KLFBasicDataOpener::canOpenFile(), KLFMainWin::loadLibrary(), KLFMainWin::openLibFile(), KLFLibLocalFileOpenWidget::selectedScheme(), and KLFLibBrowser::slotOpenAll().

virtual bool KLFLibBasicWidgetFactory::hasCreateWidget ( const QString ) const [inline, virtual]

Reimplemented from KLFLibWidgetFactory.

Definition at line 1154 of file klflibview.h.

QList< KLFLibBasicWidgetFactory::LocalFileType > KLFLibBasicWidgetFactory::localFileTypes ( ) [static]

Definition at line 4867 of file klflibview.cpp.

References pLocalFileTypes.

Referenced by KLFLibBrowser::slotOpenAll().

void KLFLibBasicWidgetFactory::removeLocalFileSchemeGuesser ( KLFLibLocalFileSchemeGuesser schemeguesser) [static, protected]
KLFLibWidgetFactory::Parameters KLFLibBasicWidgetFactory::retrieveCreateParametersFromWidget ( const QString wtype,
QWidget widget 
) [virtual]

The parameters returned by this function depends on the wtype.

Widget-type "LocalFile"

Reimplemented from KLFLibWidgetFactory.

Definition at line 4820 of file klflibview.cpp.

References KLFLibLocalFileCreateWidget::confirmedOverwrite(), QMessageBox::critical(), QFile::exists(), QFile::remove(), KLFLibLocalFileOpenWidget::selectedFName(), KLFLibLocalFileOpenWidget::selectedScheme(), QObject::tr(), and QMessageBox::warning().

QUrl KLFLibBasicWidgetFactory::retrieveUrlFromWidget ( const QString scheme,
QWidget widget 
) [virtual]

Implements KLFLibWidgetFactory.

Definition at line 4792 of file klflibview.cpp.

QStringList KLFLibBasicWidgetFactory::supportedTypes ( ) const [virtual]

Implements KLFLibWidgetFactory.

Definition at line 4766 of file klflibview.cpp.

QString KLFLibBasicWidgetFactory::widgetTypeTitle ( const QString wtype) const [virtual]

Implements KLFLibWidgetFactory.

Definition at line 4772 of file klflibview.cpp.

References QObject::tr().


Member Data Documentation


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

Generated by doxygen 1.7.3