The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
swoptfilter.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * swoptfilter.h - class SWOptionFilter: the base for all OptionFilters
4  * in SWORD. An OptionFilter allows the user to turn
5  * on and off certain features they may wish to see or
6  * not see. Essentially, an OptionFilter is usually
7  * included in a choice for the end user and the result
8  * of being turned "Off" is that the filter will strip
9  * the markup for that feature from the text stream
10  * when it is processed.
11  *
12  * $Id: swoptfilter.h 3786 2020-08-30 11:35:14Z scribe $
13  *
14  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
15  * CrossWire Bible Society
16  * P. O. Box 2528
17  * Tempe, AZ 85280-2528
18  *
19  * This program is free software; you can redistribute it and/or modify it
20  * under the terms of the GNU General Public License as published by the
21  * Free Software Foundation version 2.
22  *
23  * This program is distributed in the hope that it will be useful, but
24  * WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26  * General Public License for more details.
27  *
28  */
29 
30 #ifndef SWOPTFILTER_H
31 #define SWOPTFILTER_H
32 
33 #include <swfilter.h>
34 #include <swbuf.h>
35 #include <list>
36 
38 
42 typedef std::list<SWBuf> StringList;
43 
44 
47 class SWDLLEXPORT SWOptionFilter : public virtual SWFilter {
48 
49 protected:
51  const char *optName;
52  const char *optTip;
54  bool option;
56 
57 public:
59  SWOptionFilter(const char *oName, const char *oTip, const StringList *oValues);
60  virtual ~SWOptionFilter();
61 
62 
67  bool isBoolean() { return isBooleanVal; }
68 
72  virtual const char *getOptionName() { return optName; }
73 
78  virtual const char *getOptionTip() { return optTip; }
79 
84  virtual StringList getOptionValues() { return *optValues; }
85 
88  virtual const char *getOptionValue();
89 
96  virtual void setOptionValue(const char *ival);
97 
98 };
99 
101 #endif
#define SWORD_NAMESPACE_START
Definition: defs.h:39
virtual const char * getOptionName()
Definition: swoptfilter.h:72
Definition: swbuf.h:47
#define SWDLLEXPORT
Definition: defs.h:171
virtual StringList getOptionValues()
Definition: swoptfilter.h:84
static const StringList * oValues()
SWBuf optionValue
Definition: swoptfilter.h:50
std::list< SWBuf > StringList
Definition: swmodule.cpp:91
static const char oName[]
const char * optName
Definition: swoptfilter.h:51
bool isBoolean()
Definition: swoptfilter.h:67
static const char oTip[]
const char * optTip
Definition: swoptfilter.h:52
virtual const char * getOptionTip()
Definition: swoptfilter.h:78
const StringList * optValues
Definition: swoptfilter.h:53
#define SWORD_NAMESPACE_END
Definition: defs.h:40