libyui
 
Loading...
Searching...
No Matches
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
30class YLogViewPrivate;
31
32
37class YLogView : public YWidget
38{
39protected:
49 const std::string & label,
50 int visibleLines,
51 int maxLines );
52
53public:
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
189protected:
190
199 virtual void displayLogText( const std::string & text ) = 0;
200
201
202private:
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
Definition ImplPtr.h:43
virtual void setShortcutString(const std::string &str)
Definition YLogView.h:185
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition YLogView.cc:286
YLogView(YWidget *parent, const std::string &label, int visibleLines, int maxLines)
Definition YLogView.cc:59
void setMaxLines(int newMaxLines)
Definition YLogView.cc:112
void appendLines(const std::string &text)
Definition YLogView.cc:162
virtual std::string shortcutString() const
Definition YLogView.h:178
virtual void setLabel(const std::string &label)
Definition YLogView.cc:84
virtual ~YLogView()
Definition YLogView.cc:70
virtual const char * widgetClass() const
Definition YLogView.h:64
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
std::string logText() const
Definition YLogView.cc:126
void setLogText(const std::string &text)
Definition YLogView.cc:206
std::string label() const
Definition YLogView.cc:77
int lines() const
Definition YLogView.cc:226
virtual void displayLogText(const std::string &text)=0
std::string lastLine() const
Definition YLogView.cc:152
int visibleLines() const
Definition YLogView.cc:91
void setVisibleLines(int newVisibleLines)
Definition YLogView.cc:98
virtual const YPropertySet & propertySet()
Definition YLogView.cc:241
Definition YProperty.h:198
Definition YProperty.h:105
YWidget(YWidget *parent)
Definition YWidget.cc:106
YWidget * parent() const
Definition YWidget.cc:277
Definition YLogView.cc:42