swoptfilter.h

00001 /***************************************************************************
00002  *
00003  * $Id: swoptfilter.h 1864 2005-11-20 06:06:40Z scribe $
00004  *
00005  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
00006  *      CrossWire Bible Society
00007  *      P. O. Box 2528
00008  *      Tempe, AZ  85280-2528
00009  *
00010  * This program is free software; you can redistribute it and/or modify it
00011  * under the terms of the GNU General Public License as published by the
00012  * Free Software Foundation version 2.
00013  *
00014  * This program is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * General Public License for more details.
00018  *
00019  */
00020 
00021 #ifndef SWOPTFILTER_H
00022 #define SWOPTFILTER_H
00023 
00024 #include <swfilter.h>
00025 #include <swbuf.h>
00026 #include <list>
00027 
00028 SWORD_NAMESPACE_START
00029 
00033 typedef std::list < SWBuf > StringList;
00034 
00035 
00038 class SWDLLEXPORT SWOptionFilter : public SWFilter {
00039 protected:
00040         SWBuf optionValue;
00041         const char *optName;
00042         const char *optTip;
00043         const StringList *optValues;
00044         bool option;
00045 public:
00046 
00047         SWOptionFilter();
00048         SWOptionFilter(const char *oName, const char *oTip, const StringList *oValues);
00049         virtual ~SWOptionFilter();
00050 
00051 
00055         virtual const char *getOptionName() { return optName; }
00056 
00061         virtual const char *getOptionTip() { return optTip; }
00062 
00067         virtual StringList getOptionValues() { return *optValues; }
00068 
00071         virtual const char *getOptionValue();
00072 
00079         virtual void setOptionValue(const char *ival);
00080 
00081 };
00082 
00083 SWORD_NAMESPACE_END
00084 #endif