inputstrlist.h
Go to the documentation of this file.
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,
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);
56  void writeValue(QTextStream &t,QTextCodec *codec);
57  void setTemplateDocs(const QString &docs) { m_tdocs = docs; }
58 
59  public slots:
60  void reset();
61 
62  signals:
63  void changed();
64  void showHelp(Input *);
65 
66  private slots:
67  void addString();
68  void delString();
69  void updateString();
70  void selectText(const QString &s);
71  void browseFiles();
72  void browseDir();
73  void help();
74 
75  private:
76  void updateDefault();
77  QLabel *m_lab;
78  QLineEdit *m_le;
79  QAction *m_add;
80  QAction *m_del;
81  QAction *m_upd;
82  QAction *m_brFile;
83  QAction *m_brDir;
84  QListWidget *m_lb;
87  QVariant m_value;
91 };
92 
93 #endif
void setTemplateDocs(const QString &docs)
Definition: inputstrlist.h:57
QString m_tdocs
Definition: inputstrlist.h:90
QString docs() const
Definition: inputstrlist.h:50
void changed()
void writeValue(QTextStream &t, QTextCodec *codec)
void setValue(const QStringList &sl)
QLabel * m_lab
Definition: inputstrlist.h:77
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
QAction * m_add
Definition: inputstrlist.h:79
void browseFiles()
void addString()
QString m_docs
Definition: inputstrlist.h:88
QLineEdit * m_le
Definition: inputstrlist.h:78
QAction * m_brFile
Definition: inputstrlist.h:82
A list of strings.
Definition: qstringlist.h:51
void addDependency(Input *)
Definition: inputstrlist.h:53
QString templateDocs() const
Definition: inputstrlist.h:52
QVariant m_value
Definition: inputstrlist.h:87
QStringList m_strList
Definition: inputstrlist.h:86
void updateDefault()
void showHelp(Input *)
void updateDependencies()
Definition: inputstrlist.h:55
Definition: input.h:9
The QTextStream class provides basic functions for reading and writing text using a QIODevice...
Definition: qtextstream.h:53
QAction * m_brDir
Definition: inputstrlist.h:83
void setEnabled(bool)
Kind
Definition: input.h:12
QVariant & value()
QStringList m_default
Definition: inputstrlist.h:85
QString m_id
Definition: inputstrlist.h:89
QAction * m_upd
Definition: inputstrlist.h:81
QString id() const
Definition: inputstrlist.h:51
void selectText(const QString &s)
QListWidget * m_lb
Definition: inputstrlist.h:84
QAction * m_del
Definition: inputstrlist.h:80
Provides conversion between text encodings.
Definition: qtextcodec.h:62
void updateString()
static QCString * s
Definition: config.cpp:1042
InputStrList(QGridLayout *layout, int &row, const QString &id, const QStringList &sl, ListMode v, const QString &docs)
Kind kind() const
Definition: inputstrlist.h:49