options.h
author insilmaril
Tue, 15 Aug 2006 11:42:10 +0000
branchqt4-port
changeset 13 9aadd0f58300
parent 2 608f976aa7bb
child 408 c2a05fa925a1
permissions -rw-r--r--
1.8.52 Toolbar layout is saved now.
     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