The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
swtext.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * swtext.h - class SWText: the basis for all Bible modules
4  *
5  * $Id: swtext.h 3821 2020-11-02 18:33:02Z scribe $
6  *
7  * Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
8  * CrossWire Bible Society
9  * P. O. Box 2528
10  * Tempe, AZ 85280-2528
11  *
12  * This program is free software; you can redistribute it and/or modify it
13  * under the terms of the GNU General Public License as published by the
14  * Free Software Foundation version 2.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  */
22 
23 #ifndef SWTEXT_H
24 #define SWTEXT_H
25 
26 #include <swmodule.h>
27 
28 #include <defs.h>
29 
31 
32 class VerseKey;
33 
36 class SWDLLEXPORT SWText : public SWModule {
37 
38 private:
39  // for conversion if we have been set with a different internal key type
40  mutable VerseKey *tmpVK1;
41  mutable VerseKey *tmpVK2;
42  mutable bool tmpSecond;
44 
45 protected:
46  const VerseKey &getVerseKey(const SWKey *key=0) const { return getVerseKeyConst(key); }
47  const VerseKey &getVerseKeyConst(const SWKey *key=0) const;
48  VerseKey &getVerseKey(SWKey *key=0);
49 
50 public:
53  SWText(const char *imodname = 0, const char *imoddesc = 0,
54  SWDisplay *idisp = 0,
55  SWTextEncoding encoding = ENC_UNKNOWN,
57  SWTextMarkup markup = FMT_UNKNOWN, const char *ilang = 0,
58  const char *versification = "KJV");
59 
60  virtual ~SWText();
63  virtual SWKey *createKey() const;
64 
65  virtual long getIndex() const;
66  virtual void setIndex(long iindex);
67 
68  // OPERATORS -----------------------------------------------------------------
69 
71 
72 };
73 
75 
76 #endif
#define SWTextEncoding
Definition: swmodule.h:78
#define SWORD_NAMESPACE_START
Definition: defs.h:39
virtual void setIndex(long iindex)
Definition: swmodule.h:310
Definition: swtext.h:36
#define SWDLLEXPORT
Definition: defs.h:171
char * versification
Definition: swtext.h:43
virtual long getIndex() const
Definition: swmodule.h:309
VerseKey * tmpVK1
Definition: swtext.h:40
VerseKey * tmpVK2
Definition: swtext.h:41
const VerseKey & getVerseKey(const SWKey *key=0) const
Definition: swtext.h:46
#define SWMODULE_OPERATORS
Definition: swmodule.h:54
#define SWTextDirection
Definition: swmodule.h:77
#define SWORD_NAMESPACE_END
Definition: defs.h:40
virtual SWKey * createKey() const
Definition: swmodule.cpp:173
Definition: swkey.h:77
#define SWTextMarkup
Definition: swmodule.h:79
bool tmpSecond
Definition: swtext.h:42