options.h
author insilmaril
Wed Sep 06 12:47:06 2006 +0000 (2006-09-06)
changeset 378 1ab7353f8f44
parent 0 7a96bd401351
child 408 c2a05fa925a1
permissions -rw-r--r--
1.8.55 New history window and showtextwindow
     1 #ifndef OPTIONS_H
     2 #define OPTIONS_H
     3 
     4 #include <qstring.h>
     5 #include <qstringlist.h>
     6 //Added by qt3to4:
     7 #include <Q3ValueList>
     8 
     9 enum OptionType  {SwitchOption,StringOption};
    10 
    11 class Option
    12 {
    13 public:
    14 	Option();
    15 	void set (const QString &, const OptionType &, const QString &, const QString &);
    16 	QString getName();
    17 	QString getShort();
    18 	QString getLong();
    19 	OptionType getType();
    20 	void setArg(const QString &);
    21 	QString getArg();
    22 	void setActive();
    23 	bool isActive();
    24 private:
    25 	QString name;
    26 	OptionType type;
    27 	QString sName;
    28 	QString lName;
    29 	QString sarg;
    30 	bool active;
    31 };
    32 
    33 
    34 
    35 typedef Q3ValueList <Option> OptionList;
    36 
    37 class Options
    38 {
    39 public:
    40 	Options();
    41 	int parse();
    42 	void add (const QString &,const OptionType &, const QString &, const QString&);
    43 	void setHelpText(const QString&);
    44 	QString getHelpText();
    45 	QString getProgramName();
    46 	QStringList getFileList();
    47 	bool isOn (const QString &);
    48 	QString getArg (const QString &);
    49 
    50 private:
    51 	QString progname;
    52 	QString helptext;
    53 	QStringList filelist;
    54     OptionList optlist;
    55 };
    56 
    57 #endif