• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kiten/lib

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Entry Class Referenceabstract

#include <entry.h>

Inheritance diagram for Entry:
Inheritance graph
[legend]

Public Member Functions

virtual ~Entry ()
 
virtual Entry * clone () const =0
 
virtual QString dumpEntry () const =0
 
virtual bool extendedItemCheck (const QString &key, const QString &value) const
 
virtual QString getDictionaryType () const =0
 
const QString & getDictName () const
 
const QHash< QString, QString > & getExtendedInfo () const
 
QString getExtendedInfoItem (const QString &x) const
 
QString getMeanings () const
 
QStringList getMeaningsList () const
 
QString getReadings () const
 
QStringList getReadingsList () const
 
QString getWord () const
 
virtual bool loadEntry (const QString &)=0
 
virtual bool matchesQuery (const DictQuery &) const
 
virtual bool sort (const Entry &that, const QStringList &dictionaryList, const QStringList &fieldList) const
 
virtual bool sortByField (const Entry &that, const QString &field) const
 
virtual QString toHTML () const
 
virtual QString toKVTML () const
 
virtual QString toString () const
 

Protected Member Functions

 Entry (const Entry &)
 
 Entry (const QString &sourceDictionary)
 
 Entry (const QString &sourceDictionary, const QString &word, const QStringList &readings, const QStringList &meanings)
 
virtual QString HTMLMeanings () const
 
virtual QString HTMLReadings () const
 
virtual QString HTMLWord () const
 
void init ()
 
bool isKanji (const QChar &character) const
 
bool listMatch (const QStringList &list, const QStringList &test, DictQuery::MatchType type) const
 
virtual QString makeLink (const QString &entryString) const
 

Protected Attributes

QHash< QString, QString > ExtendedInfo
 
QStringList Meanings
 
QString outputListDelimiter
 
QStringList Readings
 
QString sourceDict
 
QString Word
 

Detailed Description

The Entry class is a generic base class for each particular entry in a given dictionary.

It's used as the basic class to ferry information back to the user application. It also handles some of the display aspects.

Definition at line 44 of file entry.h.

Constructor & Destructor Documentation

Entry::Entry ( const Entry &  src)
protected

Copy constructor.

Definition at line 68 of file entry.cpp.

Entry::Entry ( const QString &  sourceDictionary)
protected

Constructor that includes the dictionary source.

This does not need to be overridded by subclasses, but you might find it to be convenient as the superclass constructor to call from your constructors.

Parameters
sourceDictionarythe dictionary name (not fileName) that this entry originated with

Definition at line 52 of file entry.cpp.

Entry::Entry ( const QString &  sourceDictionary,
const QString &  word,
const QStringList &  readings,
const QStringList &  meanings 
)
protected

A constructor that includes the basic information, nicely separated.

Parameters
sourceDictionarythe dictionary name (not fileName) that this entry originated with
wordthe word entry of this dictionary entry (normally kanji/kana)
readingsa list of possible pronunciations for this result (kana)
meaningsa list of possible meanings for this word

Definition at line 58 of file entry.cpp.

Entry::~Entry ( )
virtual

Generic Destructor.

Definition at line 78 of file entry.cpp.

Member Function Documentation

virtual Entry* Entry::clone ( ) const
pure virtual

A clone method, this should just implement "return new EntrySubClass(*this)".

Implemented in EntryEdict, and EntryKanjidic.

virtual QString Entry::dumpEntry ( ) const
pure virtual

Return a QString of an entry, as if it were dumped back into it's source file.

Implemented in EntryEdict, and EntryKanjidic.

bool Entry::extendedItemCheck ( const QString &  key,
const QString &  value 
) const
virtual

Simple accessor.

Parameters
keythe key for the extended item that is being verified
valuethe value it is supposed to have
Returns
true if the key has that value, false if it is different or does not exist

Reimplemented in EntryKanjidic.

Definition at line 83 of file entry.cpp.

virtual QString Entry::getDictionaryType ( ) const
pure virtual

Get the dictionary type (e.g.

edict, kanjidic).

Implemented in EntryEdict, and EntryKanjidic.

const QString & Entry::getDictName ( ) const

Get the dictionary name that generated this Entry.

I can't think of a reason to be changing this

Definition at line 91 of file entry.cpp.

const QHash< QString, QString > & Entry::getExtendedInfo ( ) const

Simple accessor.

Definition at line 140 of file entry.cpp.

QString Entry::getExtendedInfoItem ( const QString &  x) const

Simple accessor.

Parameters
xthe key for the extended info item to get

Definition at line 150 of file entry.cpp.

QString Entry::getMeanings ( ) const

Get a QString containing all of the meanings known, connected by the outputListDelimiter.

Definition at line 108 of file entry.cpp.

QStringList Entry::getMeaningsList ( ) const

Simple accessor.

Definition at line 116 of file entry.cpp.

QString Entry::getReadings ( ) const

Simple accessor.

Definition at line 124 of file entry.cpp.

QStringList Entry::getReadingsList ( ) const

Simple accessor.

Definition at line 132 of file entry.cpp.

QString Entry::getWord ( ) const

Get the word from this Entry.

If the entry is of type kanji/kana/meaning/etc, this will return the kanji. If it is of kana/meaning/etc, it will return kana.

Definition at line 100 of file entry.cpp.

QString Entry::HTMLMeanings ( ) const
inlineprotectedvirtual

Return and HTML version of a meaning list.

Prepares Meanings for output as HTML.

Definition at line 158 of file entry.cpp.

QString Entry::HTMLReadings ( ) const
inlineprotectedvirtual

Return and HTML version of a reading list.

Reimplemented in EntryKanjidic.

Definition at line 165 of file entry.cpp.

QString Entry::HTMLWord ( ) const
inlineprotectedvirtual

Return and HTML version of a word.

Prepares Word for output as HTML.

Reimplemented in EntryEdict, and EntryKanjidic.

Definition at line 180 of file entry.cpp.

void Entry::init ( )
protected

This is used by the constructors to set some default values.

Definition at line 185 of file entry.cpp.

bool Entry::isKanji ( const QChar &  character) const
protected

Handy Utility functions for matching to lists and identifying char types.

Determines whether.

Parameters
characteris a kanji character.

Definition at line 193 of file entry.cpp.

bool Entry::listMatch ( const QStringList &  list,
const QStringList &  test,
DictQuery::MatchType  type 
) const
protected

Handy Utility functions for matching to lists and identifying char types.

Returns true if all members of test are in list.

Definition at line 211 of file entry.cpp.

virtual bool Entry::loadEntry ( const QString &  )
pure virtual

An entry should be able to parse an in-file representation of an entry as a QString and put it back.

The latter will be useful for writing to dictionaries on disk at some point.

Implemented in EntryEdict, and EntryKanjidic.

QString Entry::makeLink ( const QString &  entryString) const
inlineprotectedvirtual

Handy function for generating a link from a given QString.

New functions for Entry doing direct display.

Creates a link for the given

Parameters
entryString.

Definition at line 289 of file entry.cpp.

bool Entry::matchesQuery ( const DictQuery &  query) const
virtual

Fairly important method, this tests if this particular entry matches a query.

The EDICT and Kanjidic doSearch methods do an approximate match, load an Entry, and then check more carefully by calling this method. This works nicely for handling searchWithinResults cleanly.

Definition at line 294 of file entry.cpp.

bool Entry::sort ( const Entry &  that,
const QStringList &  dictOrder,
const QStringList &  fields 
) const
virtual

An overrideable sorting function, similer to operator< in most contexts The default version will sort by dictionary, then by fields.

This version of sort only sorts dictionaries...

Parameters
thatthe second item we are comparing (this) with
dictionaryListthe list of dictionaries (in order) to sort If this list is empty, the entries will not be sorted in order
fieldListthe list of fields to sort in, uses special codes of Reading, Meaning, Word/Kanji for those elements, all others by their extended attribute keys.

This is a replacement for a operator< function... so we return true if "this" should show up first on the list.

Definition at line 425 of file entry.cpp.

bool Entry::sortByField ( const Entry &  that,
const QString &  field 
) const
virtual

Overrideable sorting mechanism for sorting by individual fields.

The sort routine checks if the given field is equal, before calling this virtual function So if this is called, you can assume that this->extendedItem(field) != that.extendedItem(field)

Parameters
thatthe second item we are comparing (this) with
fieldthe specific extended item field that is being compared

Definition at line 485 of file entry.cpp.

QString Entry::toHTML ( ) const
virtual

An entry should be able to generate a representation of itself in (valid) HTML.

Main switching function for displaying to the user.

Reimplemented in EntryEdict, and EntryKanjidic.

Definition at line 384 of file entry.cpp.

QString Entry::toKVTML ( ) const
inlinevirtual

KVTML format for exporting.

Definition at line 392 of file entry.cpp.

QString Entry::toString ( ) const
virtual

This will return a pure text interpretation of the Entry.

This method should return the entry object in a simple QString format Brief form should be useable in quick summaries, for example Verbose form might be used to save a complete list of entries to a file, for example.

Definition at line 413 of file entry.cpp.

Member Data Documentation

QHash<QString,QString> Entry::ExtendedInfo
protected

A hash of extended information.

You may find it useful to store all sorts of details here

Definition at line 207 of file entry.h.

QStringList Entry::Meanings
protected

The Meanings that match this entry.

If you override the accessors above, this has no use.

Definition at line 198 of file entry.h.

QString Entry::outputListDelimiter
protected

The delimiter for lists...

usually space

Definition at line 216 of file entry.h.

QStringList Entry::Readings
protected

The Readings (usually kana) that match this entry.

If you override the accessors above, this has no use.

Definition at line 203 of file entry.h.

QString Entry::sourceDict
protected

The dictionary that this entry originated at.

Definition at line 212 of file entry.h.

QString Entry::Word
protected

The Word (usually containing kanji) that matches this entry.

If you override the accessors above, this has no use.

Definition at line 193 of file entry.h.


The documentation for this class was generated from the following files:
  • entry.h
  • entry.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kiten/lib

Skip menu "kiten/lib"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal