Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SWLD Class Reference

the basis for all types of Lexicon and Dictionary modules (hence the 'LD'). More...

#include <swld.h>

Inheritance diagram for SWLD:

Inheritance graph
[legend]
Collaboration diagram for SWLD:

Collaboration graph
[legend]
List of all members.

Public Methods

 SWLD (const char *imodname=0, const char *imoddesc=0, SWDisplay *idisp=0, SWTextEncoding encoding=ENC_UNKNOWN, SWTextDirection dir=DIRECTION_LTR, SWTextMarkup markup=FMT_UNKNOWN, const char *ilang=0)
 Initializes data for instance of SWLD. More...

virtual ~SWLD ()
virtual SWKeyCreateKey ()
 Allocates a key of specific type for module The different reimplementatiosn of SWModule (e.g. More...

virtual const char * KeyText (const char *ikeytext)
 Sets/gets module KeyText, getting from saved text if key is persistent. More...


Protected Attributes

char * entkeytxt

Detailed Description

the basis for all types of Lexicon and Dictionary modules (hence the 'LD').

Definition at line 34 of file swld.h.


Constructor & Destructor Documentation

SWLD::SWLD const char *    imodname = 0,
const char *    imoddesc = 0,
SWDisplay   idisp = 0,
SWTextEncoding    encoding = ENC_UNKNOWN,
SWTextDirection    dir = DIRECTION_LTR,
SWTextMarkup    markup = FMT_UNKNOWN,
const char *    ilang = 0
 

Initializes data for instance of SWLD.

Parameters:
imodname  Internal name for module
imoddesc  Name to display to user for module
idisp  Display object to use for displaying

Definition at line 17 of file swld.cpp.

References CreateKey(), and SWModule::key.

00017                                                                                                                                                       : SWModule(imodname, imoddesc, idisp, "Lexicons / Dictionaries", enc, dir, mark, ilang)
00018 {
00019         delete key;
00020         key = CreateKey();
00021         entkeytxt = new char [1];
00022         *entkeytxt = 0;
00023 }


Member Function Documentation

virtual SWKey* SWLD::CreateKey   [inline, virtual]
 

Allocates a key of specific type for module The different reimplementatiosn of SWModule (e.g.

SWText) support SWKey implementations, which support special. This functions returns a SWKey object which works with the current implementation of SWModule. For example for the SWText class it returns a VerseKey object.

See also:
VerseKey, ListKey, SWText, SWLD, SWCom
Returns:
pointer to allocated key

Reimplemented from SWModule.

Definition at line 47 of file swld.h.

Referenced by SWLD().

00048   {
00049     return new StrKey ();
00050   }

const char * SWLD::KeyText const char *    ikeytext [virtual]
 

Sets/gets module KeyText, getting from saved text if key is persistent.

Parameters:
ikeytext  value which to set keytext; [0] - only get
Returns:
pointer to keytext

Reimplemented from SWModule.

Definition at line 47 of file swld.cpp.

References SWModule::getRawEntry(), SWModule::key, SWModule::KeyText(), and SWKey::Persist().

00048 {
00049         if (key->Persist() && !ikeytext) {
00050                 getRawEntry();  // force module key to snap to entry
00051                 return entkeytxt;
00052         }
00053         else return SWModule::KeyText(ikeytext);
00054 }


The documentation for this class was generated from the following files:
Generated on Thu Jun 20 22:13:03 2002 for The Sword Project by doxygen1.2.15