Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

YLogView Class Reference

Implementation of the LogView widget. More...

#include <YLogView.h>

Inheritance diagram for YLogView:

YWidget List of all members.

Public Member Functions

 YLogView (const YWidgetOpt &opt, const YCPString &label, int visibleLines, int maxLines)
virtual char * widgetClass ()
YCPValue changeWidget (const YCPSymbol &property, const YCPValue &newvalue)
YCPValue queryWidget (const YCPSymbol &property)
virtual void setLogText (const YCPString &text)=0
YCPString label () const
int visibleLines () const
int maxLines () const
virtual void setLabel (const YCPString &newLabel)
string logText ()
void appendText (const YCPString &text)
void appendLine (const string &line)
void clearText ()
int lines () const
const char * shortcutProperty ()

Private Attributes

YCPString _label
int _visibleLines
int _maxLines
deque< string > _logText

Detailed Description

Implementation of the LogView widget.

LogView

A scrolled output-only text window where ASCII output of any kind can be redirected - very much like a shell window with "tail -f".

The LogView will keep up to "maxLines" of output, discarding the oldest lines if there are more. If "maxLines" is set to 0, all lines will be kept.

"visibleLines" lines will be visible by default ( without scrolling ) unless you stretch the widget in the layout.

Use ChangeWidget( `id( `log ), `LastLine, "bla blurb...\n" ) to append one or several line(s) to the output. Notice the newline at the end of each line!

Use ChangeWidget( `id( `log ), `Value, "bla blurb...\n" ) to replace the entire contents of the LogView.

Use ChangeWidget( `id( `log ), `Value, "" ) to clear the contents.


Constructor & Destructor Documentation

YLogView::YLogView const YWidgetOpt opt,
const YCPString label,
int  visibleLines,
int  maxLines
 

Constructor.


Member Function Documentation

void YLogView::appendLine const string &  line  ) 
 

Append one single line to the log text.

void YLogView::appendText const YCPString text  ) 
 

Append one or more lines to the log text.

YCPValue YLogView::changeWidget const YCPSymbol property,
const YCPValue newvalue
[virtual]
 

Implements the ui command changeWidget for the widget specific properties.

string Value All log lines. Set this property to replace or clear the entire contents. Can only be set, not queried.

string LastLine The last log line. Set this property to append one or more line(s) to the log. Can only be set, not queried.

string Label The label above the log text.

Reimplemented from YWidget.

void YLogView::clearText  ) 
 

Clear the log text.

YCPString YLogView::label  )  const [inline]
 

Get the label above the log lines.

int YLogView::lines  )  const [inline]
 

Return the current number of lines.

string YLogView::logText  ) 
 

Retrieve the entire log text as one large string of concatenated lines delimited with newlines.

int YLogView::maxLines  )  const [inline]
 

Get the maximum number of lines to store.

YCPValue YLogView::queryWidget const YCPSymbol property  )  [virtual]
 

Implements the ui command changeWidget for the widget specific properties.

Reimplemented from YWidget.

void YLogView::setLabel const YCPString newLabel  )  [virtual]
 

Set the label above the log lines. Overload this, but call YLogView::setLabel at the end of your own function.

virtual void YLogView::setLogText const YCPString text  )  [pure virtual]
 

Set the log text.

const char* YLogView::shortcutProperty  )  [inline, virtual]
 

The name of the widget property that holds the keyboard shortcut. Inherited from YWidget.

Reimplemented from YWidget.

int YLogView::visibleLines  )  const [inline]
 

Get the number of visible lines.

virtual char* YLogView::widgetClass  )  [inline, virtual]
 

Returns a descriptive name of this widget class for logging, debugging etc.

Reimplemented from YWidget.


Member Data Documentation

YCPString YLogView::_label [private]
 

deque<string> YLogView::_logText [private]
 

int YLogView::_maxLines [private]
 

int YLogView::_visibleLines [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:25 2007 for yast2-core by doxygen 1.3.6