1
/***************************************************************************
3
* $Id: swoptfilter.h 1864 2005-11-20 06:06:40Z scribe $
5
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
6
* CrossWire Bible Society
10
* This program is free software; you can redistribute it and/or modify it
11
* under the terms of the GNU General Public License as published by the
12
* Free Software Foundation version 2.
14
* This program is distributed in the hope that it will be useful, but
15
* WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* General Public License for more details.
31
* The type definitoin for option types
33
typedef std::list < SWBuf > StringList;
36
/** Base class for all option filters.
38
class SWDLLEXPORT SWOptionFilter : public SWFilter {
43
const StringList *optValues;
48
SWOptionFilter(const char *oName, const char *oTip, const StringList *oValues);
49
virtual ~SWOptionFilter();
52
/** gets the name of the option of this filter
55
virtual const char *getOptionName() { return optName; }
57
/** gets a short explanation of the option of this filter;
58
* it could be presented to the user in frontend programs
59
* @return option tip/explanation
61
virtual const char *getOptionTip() { return optTip; }
63
/** returns a list of the possible option values
65
* @return list of option values
67
virtual StringList getOptionValues() { return *optValues; }
69
/** @return The value of the current option.
71
virtual const char *getOptionValue();
73
/** sets the value of the option of this filter,
74
* e.g maybe a strong's filter mioght be set to "on" / "off" -
75
* that would mean to show or not to show the strongs in the text,
76
* see also getOptionValues()
77
* @param ival the new option value
79
virtual void setOptionValue(const char *ival);