inputstring.h 1.5 KB
Newer Older
1 2
/******************************************************************************
 *
3
 * 
4
 *
5
 * Copyright (C) 1997-2007 by Dimitri van Heesch.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation under the terms of the GNU General Public License is hereby 
 * granted. No representations are made about the suitability of this software 
 * for any purpose. It is provided "as is" without express or implied warranty.
 * See the GNU General Public License for more details.
 *
 */

#ifndef _INPUTSTRING_H
#define _INPUTSTRING_H

#include <qwidget.h>
#include <qstring.h>
#include <qdict.h>

22 23 24
#include "qtbc.h"
#include "input.h"

25 26 27 28 29
class QLabel;
class QLineEdit;
class QPushButton;
class QComboBox;

30
class InputString : public QWidget, public IInput
31 32 33 34 35 36 37 38 39 40
{
  Q_OBJECT

  public:
    enum StringMode { StringFree=0, 
                      StringFile=1, 
                      StringDir=2, 
                      StringFixed=3
                    };

41
    InputString( const QString &text, QWidget *parent, QCString &s, 
42 43 44 45 46
                 StringMode m=StringFree );
    ~InputString();
    void setEnabled(bool);
    void addValue(const char *s);
    void init();
47
    QObject *qobject() { return this; }
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

  private:
    QLabel *lab;
    QLineEdit *le;
    QPushButton *br;
    QComboBox *com;
    QCString &str;
    StringMode sm;
    QDict<int> *m_values;
    int m_index; 

  signals:
    void changed();

  private slots:
    void textChanged(const QString&);
    void browse();
    void clear();

};

#endif