libyui  3.0.10
 All Classes Functions Variables Enumerations Friends
YLogView Class Referenceabstract

#include <YLogView.h>

Inheritance diagram for YLogView:
YWidget

Public Member Functions

virtual ~YLogView ()
 
virtual const char * widgetClass () const
 
std::string label () const
 
virtual void setLabel (const std::string &label)
 
int visibleLines () const
 
void setVisibleLines (int newVisibleLines)
 
int maxLines () const
 
void setMaxLines (int newMaxLines)
 
std::string logText () const
 
void setLogText (const std::string &text)
 
std::string lastLine () const
 
void appendLines (const std::string &text)
 
void clearText ()
 
int lines () const
 
virtual bool setProperty (const std::string &propertyName, const YPropertyValue &val)
 
virtual YPropertyValue getProperty (const std::string &propertyName)
 
virtual const YPropertySetpropertySet ()
 
virtual std::string shortcutString () const
 
virtual void setShortcutString (const std::string &str)
 
- Public Member Functions inherited from YWidget
virtual ~YWidget ()
 
virtual std::string debugLabel () const
 
std::string helpText () const
 
void setHelpText (const std::string &helpText)
 
bool hasChildren () const
 
YWidgetfirstChild () const
 
YWidgetlastChild () const
 
YWidgetListConstIterator childrenBegin () const
 
YWidgetListConstIterator childrenEnd () const
 
int childrenCount () const
 
bool contains (YWidget *child) const
 
virtual void addChild (YWidget *child)
 
virtual void removeChild (YWidget *child)
 
void deleteChildren ()
 
YWidgetparent () const
 
bool hasParent () const
 
void setParent (YWidget *newParent)
 
YDialogfindDialog ()
 
YWidgetfindWidget (YWidgetID *id, bool doThrow=true) const
 
virtual int preferredWidth ()=0
 
virtual int preferredHeight ()=0
 
virtual int preferredSize (YUIDimension dim)
 
virtual void setSize (int newWidth, int newHeight)=0
 
bool isValid () const
 
bool beingDestroyed () const
 
void * widgetRep () const
 
void setWidgetRep (void *toolkitWidgetRep)
 
bool hasId () const
 
YWidgetIDid () const
 
void setId (YWidgetID *newId_disown)
 
virtual void setEnabled (bool enabled=true)
 
void setDisabled ()
 
virtual bool isEnabled () const
 
virtual bool stretchable (YUIDimension dim) const
 
void setStretchable (YUIDimension dim, bool newStretch)
 
void setDefaultStretchable (YUIDimension dim, bool newStretch)
 
virtual int weight (YUIDimension dim)
 
bool hasWeight (YUIDimension dim)
 
void setWeight (YUIDimension dim, int weight)
 
void setNotify (bool notify=true)
 
bool notify () const
 
void setNotifyContextMenu (bool notifyContextMenu=true)
 
bool notifyContextMenu () const
 
bool sendKeyEvents () const
 
void setSendKeyEvents (bool doSend)
 
bool autoShortcut () const
 
void setAutoShortcut (bool _newAutoShortcut)
 
int functionKey () const
 
bool hasFunctionKey () const
 
virtual void setFunctionKey (int fkey_no)
 
virtual bool setKeyboardFocus ()
 
virtual const char * userInputProperty ()
 
void dumpWidgetTree (int indentationLevel=0)
 
void dumpDialogWidgetTree ()
 
void setChildrenEnabled (bool enabled)
 
virtual void saveUserInput (YMacroRecorder *macroRecorder)
 
void * operator new (size_t size)
 
virtual void startMultipleChanges ()
 
virtual void doneMultipleChanges ()
 

Protected Member Functions

 YLogView (YWidget *parent, const std::string &label, int visibleLines, int maxLines)
 
virtual void displayLogText (const std::string &text)=0
 
- Protected Member Functions inherited from YWidget
 YWidget (YWidget *parent)
 
YWidgetChildrenManagerchildrenManager () const
 
void setChildrenManager (YWidgetChildrenManager *manager)
 
void setBeingDestroyed ()
 
void dumpWidget (YWidget *w, int indentationLevel)
 

Detailed Description

LogView: A scrollable (output-only) text to display a growing log, very much like the "tail -f" shell command.

Definition at line 37 of file YLogView.h.

Constructor & Destructor Documentation

YLogView::YLogView ( YWidget parent,
const std::string &  label,
int  visibleLines,
int  maxLines 
)
protected

Constructor.

'label' is the caption above the log. 'visibleLines' indicates how many lines should be visible by default (unless changed by other layout constraints), 'maxLines' specifies how many lines (always the last ones) to keep in the log. 0 for 'maxLines' means "keep all lines".

Definition at line 58 of file YLogView.cc.

YLogView::~YLogView ( )
virtual

Destructor.

Definition at line 69 of file YLogView.cc.

Member Function Documentation

void YLogView::appendLines ( const std::string &  text)

Append one or more lines to the log text and trigger a display update.

Definition at line 161 of file YLogView.cc.

void YLogView::clearText ( )

Clear the log text and trigger a display update.

Definition at line 206 of file YLogView.cc.

virtual void YLogView::displayLogText ( const std::string &  text)
protectedpure virtual

Display the part of the log text that should be displayed. 'text' contains the last 'visibleLines()' lines. This is called whenever the log text changes. Note that the text might also be empty, in which case the displayed log text should be cleared.

Derived classes are required to implement this.

YPropertyValue YLogView::getProperty ( const std::string &  propertyName)
virtual

Get a property. Reimplemented from YWidget.

This method may throw YUIPropertyExceptions.

Reimplemented from YWidget.

Definition at line 273 of file YLogView.cc.

std::string YLogView::label ( ) const

Return the label (the caption above the log text).

Definition at line 76 of file YLogView.cc.

std::string YLogView::lastLine ( ) const

Return the last log line.

Definition at line 151 of file YLogView.cc.

int YLogView::lines ( ) const

Return the current number of lines.

Definition at line 213 of file YLogView.cc.

std::string YLogView::logText ( ) const

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

Definition at line 125 of file YLogView.cc.

int YLogView::maxLines ( ) const

Return the maximum number of lines to store. The last maxLines() lines of the log text will be kept.

Definition at line 104 of file YLogView.cc.

const YPropertySet & YLogView::propertySet ( )
virtual

Return this class's property set. This also initializes the property upon the first call.

Reimplemented from YWidget.

Reimplemented from YWidget.

Definition at line 228 of file YLogView.cc.

void YLogView::setLabel ( const std::string &  label)
virtual

Set the label (the caption above the log text).

Derived classes are free to reimplement this, but they should call this base class method at the end of the overloaded function.

Definition at line 83 of file YLogView.cc.

void YLogView::setLogText ( const std::string &  text)
inline

Set (replace) the entire log text and trigger a display update.

Definition at line 122 of file YLogView.h.

void YLogView::setMaxLines ( int  newMaxLines)

Set the maximum number of lines to store. "0" means "keep all lines" (beware of memory overflow!).

If the new value is lower than the old value, any (now) excess lines before the last 'newMaxLines' lines of the log text is cut off and a display update is triggered.

This method is intentionally not virtual since a display update is triggered when appropriate.

Definition at line 111 of file YLogView.cc.

bool YLogView::setProperty ( const std::string &  propertyName,
const YPropertyValue val 
)
virtual

Set a property. Reimplemented from YWidget.

This function may throw YUIPropertyExceptions.

This function returns 'true' if the value was successfully set and 'false' if that value requires special handling (not in error cases: those are covered by exceptions).

Reimplemented from YWidget.

Definition at line 254 of file YLogView.cc.

virtual void YLogView::setShortcutString ( const std::string &  str)
inlinevirtual

Set the string of this widget that holds the keyboard shortcut.

Reimplemented from YWidget.

Reimplemented from YWidget.

Definition at line 186 of file YLogView.h.

void YLogView::setVisibleLines ( int  newVisibleLines)

Set the number of visible lines. Changing this has only effect upon the next geometry call, so applications calling this function might want to trigger a re-layout afterwards.

This method is intentionally not virtual: visibleLines() should be queried in the preferredHeight() implementation.

Definition at line 97 of file YLogView.cc.

virtual std::string YLogView::shortcutString ( ) const
inlinevirtual

Get the string of this widget that holds the keyboard shortcut.

Reimplemented from YWidget.

Reimplemented from YWidget.

Definition at line 179 of file YLogView.h.

int YLogView::visibleLines ( ) const

Return the number of visible lines.

Definition at line 90 of file YLogView.cc.

virtual const char* YLogView::widgetClass ( ) const
inlinevirtual

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

Reimplemented from YWidget.

Definition at line 64 of file YLogView.h.


The documentation for this class was generated from the following files: