An entry (single formula) in the library. More...
#include <klflib.h>
Public Types | |
enum | PropertyId { Latex = 0, DateTime, Preview, PreviewSize, Category, Tags, Style } |
![]() | |
enum | ToStringFlag |
Static Public Member Functions | |
static QString | categoryFromLatex (const QString &latex) |
static QString | tagsFromLatex (const QString &latex) |
static QString | stripCategoryTagsFromLatex (const QString &latex) |
static QString | latexAddCategoryTagsComment (const QString &latex, const QString &category, const QString &tags) |
static QString | normalizeCategoryPath (const QString &categoryPath) |
Additional Inherited Members | |
![]() | |
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< QVariant > | propertyVector () const |
![]() | |
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) |
An entry (single formula) in the library.
Stores Latex code, Date/Time of evaluation, A preview image, A Category String, A Tags String, and a Style in a KLFPropertizedObject-based object.
This object can be used as a normal value (ie. it has copy constructor, assignment operator and default constructor).
Enumerator | |
---|---|
Latex |
The Latex Code of the equation. |
DateTime |
The Date/Time at which the equation was evaluated. |
Preview |
An Image Preview of equation (scaled down QImage) |
PreviewSize |
A cached value of the size of value in |
Category |
The Category to which eq. belongs (path-style string) |
Tags |
Tags about the equation (string) |
Style |
KLFStyle style used. |
KLFLibEntry::KLFLibEntry | ( | const QString & | latex = QString() , |
const QDateTime & | dt = QDateTime() , |
||
const QImage & | preview = QImage() , |
||
const QSize & | previewsize = QSize() , |
||
const QString & | category = QString() , |
||
const QString & | tags = QString() , |
||
const KLFStyle & | style = KLFStyle() |
||
) |
Definition at line 50 of file klflib.cpp.
References setCategory(), setDateTime(), setLatex(), setPreview(), setPreviewSize(), setStyle(), and setTags().
KLFLibEntry::KLFLibEntry | ( | const QString & | latex, |
const QDateTime & | dt, | ||
const QImage & | preview, | ||
const KLFStyle & | style | ||
) |
This constructor extracts the legacy-style category and tags from latex, and stores latex with those tags stripped.
Definition at line 64 of file klflib.cpp.
References category(), categoryFromLatex(), setCategory(), setDateTime(), setLatex(), setPreview(), setPreviewSize(), setStyle(), setTags(), QImage::size(), stripCategoryTagsFromLatex(), tags(), and tagsFromLatex().
KLFLibEntry::KLFLibEntry | ( | const KLFLibEntry & | copy | ) |
Definition at line 81 of file klflib.cpp.
References KLFPropertizedObject::allProperties(), and KLFPropertizedObject::setAllProperties().
|
virtual |
Definition at line 87 of file klflib.cpp.
|
inline |
Definition at line 86 of file klflib.h.
References KLFPropertizedObject::property(), and QVariant::toString().
Referenced by KLFLibModel::data(), KLFLibEntryEditor::displayEntries(), KLFLibEntry(), operator<<(), KLFMainWin::slotEvaluate(), KLFLibLegacyFileDataPrivate::toLegacyLibItem(), KLFLibModelCache::treeInsertEntry(), and KLFLibModelCache::updateData().
Parses and returns legacy-style category comment string from latex string in the form
%: Category
Definition at line 122 of file klflib.cpp.
References QString::mid(), and QString::section().
Referenced by KLFLibEntry(), and operator>>().
|
inline |
Definition at line 83 of file klflib.h.
References KLFPropertizedObject::property(), and QVariant::toDateTime().
Referenced by KLFLibModel::data(), and KLFLibLegacyFileDataPrivate::toLegacyLibItem().
|
inline |
Definition at line 82 of file klflib.h.
References KLFPropertizedObject::property(), and QVariant::toString().
Referenced by KLFLibModel::data(), KLFLibEntryEditor::displayEntries(), latexAddCategoryTagsComment(), operator<<(), KLFLibDefaultView::selectedEntries(), KLFMainWin::slotEvaluate(), and KLFLibLegacyFileDataPrivate::toLegacyLibItem().
|
static |
Creates a latex with category and tags comments
Definition at line 179 of file klflib.cpp.
References QString::isEmpty(), and latex().
Referenced by KLFLibLegacyEngine::changeEntries(), and KLFLibLegacyFileDataPrivate::toLegacyLibItem().
|
inline |
Definition at line 90 of file klflib.h.
Referenced by KLFMainWin::restoreFromLibrary().
Renders a category-path "pretty" by removing any double-slashes to single slashes. Trailing slashes are removed. The root category is an empty string.
When a category is set to a lib-entry with setCategory()
, it is automatically normalized.
Returned paths may be compared string-wise for equality.
Definition at line 195 of file klflib.cpp.
References QString::chop(), QString::endsWith(), and QString::trimmed().
Referenced by KLFLibModelCache::fetchMore().
|
inline |
Definition at line 84 of file klflib.h.
References KLFPropertizedObject::property(), and QVariant::value().
Referenced by KLFLibModel::data(), KLFLibEntryEditor::displayEntries(), KLFLibModel::dragImage(), KLFMainWin::restoreFromLibrary(), and KLFLibLegacyFileDataPrivate::toLegacyLibItem().
|
inline |
Definition at line 85 of file klflib.h.
References KLFPropertizedObject::property(), and QVariant::value().
Referenced by KLFLibModel::data(), and KLFLibEntrySorter::entryValue().
|
inline |
See also normalizeCategoryPath().
Definition at line 101 of file klflib.h.
References KLFPropertizedObject::setProperty().
Referenced by KLFLibEntry().
|
inline |
Definition at line 94 of file klflib.h.
References KLFPropertizedObject::setProperty().
Referenced by KLFLibEntry().
Set the property named name
to value value
. If the property does not yet exist in the registered properties, it is registered.
Definition at line 92 of file klflib.cpp.
References KLFPropertizedObject::propertyIdForName(), KLFPropertizedObject::registerProperty(), and KLFPropertizedObject::setProperty().
|
inline |
Definition at line 93 of file klflib.h.
References KLFPropertizedObject::setProperty().
Referenced by KLFLibEntry().
|
inline |
Definition at line 95 of file klflib.h.
References KLFPropertizedObject::setProperty().
Referenced by KLFLibEntry().
|
inline |
Definition at line 96 of file klflib.h.
References KLFPropertizedObject::setProperty().
Referenced by KLFLibEntry().
|
inline |
Definition at line 103 of file klflib.h.
References QVariant::fromValue(), and KLFPropertizedObject::setProperty().
Referenced by KLFLibEntry().
|
inline |
Definition at line 102 of file klflib.h.
References KLFPropertizedObject::setProperty().
Referenced by KLFLibEntry().
Removes legacy-style category and tags comment from latex string
Definition at line 145 of file klflib.cpp.
References QString::length(), and QString::mid().
Referenced by KLFLibLegacyEngine::changeEntries(), KLFLibEntry(), KLFLibLegacyFileDataPrivate::toLegacyLibItem(), and KLFLibLegacyFileDataPrivate::toLibEntry().
|
inline |
Definition at line 88 of file klflib.h.
References KLFPropertizedObject::property(), and QVariant::value().
Referenced by KLFLibModel::data(), KLFLibEntryEditor::displayEntries(), KLFMainWin::restoreFromLibrary(), KLFMainWin::slotEvaluate(), and KLFLibLegacyFileDataPrivate::toLegacyLibItem().
|
inline |
Definition at line 87 of file klflib.h.
References KLFPropertizedObject::property(), and QVariant::toString().
Referenced by KLFLibModel::data(), KLFLibEntryEditor::displayEntries(), KLFLibEntry(), operator<<(), KLFLibDefaultView::selectedEntries(), KLFMainWin::slotEvaluate(), and KLFLibLegacyFileDataPrivate::toLegacyLibItem().
Parses and returns legacy-style tags comment string from latex string
Definition at line 131 of file klflib.cpp.
References QString::mid(), and QString::section().
Referenced by KLFLibEntry(), and operator>>().