libyui
 
Loading...
Searching...
No Matches
YLogView Class Referenceabstract

#include <YLogView.h>

Inheritance diagram for YLogView:
Collaboration diagram for YLogView:

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
 
YWidgetListIterator childrenBegin () const
 
YWidgetListIterator childrenEnd () const
 
YWidgetListConstIterator childrenConstBegin () const
 
YWidgetListConstIterator childrenConstEnd () const
 
YWidgetListIterator begin ()
 
YWidgetListIterator end ()
 
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)
 
void operator delete (void *ptr) noexcept
 
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.

Constructor & Destructor Documentation

◆ YLogView()

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".

◆ ~YLogView()

YLogView::~YLogView ( )
virtual

Destructor.

Member Function Documentation

◆ appendLines()

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

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

◆ clearText()

void YLogView::clearText ( )

Clear the log text and trigger a display update.

◆ displayLogText()

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.

◆ getProperty()

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

Get a property. Reimplemented from YWidget.

This method may throw YUIPropertyExceptions.

Reimplemented from YWidget.

◆ label()

string YLogView::label ( ) const

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

◆ lastLine()

string YLogView::lastLine ( ) const

Return the last log line.

◆ lines()

int YLogView::lines ( ) const

Return the current number of lines.

◆ logText()

string YLogView::logText ( ) const

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

◆ maxLines()

int YLogView::maxLines ( ) const

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

◆ propertySet()

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.

◆ setLabel()

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.

◆ setLogText()

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

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

◆ setMaxLines()

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.

◆ setProperty()

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.

◆ setShortcutString()

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.

◆ setVisibleLines()

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.

◆ shortcutString()

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

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

Reimplemented from YWidget.

Reimplemented from YWidget.

◆ visibleLines()

int YLogView::visibleLines ( ) const

Return the number of visible lines.

◆ widgetClass()

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

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

Reimplemented from YWidget.


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