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

kiten/lib

  • sources
  • kde-4.14
  • kdeedu
  • kiten
  • lib
dictfile.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * This file is part of Kiten, a KDE Japanese Reference Tool *
3  * Copyright (C) 2006 Joseph Kerian <jkerian@gmail.com> *
4  * *
5  * This library is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Library General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2 of the License, or (at your option) any later version. *
9  * *
10  * This library is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13  * Library General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU Library General Public License *
16  * along with this library; see the file COPYING.LIB. If not, write to *
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
18  * Boston, MA 02110-1301, USA. *
19  *****************************************************************************/
20 
21 #ifndef KITEN_DICTFILE_H
22 #define KITEN_DICTFILE_H
23 
24 #include "libkitenexport.h"
25 
26 #include <QMap>
27 #include <QString>
28 
29 class DictQuery;
30 class DictionaryPreferenceDialog;
31 class Entry;
32 class EntryList;
33 class KConfig;
34 class KConfigSkeleton;
35 class QStringList;
36 class QWidget;
37 
47 class /* NO_EXPORT */ DictFile
48 {
49  private:
53  DictFile() {}
54  public:
59  DictFile( const QString& dictionaryTypeName ) : m_dictionaryType( dictionaryTypeName ) {}
63  virtual ~DictFile() {}
70  virtual bool validDictionaryFile( const QString &filename ) = 0;
76  virtual bool validQuery( const DictQuery &query ) = 0;
82  virtual EntryList *doSearch( const DictQuery &query ) = 0;
90  virtual bool loadDictionary( const QString &file, const QString &name ) = 0;
100  virtual bool loadNewDictionary( const QString &file, const QString &name )
101  { return loadDictionary( file, name ); }
113  virtual QStringList listDictDisplayOptions( QStringList ) const = 0 ;
121  virtual DictionaryPreferenceDialog *preferencesWidget( KConfigSkeleton *config, QWidget *parent = NULL )
122  { Q_UNUSED( parent ); Q_UNUSED( config ); return NULL; }
127  virtual void loadSettings( KConfigSkeleton* ) {}
128 
132  virtual QString getName() const { return m_dictionaryName; }
136  virtual QString getType() const { return m_dictionaryType; }
140  virtual QString getFile() const { return m_dictionaryFile; }
144  virtual const QMap<QString,QString> &getSearchableAttributes() const
145  { return m_searchableAttributes; }
146  protected:
152  QString m_dictionaryName;
153 
160  QString m_dictionaryFile;
161 
168  QString m_dictionaryType;
178  QMap<QString,QString> m_searchableAttributes;
179 };
180 
181 #endif
QWidget
DictionaryPreferenceDialog
This abstract base class specifies the interface for dictionary preference dialogs in user applicatio...
Definition: dictionarypreferencedialog.h:42
libkitenexport.h
Entry
The Entry class is a generic base class for each particular entry in a given dictionary.
Definition: entry.h:44
DictFile::validQuery
virtual bool validQuery(const DictQuery &query)=0
Is this query relevant to this dictionary type? Usually this will return true, unless the query speci...
QMap< QString, QString >
DictFile::getFile
virtual QString getFile() const
Returns the file that this is working with, usually used in the preferences display.
Definition: dictfile.h:140
DictFile::DictFile
DictFile(const QString &dictionaryTypeName)
Use this constructor for your subclasses.
Definition: dictfile.h:59
DictFile::getSearchableAttributes
virtual const QMap< QString, QString > & getSearchableAttributes() const
Fetch a list of searchable attributes and their codes.
Definition: dictfile.h:144
DictFile::getName
virtual QString getName() const
Returns the name of the dictionary.
Definition: dictfile.h:132
DictFile::m_dictionaryName
QString m_dictionaryName
Name is the 'primary key' of the list of dictionaries.
Definition: dictfile.h:152
DictFile::m_dictionaryType
QString m_dictionaryType
This MUST BE SET IN THE CONSTRUCTOR.
Definition: dictfile.h:168
DictFile::loadNewDictionary
virtual bool loadNewDictionary(const QString &file, const QString &name)
Load a new dictionary.
Definition: dictfile.h:100
DictFile::m_dictionaryFile
QString m_dictionaryFile
This is mostly a placeholder, but your class will get asked what file it is using, so either be sure to put something here, or override getFile() and respond with something that will be sensical in a dictionary selection dialog box.
Definition: dictfile.h:160
DictFile::loadSettings
virtual void loadSettings(KConfigSkeleton *)
Load information from the KConfigSkeleton that you've setup in the above preferences widget...
Definition: dictfile.h:127
DictFile::loadDictionary
virtual bool loadDictionary(const QString &file, const QString &name)=0
Load a dictionary as at system startup.
DictFile::getType
virtual QString getType() const
Returns the type of files this dictFile object deals with.
Definition: dictfile.h:136
DictFile::validDictionaryFile
virtual bool validDictionaryFile(const QString &filename)=0
This method allows the user to test if a dictionary is the proper type for this format.
QString
QStringList
DictFile::listDictDisplayOptions
virtual QStringList listDictDisplayOptions(QStringList) const =0
Return a list of the fields that can be displayed, note the following should probably always be retur...
DictFile::doSearch
virtual EntryList * doSearch(const DictQuery &query)=0
This actually conducts the search on the given query.
DictFile::~DictFile
virtual ~DictFile()
Destructor.
Definition: dictfile.h:63
DictFile::m_searchableAttributes
QMap< QString, QString > m_searchableAttributes
This allows the programming user to see a list of possible search types (probably through a drop down...
Definition: dictfile.h:178
DictFile::preferencesWidget
virtual DictionaryPreferenceDialog * preferencesWidget(KConfigSkeleton *config, QWidget *parent=NULL)
If you want your own dialog to pick preferences for your dict, then override this.
Definition: dictfile.h:121
DictQuery
A class to allow users of libkiten to properly setup a database query.
Definition: dictquery.h:89
DictFile
Abstract base class, used internally by the library for handling different types of dictionaries This...
Definition: dictfile.h:47
EntryList
EntryList is a simple container for Entry objects, and is-a QList A few simple overrides allo...
Definition: entrylist.h:38
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