dba31f6813d760f21bb22bdd9bf08332e9a5c0aa
[platform/upstream/doxygen.git] / addon / doxywizard / inputstring.h
1 /******************************************************************************
2  *
3  * 
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby 
9  * granted. No representations are made about the suitability of this software 
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  */
14
15 #ifndef _INPUTSTRING_H
16 #define _INPUTSTRING_H
17
18 #include "input.h"
19
20 #include <QObject>
21 #include <QMap>
22 #include <QStringList>
23
24 class QLabel;
25 class QLineEdit;
26 class QToolBar;
27 class QComboBox;
28 class QGridLayout;
29
30 class InputString : public QObject, public Input
31 {
32   Q_OBJECT
33
34   public:
35     enum StringMode { StringFree=0, 
36                       StringFile=1, 
37                       StringDir=2, 
38                       StringFixed=3,
39                       StringImage=4
40                     };
41
42     InputString( QGridLayout *layout,int &row,
43                  const QString &id, const QString &s, 
44                  StringMode m,
45                  const QString &docs,
46                  const QString &absPath = QString() );
47     ~InputString();
48     void addValue(QString s);
49     void setDefault();
50
51     // Input
52     QVariant &value();
53     void update();
54     Kind kind() const { return String; }
55     QString docs() const { return m_docs; }
56     QString id() const { return m_id; }
57     QString templateDocs() const { return m_tdocs; }
58     void addDependency(Input *) { Q_ASSERT(false); }
59     void setEnabled(bool);
60     void updateDependencies() {}
61     void writeValue(QTextStream &t,QTextCodec *codec);
62     void setTemplateDocs(const QString &docs) { m_tdocs = docs; }
63
64   public slots:
65     void reset();
66     void setValue(const QString&);
67
68   signals:
69     void changed();
70     void showHelp(Input *);
71
72   private slots:
73     void browse();
74     void clear();
75     void help();
76
77   private:
78     void updateDefault();
79     QLabel       *m_lab;
80     QLineEdit    *m_le;
81     QLabel       *m_im;
82     QToolBar     *m_br;
83     QComboBox    *m_com;
84     QString       m_str;
85     QString       m_default;
86     StringMode    m_sm;
87     QStringList   m_values;
88     int           m_index; 
89     QVariant      m_value;
90     QString       m_docs;
91     QString       m_id;
92     bool          m_absPath;
93     QString       m_tdocs;
94 };
95
96 #endif