libyui
YLogView.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: YLogView.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 #ifndef YLogView_h
26 #define YLogView_h
27 
28 #include "YWidget.h"
29 
30 class YLogViewPrivate;
31 
32 
37 class YLogView : public YWidget
38 {
39 protected:
49  const std::string & label,
50  int visibleLines,
51  int maxLines );
52 
53 public:
54 
58  virtual ~YLogView();
59 
64  virtual const char * widgetClass() const { return "YLogView"; }
65 
69  std::string label() const;
70 
77  virtual void setLabel( const std::string & label );
78 
82  int visibleLines() const;
83 
92  void setVisibleLines( int newVisibleLines );
93 
98  int maxLines() const;
99 
111  void setMaxLines( int newMaxLines );
112 
117  std::string logText() const;
118 
122  void setLogText( const std::string & text );
123 
127  std::string lastLine() const;
128 
132  void appendLines( const std::string & text );
133 
137  void clearText();
138 
142  int lines() const;
143 
154  virtual bool setProperty( const std::string & propertyName,
155  const YPropertyValue & val );
156 
163  virtual YPropertyValue getProperty( const std::string & propertyName );
164 
171  virtual const YPropertySet & propertySet();
172 
178  virtual std::string shortcutString() const { return label(); }
179 
185  virtual void setShortcutString( const std::string & str )
186  { setLabel( str ); }
187 
188 
189 protected:
190 
199  virtual void displayLogText( const std::string & text ) = 0;
200 
201 
202 private:
203 
207  void appendLine( const std::string & line );
208 
212  void updateDisplay();
213 
214 
215  // Data members
216 
218 
219 };
220 
221 
222 #endif // YLogView_h
std::string lastLine() const
Definition: YLogView.cc:152
void appendLines(const std::string &text)
Definition: YLogView.cc:162
YLogView(YWidget *parent, const std::string &label, int visibleLines, int maxLines)
Definition: YLogView.cc:59
virtual std::string shortcutString() const
Definition: YLogView.h:178
Definition: YProperty.h:104
void setVisibleLines(int newVisibleLines)
Definition: YLogView.cc:98
Definition: YProperty.h:197
int lines() const
Definition: YLogView.cc:226
virtual const YPropertySet & propertySet()
Definition: YLogView.cc:241
YWidget * parent() const
Definition: YWidget.cc:271
virtual void setLabel(const std::string &label)
Definition: YLogView.cc:84
virtual void setShortcutString(const std::string &str)
Definition: YLogView.h:185
std::string logText() const
Definition: YLogView.cc:126
void setLogText(const std::string &text)
Definition: YLogView.cc:206
virtual void displayLogText(const std::string &text)=0
std::string label() const
Definition: YLogView.cc:77
virtual ~YLogView()
Definition: YLogView.cc:70
Definition: YLogView.h:37
Definition: YLogView.cc:41
int visibleLines() const
Definition: YLogView.cc:91
int maxLines() const
Definition: YLogView.cc:105
void clearText()
Definition: YLogView.cc:219
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition: YLogView.cc:267
virtual const char * widgetClass() const
Definition: YLogView.h:64
Definition: YWidget.h:54
void setMaxLines(int newMaxLines)
Definition: YLogView.cc:112
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition: YLogView.cc:286