[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Public Attributes

KLFLibLegacyFileDataPrivate Class Reference

#include <klfliblegacyengine_p.h>

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

List of all members.

Public Types

enum  LegacyLibType { LocalHistoryType = 1, LocalLibraryType, ExportLibraryType }

Public Slots

bool load (const QString &fname=QString())
bool save (const QString &fname=QString())
void emitResourcePropertyChanged (int propId)

Signals

void resourcePropertyChanged (int propId)

Public Member Functions

 ~KLFLibLegacyFileDataPrivate ()
void ref ()
int deref ()
QString fileName () const
int findResourceName (const QString &resname)
int getReservedResourceId (const QString &resourceName, int defaultId)

Static Public Member Functions

static
KLFLibLegacyFileDataPrivate
instanceFor (const QString fname, bool starttimer)
static QString canonicalFilePath (const QString &fname)
static KLFLibEntry toLibEntry (const KLFLegacyData::KLFLibraryItem &item)
static
KLFLegacyData::KLFLibraryItem 
toLegacyLibItem (const KLFLibEntry &entry)
static KLFLegacyData::KLFStyle toLegacyStyle (const KLFStyle &style)
static KLFStyle toStyle (const KLFLegacyData::KLFStyle &oldstyle)

Public Attributes

bool haschanges
KLFLegacyData::KLFLibrary library
KLFLegacyData::KLFLibraryResourceList resources
QVariantMap metadata
LegacyLibType legacyLibType
QTimerautoSaveTimer

Detailed Description

Definition at line 39 of file klfliblegacyengine_p.h.


Member Enumeration Documentation

Enumerator:
LocalHistoryType 
LocalLibraryType 
ExportLibraryType 

Definition at line 118 of file klfliblegacyengine_p.h.


Constructor & Destructor Documentation

KLFLibLegacyFileDataPrivate::~KLFLibLegacyFileDataPrivate ( ) [inline]

Saves the file, removes this instance from the static instance list and deletes the timer.

Definition at line 99 of file klfliblegacyengine_p.h.

References autoSaveTimer, haschanges, klfDbg, QMap::remove(), and save().


Member Function Documentation

static QString KLFLibLegacyFileDataPrivate::canonicalFilePath ( const QString fname) [inline, static]

Returns a path that will be "canonicalized", ie. two (string-wise) different paths pointing to the same file will have the same canonical path (eg. '..' entries simplified, symlinks resolved).

Works for both existing and non-existing files. However for non-existing files the containing directory must exist.

An empty string is returned to indicate an error (eg. containing directory does not exist).

Definition at line 74 of file klfliblegacyengine_p.h.

References QFileInfo::absolutePath(), QFileInfo::canonicalFilePath(), QString::endsWith(), QFileInfo::exists(), QFileInfo::fileName(), QFileInfo::isDir(), QString::isEmpty(), KLF_FUNC_NAME, and klfDbg.

Referenced by KLFLibLegacyEngine::createDotKLF(), instanceFor(), and save().

int KLFLibLegacyFileDataPrivate::deref ( ) [inline]

Dereferences, and returns the remaining number of references to this object. The caller should delete the object if the return value is zero.

Definition at line 113 of file klfliblegacyengine_p.h.

Referenced by KLFLibLegacyEngine::~KLFLibLegacyEngine().

void KLFLibLegacyFileDataPrivate::emitResourcePropertyChanged ( int  propId) [inline, slot]
QString KLFLibLegacyFileDataPrivate::fileName ( ) const [inline]
int KLFLibLegacyFileDataPrivate::findResourceName ( const QString resname)
int KLFLibLegacyFileDataPrivate::getReservedResourceId ( const QString resourceName,
int  defaultId 
)
static KLFLibLegacyFileDataPrivate* KLFLibLegacyFileDataPrivate::instanceFor ( const QString  fname,
bool  starttimer 
) [inline, static]

Get the KLFLibLegacyFileDataPrivate instance assigned to file fname. The file data is already loaded, ie. don't call load().

Don't forget to call ref() to reference the returned object.

autoSaveTimer is instantiated and started; however you must

Definition at line 50 of file klfliblegacyengine_p.h.

References autoSaveTimer, canonicalFilePath(), QMap::contains(), QString::isEmpty(), KLF_FUNC_NAME, klfDbg, and QTimer::start().

bool KLFLibLegacyFileDataPrivate::load ( const QString fname = QString()) [slot]
void KLFLibLegacyFileDataPrivate::ref ( ) [inline]

Should be called explicitely by any class that wishes to use this instance. See also deref()

Definition at line 110 of file klfliblegacyengine_p.h.

void KLFLibLegacyFileDataPrivate::resourcePropertyChanged ( int  propId) [signal]
bool KLFLibLegacyFileDataPrivate::save ( const QString fname = QString()) [slot]
static KLFLegacyData::KLFLibraryItem KLFLibLegacyFileDataPrivate::toLegacyLibItem ( const KLFLibEntry entry) [inline, static]
static KLFLegacyData::KLFStyle KLFLibLegacyFileDataPrivate::toLegacyStyle ( const KLFStyle style) [inline, static]
static KLFLibEntry KLFLibLegacyFileDataPrivate::toLibEntry ( const KLFLegacyData::KLFLibraryItem item) [inline, static]
static KLFStyle KLFLibLegacyFileDataPrivate::toStyle ( const KLFLegacyData::KLFStyle oldstyle) [inline, static]

Member Data Documentation

Definition at line 138 of file klfliblegacyengine_p.h.

Referenced by load(), and save().

Metadata, may be used for any purpose.

upon modification, DON'T FORGET to set haschanges !

List of properties:

  • "ResProps" : a QVariantMap with all resource properties as { 'name' => value }
Todo:
In the future, this will be how resource and sub-resource properties will be supported.

Definition at line 136 of file klfliblegacyengine_p.h.

Referenced by load(), save(), KLFLibLegacyEngine::saveResourceProperty(), and KLFLibLegacyEngine::updateResourceProperty().


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

Generated by doxygen 1.7.3