libyui
YInputField.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YInputField.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 #ifndef YInputField_h
26 #define YInputField_h
27 
28 #include <string>
29 #include "YWidget.h"
30 
31 class YInputFieldPrivate;
32 
33 
34 
46 class YInputField : public YWidget
47 {
48 protected:
56  const std::string & label,
57  bool passwordMode = false );
58 
59 public:
63  virtual ~YInputField();
64 
69  virtual const char * widgetClass() const;
70 
77  virtual std::string value() = 0;
78 
85  virtual void setValue( const std::string & text ) = 0;
86 
90  std::string label() const;
91 
98  virtual void setLabel( const std::string & label );
99 
106  bool passwordMode() const;
107 
112  std::string validChars();
113 
121  virtual void setValidChars( const std::string & validChars );
122 
127  int inputMaxLength() const;
128 
136  virtual void setInputMaxLength( int numberOfChars );
137 
141  bool shrinkable() const;
142 
150  virtual void setShrinkable( bool shrinkable = true );
151 
162  virtual bool setProperty( const std::string & propertyName,
163  const YPropertyValue & val );
164 
171  virtual YPropertyValue getProperty( const std::string & propertyName );
172 
179  virtual const YPropertySet & propertySet();
180 
186  virtual std::string shortcutString() const { return label(); }
187 
193  virtual void setShortcutString( const std::string & str )
194  { setLabel( str ); }
195 
200  const char * userInputProperty() { return YUIProperty_Value; }
201 
207  virtual void saveUserInput( YMacroRecorder *macroRecorder );
208 
209 private:
210 
212 };
213 
214 
215 #endif // YInputField_h
Definition: YMacroRecorder.h:38
virtual void setInputMaxLength(int numberOfChars)
Definition: YInputField.cc:120
virtual const char * widgetClass() const
Definition: YInputField.cc:195
bool passwordMode() const
Definition: YInputField.cc:83
virtual void setShortcutString(const std::string &str)
Definition: YInputField.h:193
Definition: YInputField.cc:36
Definition: YProperty.h:104
Definition: YProperty.h:197
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition: YInputField.cc:151
const char * userInputProperty()
Definition: YInputField.h:200
virtual void setShrinkable(bool shrinkable=true)
Definition: YInputField.cc:95
YWidget * parent() const
Definition: YWidget.cc:271
std::string label() const
Definition: YInputField.cc:71
virtual const YPropertySet & propertySet()
Definition: YInputField.cc:127
virtual void setLabel(const std::string &label)
Definition: YInputField.cc:77
virtual std::string value()=0
std::string validChars()
Definition: YInputField.cc:102
int inputMaxLength() const
Definition: YInputField.cc:114
virtual void setValue(const std::string &text)=0
virtual void setValidChars(const std::string &validChars)
Definition: YInputField.cc:108
virtual void saveUserInput(YMacroRecorder *macroRecorder)
Definition: YInputField.cc:185
YInputField(YWidget *parent, const std::string &label, bool passwordMode=false)
Definition: YInputField.cc:54
virtual ~YInputField()
Definition: YInputField.cc:65
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition: YInputField.cc:169
virtual std::string shortcutString() const
Definition: YInputField.h:186
Definition: YInputField.h:46
bool shrinkable() const
Definition: YInputField.cc:89
Definition: YWidget.h:54