Imported Upstream version 1.8.15
[platform/upstream/doxygen.git] / addon / doxywizard / inputstrlist.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 _INPUTSTRLIST_H
16 #define _INPUTSTRLIST_H
17
18 #include "input.h"
19
20 #include <QObject>
21 #include <QStringList>
22
23 class QLabel;
24 class QLineEdit;
25 class QPushButton;
26 class QListWidget;
27 class QStringList;
28 class QGridLayout;
29 class QAction;
30
31 class InputStrList : public QObject, public Input
32 {
33   Q_OBJECT
34
35   public:
36     enum ListMode { ListString  = 0,
37                     ListFile    = 1,
38                     ListDir     = 2,
39                     ListFileDir = ListFile | ListDir
40                   };
41
42     InputStrList( QGridLayout *layout,int &row,
43                   const QString &id, const QStringList &sl,
44                   ListMode v, const QString &docs);
45     void setValue(const QStringList &sl);
46
47     QVariant &value();
48     void update();
49     Kind kind() const { return StrList; }
50     QString docs() const { return m_docs; }
51     QString id() const { return m_id; }
52     QString templateDocs() const { return m_tdocs; }
53     void addDependency(Input *) { Q_ASSERT(false); }
54     void setEnabled(bool);
55     void updateDependencies() {}
56     void writeValue(QTextStream &t,QTextCodec *codec);
57     void setTemplateDocs(const QString &docs) { m_tdocs = docs; }
58     bool isEmpty();
59
60   public slots:
61     void reset();
62
63   signals:
64     void changed();
65     void showHelp(Input *);
66
67   private slots:
68     void addString(); 
69     void delString(); 
70     void updateString(); 
71     void selectText(const QString &s);
72     void browseFiles();
73     void browseDir();
74     void help();
75
76   private:
77     void updateDefault();
78     QLabel       *m_lab;
79     QLineEdit    *m_le;
80     QAction      *m_add;
81     QAction      *m_del;
82     QAction      *m_upd;
83     QAction      *m_brFile;
84     QAction      *m_brDir;
85     QListWidget  *m_lb;
86     QStringList   m_default;
87     QStringList   m_strList;
88     QVariant      m_value;
89     QString       m_docs;
90     QString       m_id;
91     QString       m_tdocs;
92 };
93
94 #endif