The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
swcom.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * swcom.h - class SWCom: the basis for all types of commentary modules.
4  * It is traditionally nearly the same as the SWText driver for
5  * Bible modules, but has defaults set which more
6  * closely represent how a commentary will be used and how
7  * the bulk of our commentaries expect to be used. For example,
8  * most commentaries consist of entries for a range of text
9  * (Matt.1.1-6: "Matthew begins with by telling us..."). This
10  * same entry will be returned when any verse between Matt.1.1-6
11  * is requested from the engine. This is done with verse linking.
12  * Since linking is used heavily in commentaries, the flag
13  * skipConsecutiveLinks is defaulted to true so when the
14  * commentary is incremented, it will go to the next ENTRY,
15  * not the next verse (likely Matt.1.7, from our example above).
16  *
17  * $Id: swcom.h 3821 2020-11-02 18:33:02Z scribe $
18  *
19  * Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
20  * CrossWire Bible Society
21  * P. O. Box 2528
22  * Tempe, AZ 85280-2528
23  *
24  * This program is free software; you can redistribute it and/or modify it
25  * under the terms of the GNU General Public License as published by the
26  * Free Software Foundation version 2.
27  *
28  * This program is distributed in the hope that it will be useful, but
29  * WITHOUT ANY WARRANTY; without even the implied warranty of
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31  * General Public License for more details.
32  *
33  */
34 
35 #ifndef SWCOM_H
36 #define SWCOM_H
37 
38 #include <swmodule.h>
39 
40 #include <defs.h>
41 
43 
44 class VerseKey;
45 class SWKey;
46 
49 class SWDLLEXPORT SWCom : public SWModule {
50 
51 private:
52  mutable VerseKey *tmpVK1;
53  mutable VerseKey *tmpVK2;
54  mutable bool tmpSecond;
56 
57 protected:
58  VerseKey &getVerseKey(SWKey *key = 0);
59  const VerseKey &getVerseKey(const SWKey *key = 0) const { return getVerseKeyConst(key); }
60  const VerseKey &getVerseKeyConst(const SWKey *key = 0) const;
61 
62 
63 public:
64 
67  SWCom(const char *imodname = 0, const char *imoddesc = 0,
68  SWDisplay *idisp = 0, SWTextEncoding enc = ENC_UNKNOWN,
70  SWTextMarkup mark = FMT_UNKNOWN, const char *ilang = 0,
71  const char *versification = "KJV");
72 
73  virtual ~SWCom();
74  virtual SWKey *createKey() const;
75 
76  virtual long getIndex() const;
77  virtual void setIndex(long iindex);
78 
79 
80 
81  // OPERATORS -----------------------------------------------------------------
82 
84 
85 };
86 
88 #endif
#define SWTextEncoding
Definition: swmodule.h:78
#define SWORD_NAMESPACE_START
Definition: defs.h:39
virtual void setIndex(long iindex)
Definition: swmodule.h:310
#define SWDLLEXPORT
Definition: defs.h:171
VerseKey * tmpVK1
Definition: swcom.h:52
VerseKey * tmpVK2
Definition: swcom.h:53
char * versification
Definition: swcom.h:55
virtual long getIndex() const
Definition: swmodule.h:309
Definition: swcom.h:49
const VerseKey & getVerseKey(const SWKey *key=0) const
Definition: swcom.h:59
#define SWMODULE_OPERATORS
Definition: swmodule.h:54
bool tmpSecond
Definition: swcom.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