[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Public Slots | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | List of all members
KLFLibLegacyEngine Class Reference

The Legacy Library support for the KLFLib framework. More...

#include <klfliblegacyengine.h>

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

Public Slots

virtual bool createSubResource (const QString &subResource, const QString &subResourceTitle)
 
virtual bool renameSubResource (const QString &subResource, const QString &subResourceName)
 
virtual bool deleteSubResource (const QString &subResource)
 
virtual bool save ()
 
virtual void setAutoSaveInterval (int intervalms)
 
virtual QList< entryIdinsertEntries (const QString &subResource, const KLFLibEntryList &entries)
 
virtual bool changeEntries (const QString &subResource, const QList< entryId > &idlist, const QList< int > &properties, const QList< QVariant > &values)
 
virtual bool deleteEntries (const QString &subResource, const QList< entryId > &idlist)
 
virtual bool saveTo (const QUrl &newPath)
 
- Public Slots inherited from KLFLibResourceEngine
virtual bool setTitle (const QString &title)
 set a new resource title for this library resource More...
 
virtual bool setLocked (bool locked)
 Set the resource to be locked. More...
 
virtual bool setViewType (const QString &viewType)
 
virtual bool setReadOnly (bool readonly)
 Set the resource to be read-only or not. More...
 
virtual void setDefaultSubResource (const QString &subResource)
 Set the default sub-resource. More...
 
virtual bool createSubResource (const QString &subResource, const QString &subResourceTitle)
 Create a new sub-resource. More...
 
virtual bool createSubResource (const QString &subResource)
 Create a new sub-resource. More...
 
virtual bool renameSubResource (const QString &oldSubResourceName, const QString &newSubResourceName)
 
virtual bool deleteSubResource (const QString &subResource)
 
virtual bool setSubResourceProperty (const QString &subResource, int propId, const QVariant &value)
 
virtual entryId insertEntry (const QString &subResource, const KLFLibEntry &entry)
 Insert an entry into this resource. More...
 
virtual entryId insertEntry (const KLFLibEntry &entry)
 Insert an entry into this resource. More...
 
virtual QList< entryIdinsertEntries (const QString &subResource, const KLFLibEntryList &entrylist)=0
 Insert new entries in this resource. More...
 
virtual QList< entryIdinsertEntries (const KLFLibEntryList &entrylist)
 Insert new entries in this resource. More...
 
virtual bool changeEntries (const QString &subResource, const QList< entryId > &idlist, const QList< int > &properties, const QList< QVariant > &values)=0
 Change some entries in this resource. More...
 
virtual bool changeEntries (const QList< entryId > &idlist, const QList< int > &properties, const QList< QVariant > &values)
 Change some entries in this resource. More...
 
virtual bool deleteEntries (const QString &subResource, const QList< entryId > &idlist)=0
 Delete some entries in this resource. More...
 
virtual bool deleteEntries (const QList< entryId > &idList)
 Delete some entries in this resource. More...
 
virtual bool saveTo (const QUrl &newPath)
 
virtual bool setResourceProperty (int propId, const QVariant &value)
 Set a resource property to the given value. More...
 
virtual bool loadResourceProperty (const QString &propName, const QVariant &value)
 Set the given property to the given value. More...
 

Public Member Functions

virtual ~KLFLibLegacyEngine ()
 
virtual uint compareUrlTo (const QUrl &other, uint interestFlags=0xfffffff) const
 
virtual bool canModifyData (const QString &subRes, ModifyType modifytype) const
 
virtual bool canModifyProp (int propid) const
 
virtual bool canRegisterProperty (const QString &propName) const
 
virtual KLFLibEntry entry (const QString &resource, entryId id)
 
virtual QList< KLFLibEntryWithIdallEntries (const QString &resource, const QList< int > &wantedEntryProperties=QList< int >())
 
virtual QStringList subResourceList () const
 
virtual bool canCreateSubResource () const
 
virtual bool canRenameSubResource (const QString &subResource) const
 
virtual bool canDeleteSubResource (const QString &subResource) const
 
- Public Member Functions inherited from KLFLibResourceSimpleEngine
 KLFLibResourceSimpleEngine (const QUrl &url, uint supportedfeatureflags, QObject *parent=NULL)
 
virtual ~KLFLibResourceSimpleEngine ()
 
virtual QList< KLFLib::entryIdallIds (const QString &subResource)
 
virtual bool hasEntry (const QString &, entryId id)
 
virtual QList< KLFLibEntryWithIdentries (const QString &, const QList< KLFLib::entryId > &idList, const QList< int > &wantedEntryProperties=QList< int >())
 
virtual int query (const QString &subResource, const Query &query, QueryResult *result)
 
virtual QList< QVariantqueryValues (const QString &subResource, int entryPropId)
 
- Public Member Functions inherited from KLFLibResourceEngine
 KLFLibResourceEngine (const QUrl &url, uint supportedfeatureflags, QObject *parent=NULL)
 
virtual ~KLFLibResourceEngine ()
 
virtual uint supportedFeatureFlags () const
 List of features supported by this resource engine. More...
 
virtual QUrl url (uint flags=0x0) const
 query URL More...
 
virtual bool isReadOnly () const
 query read-only state More...
 
virtual QString title () const
 The human-set title of this resource. More...
 
virtual bool locked () const
 Is this resource is locked? More...
 
virtual QString viewType () const
 The (last) View Type used to display this resource. More...
 
virtual bool accessShared () const
 If the resource is accessed by many clients. More...
 
virtual QVariant resourceProperty (const QString &name) const
 Get the value of a resource property. More...
 
virtual bool canModifyData (ModifyType modifytype) const
 
virtual QString suggestedViewTypeIdentifier () const
 
virtual bool hasSubResource (const QString &subResource) const
 
virtual QString defaultSubResource () const
 
virtual bool compareDefaultSubResourceEquals (const QString &subResourceName) const
 Compare our sub-resource name to another. More...
 
virtual QVariant subResourceProperty (const QString &subResource, int propId) const
 
virtual QList< int > subResourcePropertyIdList () const
 
virtual QString subResourcePropertyName (int propId) const
 
virtual bool canModifySubResourceProperty (const QString &subResource, int propId) const
 
virtual KLFLibEntry entry (entryId id)
 query an entry in this resource More...
 
virtual bool hasEntry (entryId id)
 query the existence of an entry in this resource More...
 
virtual QList< KLFLibEntryWithIdentries (const QList< KLFLib::entryId > &idList, const QList< int > &wantedEntryProperties=QList< int >())
 query multiple entries in this resource More...
 
virtual QList< KLFLib::entryIdallIds ()
 Returns all IDs in this resource (and the default sub-resource) More...
 
virtual QList< KLFLibEntryWithIdallEntries (const QList< int > &wantedEntryProperties=QList< int >())
 query all entries in this resource More...
 
void blockProgressReportingForNextOperation ()
 Specifies that the next operation (only) should not report progress. More...
 
void blockProgressReporting (bool block)
 (Un)Blocks generally progress reporting More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent=0)
 
 blockSignals (bool block)
 
 childEvent (QChildEvent *event)
 
 children ()
 
 connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection)
 
 connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection)
 
 connectNotify (const char *signal)
 
 customEvent (QEvent *event)
 
 deleteLater ()
 
 destroyed (QObject *obj=0)
 
 disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
 disconnect (const char *signal=0, const QObject *receiver=0, const char *method=0)
 
 disconnect (const QObject *receiver, const char *method=0)
 
 disconnectNotify (const char *signal)
 
 dumpObjectInfo ()
 
 dumpObjectTree ()
 
 dynamicPropertyNames ()
 
 event (QEvent *e)
 
 eventFilter (QObject *watched, QEvent *event)
 
 findChild (const QString &name=QString()
 
 findChildren (const QString &name=QString()
 
 findChildren (const QRegExp &regExp)
 
 inherits (const char *className)
 
 installEventFilter (QObject *filterObj)
 
 isWidgetType ()
 
 killTimer (int id)
 
 metaObject ()
 
 moveToThread (QThread *targetThread)
 
 parent ()
 
 property (const char *name)
 
 receivers (const char *signal)
 
 removeEventFilter (QObject *obj)
 
 sender ()
 
 setParent (QObject *parent)
 
 setProperty (const char *name, const QVariant &value)
 
 signalsBlocked ()
 
 startTimer (int interval)
 
 thread ()
 
 timerEvent (QTimerEvent *event)
 
 tr (const char *sourceText, const char *comment=0, int n=-1)
 
 trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
 staticMetaObject
 
 QObject (QObject *parent, const char *name)
 
 checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
 child (const char *objName, const char *inheritsClass=0, bool recursiveSearch=true)
 
 className ()
 
 insertChild (QObject *object)
 
 isA (const char *className)
 
 name ()
 
 name (const char *defaultName)
 
 normalizeSignalSlot (const char *signalSlot)
 
 removeChild (QObject *object)
 
 setName (const char *name)
 
- Public Member Functions inherited from KLFPropertizedObject
 KLFPropertizedObject (const QString &propertyNameSpace)
 
virtual ~KLFPropertizedObject ()
 
virtual QVariant property (const QString &propName) const
 
virtual QVariant property (int propId) const
 
QList< int > propertyIdList () const
 
QStringList propertyNameList () const
 
QMap< QString, QVariantallProperties () const
 
void setAllProperties (const QMap< QString, QVariant > &propValues)
 
QByteArray allPropertiesToByteArray () const
 
void setAllPropertiesFromByteArray (const QByteArray &data)
 
virtual QString toString (uint toStringFlags=0) const
 
int propertyMaxId () const
 
bool propertyIdRegistered (int propId) const
 
bool propertyNameRegistered (const QString &propertyName) const
 
int propertyIdForName (const QString &propertyName) const
 
QString propertyNameForId (int propId) const
 
QList< int > registeredPropertyIdList () const
 
QStringList registeredPropertyNameList () const
 
QMap< QString, int > registeredProperties () const
 

Static Public Member Functions

static KLFLibLegacyEngineopenUrl (const QUrl &url, QObject *parent=NULL)
 
static KLFLibLegacyEnginecreateDotKLF (const QString &fileName, QString legacyResourceName, QObject *parent=NULL)
 
- Static Public Member Functions inherited from KLFLibResourceSimpleEngine
static int queryImpl (KLFLibResourceEngine *resource, const QString &subResource, const Query &query, QueryResult *result)
 
static QList< QVariantqueryValuesImpl (KLFLibResourceEngine *resource, const QString &subResource, int entryPropId)
 
static bool testEntryMatchConditionImpl (const KLFLib::EntryMatchCondition &condition, const KLFLibEntry &libentry)
 

Protected Slots

void updateResourceProperty (int propId)
 

Protected Member Functions

virtual bool saveResourceProperty (int propId, const QVariant &value)
 
- Protected Member Functions inherited from KLFLibResourceEngine
virtual ModifyStatus baseCanModifyStatus (bool inSubResource, const QString &subResource=QString()) const
 can modify data in resource (base common tests only) More...
 
bool thisOperationProgressBlocked () const
 
- Protected Member Functions inherited from KLFPropertizedObject
virtual void propertyValueChanged (int propId, const QVariant &oldValue, const QVariant &newValue)
 
virtual void setProperty (const QString &propname, const QVariant &value)
 
virtual void setProperty (int propId, const QVariant &value)
 
virtual int loadProperty (const QString &propname, const QVariant &value)
 
void registerBuiltInProperty (int propId, const QString &propName) const
 
int registerProperty (const QString &propertyName) const
 
QString propertyNameSpace () const
 
QVector< QVariantpropertyVector () const
 

Additional Inherited Members

- Public Types inherited from KLFLibResourceEngine
enum  ResourceProperty { PropTitle = 0, PropLocked, PropViewType, PropAccessShared }
 
enum  SubResourceProperty { SubResPropTitle = 0, SubResPropLocked = 1, SubResPropViewType = 2 }
 
enum  ResourceFeature {
  FeatureReadOnly = 0x0001, FeatureLocked = 0x0002, FeatureSaveTo = 0x0004, FeatureSubResources = 0x0008,
  FeatureSubResourceProps = 0x0010
}
 Features that may or may not be implemented by subclasses. More...
 
enum  WantUrlFormatFlag { WantUrlDefaultSubResource = 0x01, WantUrlReadOnly = 0x02 }
 Format options one can give to url() More...
 
enum  ModifyType {
  AllActionsData = 0, UnknownModification = 0, InsertData, ChangeData,
  DeleteData
}
 
typedef KLFLib::entryId entryId
 
- Public Types inherited from KLFPropertizedObject
enum  ToStringFlag
 
- Signals inherited from KLFLibResourceEngine
void dataChanged (const QString &subResource, int modificationType, const QList< KLFLib::entryId > &entryIdList)
 Emitted when data has changed. More...
 
void defaultSubResourceChanged (const QString &newDefaultSubResource)
 Emitted when the default sub-resource changes. More...
 
void resourcePropertyChanged (int propId)
 Emitted when a resource property changes. More...
 
void subResourcePropertyChanged (const QString &subResource, int propId)
 Emitted when a sub-resource property changes. More...
 
void subResourceCreated (const QString &newSubResource)
 Emitted when a sub-resource is created. More...
 
void subResourceRenamed (const QString &oldSubResourceName, const QString &newSubResourceName)
 Emitted when a sub-resource is renamed. More...
 
void subResourceDeleted (const QString &subResource)
 Emitted when a sub-resource is deleted. More...
 
void operationStartReportingProgress (KLFProgressReporter *progressReporter, const QString &descriptiveText)
 
- Public Attributes inherited from KLFPropertizedObject
 ToStringUseHtml
 
 ToStringUseHtmlDiv
 
 ToStringQuoteValues
 
 ToStringAllProperties
 
- Protected Types inherited from KLFLibResourceEngine
enum  ModifyStatus { MS_CanModify = 0, MS_IsLocked = 1, MS_SubResLocked = 2, MS_NotModifiable = 3 }
 
- Static Protected Member Functions inherited from KLFPropertizedObject
static void registerBuiltInProperty (const QString &propNameSpace, int propId, const QString &name)
 
static int registerProperty (const QString &propNameSpace, const QString &propertyName)
 
static int propertyMaxId (const QString &propNameSpace)
 
static bool propertyIdRegistered (const QString &propNameSpace, int propId)
 
static bool propertyNameRegistered (const QString &propNameSpace, const QString &propertyName)
 
static int propertyIdForName (const QString &propNameSpace, const QString &propertyName)
 
static QString propertyNameForId (const QString &propNameSpace, int propId)
 
static QList< int > registeredPropertyIdList (const QString &propNameSpace)
 
static QStringList registeredPropertyNameList (const QString &propNameSpace)
 
static QMap< QString, int > registeredProperties (const QString &propNameSpace)
 

Detailed Description

The Legacy Library support for the KLFLib framework.

Implements a KLFLibResourceEngine resource engine for accessing (KLF<=3.1)-created libraries (*.klf, default library files)

Different legacy resources (in the *.klf file) are mapped to sub-resources (in KLFLibResourceEngine).

Definition at line 135 of file klfliblegacyengine.h.

Constructor & Destructor Documentation

KLFLibLegacyEngine::~KLFLibLegacyEngine ( )
virtual

Definition at line 493 of file klfliblegacyengine.cpp.

References KLF_ASSERT_NOT_NULL, KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and klfDbg.

Member Function Documentation

QList< KLFLibResourceEngine::KLFLibEntryWithId > KLFLibLegacyEngine::allEntries ( const QString resource,
const QList< int > &  wantedEntryProperties = QList<int>() 
)
virtual
bool KLFLibLegacyEngine::canCreateSubResource ( ) const
virtual

Reimplemented from KLFLibResourceEngine.

Definition at line 607 of file klfliblegacyengine.cpp.

bool KLFLibLegacyEngine::canDeleteSubResource ( const QString subResource) const
virtual

Reimplemented from KLFLibResourceEngine.

Definition at line 616 of file klfliblegacyengine.cpp.

References QString::length().

bool KLFLibLegacyEngine::canModifyData ( const QString subRes,
ModifyType  modifytype 
) const
virtual
bool KLFLibLegacyEngine::canModifyProp ( int  propid) const
virtual

Reimplemented from KLFLibResourceEngine.

Definition at line 540 of file klfliblegacyengine.cpp.

References KLFLibResourceEngine::canModifyProp().

bool KLFLibLegacyEngine::canRegisterProperty ( const QString propName) const
virtual

Reimplemented from KLFLibResourceEngine.

Definition at line 546 of file klfliblegacyengine.cpp.

bool KLFLibLegacyEngine::canRenameSubResource ( const QString subResource) const
virtual

Reimplemented from KLFLibResourceEngine.

Definition at line 612 of file klfliblegacyengine.cpp.

bool KLFLibLegacyEngine::changeEntries ( const QString subResource,
const QList< entryId > &  idlist,
const QList< int > &  properties,
const QList< QVariant > &  values 
)
virtualslot
uint KLFLibLegacyEngine::compareUrlTo ( const QUrl other,
uint  interestFlags = 0xfffffff 
) const
virtual

Implements KLFLibResourceEngine.

Definition at line 509 of file klfliblegacyengine.cpp.

References klfUrlCompare(), and KlfUrlCompareBaseEqual.

KLFLibLegacyEngine * KLFLibLegacyEngine::createDotKLF ( const QString fileName,
QString  legacyResourceName,
QObject parent = NULL 
)
static

Use this function as a constructor. Creates a KLFLibLegacyEngine object, with QObject parent parent, creating a fresh, empty .klf file.

Returns NULL if creating the file failed.

legacyResourceName is the name of an empty (legacy) resource (ie. sub-resource) to create in the newly created file.

A non-NULL returned object is linked to a file that was successfully created.

Definition at line 425 of file klfliblegacyengine.cpp.

References QUrl::addQueryItem(), KLFLibLegacyFileDataPrivate::canonicalFilePath(), QObject::connect(), QFile::exists(), KLFLibLegacyFileDataPrivate::fileName(), QUrl::fromLocalFile(), KLFLegacyData::KLFLibraryResource::id, KLFLibLegacyFileDataPrivate::instanceFor(), QString::isEmpty(), KLF_FUNC_NAME, klfDbg, klfDbgSt, KLFLegacyData::LibResourceUSERMAX, KLFLegacyData::KLFLibraryResource::name, QObject::parent(), QString::ref(), KLFLibLegacyFileDataPrivate::resourcePropertyChanged(), QUrl::setScheme(), and QObject::tr().

Referenced by KLFLibLegacyEngineFactory::createResource().

bool KLFLibLegacyEngine::createSubResource ( const QString subResource,
const QString subResourceTitle 
)
virtualslot
bool KLFLibLegacyEngine::deleteEntries ( const QString subResource,
const QList< entryId > &  idlist 
)
virtualslot
bool KLFLibLegacyEngine::deleteSubResource ( const QString subResource)
virtualslot

Definition at line 681 of file klfliblegacyengine.cpp.

References KLF_ASSERT_NOT_NULL, KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and klfDbg.

KLFLibEntry KLFLibLegacyEngine::entry ( const QString resource,
entryId  id 
)
virtual

Implements KLFLibResourceEngine.

Definition at line 552 of file klfliblegacyengine.cpp.

References KLF_ASSERT_NOT_NULL, and QList::size().

QList< KLFLibResourceEngine::entryId > KLFLibLegacyEngine::insertEntries ( const QString subResource,
const KLFLibEntryList entries 
)
virtualslot
KLFLibLegacyEngine * KLFLibLegacyEngine::openUrl ( const QUrl url,
QObject parent = NULL 
)
static

Use this function as a constructor for a KLFLibLegacyEngine object.

Opens the URL referenced by url and returns a pointer to a freshly instantiated KLFLibLegacyEngine object, the parent of which is set to parent. Returns NULL in case of an error.

Definition at line 398 of file klfliblegacyengine.cpp.

References QUrl::hasQueryItem(), QString::isEmpty(), KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbgSt, klfUrlLocalFilePath(), QUrl::queryItemValue(), and QUrl::scheme().

Referenced by KLFLibLegacyEngineFactory::openResource().

bool KLFLibLegacyEngine::renameSubResource ( const QString subResource,
const QString subResourceName 
)
virtualslot
bool KLFLibLegacyEngine::save ( )
virtualslot

Definition at line 708 of file klfliblegacyengine.cpp.

References KLF_ASSERT_NOT_NULL, and klfDbg.

bool KLFLibLegacyEngine::saveResourceProperty ( int  propId,
const QVariant value 
)
protectedvirtual

Implements KLFLibResourceEngine.

Definition at line 913 of file klfliblegacyengine.cpp.

References QString::isEmpty(), KLF_DEBUG_BLOCK, and KLF_FUNC_NAME.

bool KLFLibLegacyEngine::saveTo ( const QUrl newPath)
virtualslot
void KLFLibLegacyEngine::setAutoSaveInterval ( int  intervalms)
virtualslot

Definition at line 720 of file klfliblegacyengine.cpp.

QStringList KLFLibLegacyEngine::subResourceList ( ) const
virtual

Reimplemented from KLFLibResourceEngine.

Definition at line 596 of file klfliblegacyengine.cpp.

References KLF_ASSERT_NOT_NULL.

void KLFLibLegacyEngine::updateResourceProperty ( int  propId)
protectedslot

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

Generated by doxygen 1.8.11