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

#include <YRichText.h>

Inheritance diagram for YRichText:
Collaboration diagram for YRichText:

Public Member Functions

 YRichText (YWidget *parent, const std::string &text, bool plainTextMode=false)
 
virtual ~YRichText ()
 
virtual const char * widgetClass () const
 
virtual void setValue (const std::string &newValue)
 
std::string value () const
 
void setText (const std::string &newText)
 
std::string text () const
 
bool plainTextMode () const
 
virtual void setPlainTextMode (bool on=true)
 
bool autoScrollDown () const
 
virtual void setAutoScrollDown (bool on=true)
 
bool shrinkable () const
 
void setShrinkable (bool shrinkable=true)
 
virtual bool setProperty (const std::string &propertyName, const YPropertyValue &val)
 
virtual YPropertyValue getProperty (const std::string &propertyName)
 
virtual const YPropertySetpropertySet ()
 
virtual std::string vScrollValue () const
 
virtual void setVScrollValue (const std::string &newValue)
 
virtual std::string hScrollValue () const
 
virtual void setHScrollValue (const std::string &newValue)
 
virtual void activateLink (const std::string &url)=0
 
- 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 std::string shortcutString () const
 
virtual void setShortcutString (const std::string &str)
 
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 Attributes

ImplPtr< YRichTextPrivatepriv
 

Additional Inherited Members

- 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

Text formatted with simple HTML-like tags, with "links" generating events.

Constructor & Destructor Documentation

◆ YRichText()

YRichText::YRichText ( YWidget * parent,
const std::string & text,
bool plainTextMode = false )

Constructor.

'plainTextMode' indicates that the text should be treated as plain text, i.e. any HTML-like tags in the text should not be interpreted in any way.

◆ ~YRichText()

YRichText::~YRichText ( )
virtual

Destructor.

Member Function Documentation

◆ activateLink()

virtual void YRichText::activateLink ( const std::string & url)
pure virtual

Derived classes should implement this, method is used to trigger event like user has pressed the link in the RichText

◆ autoScrollDown()

bool YRichText::autoScrollDown ( ) const

Return 'true' if this RichText widget should automatically scroll down when the text content is changed. This is useful for progress displays and log files.

◆ getProperty()

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

Get a property. Reimplemented from YWidget.

This method may throw YUIPropertyExceptions.

Reimplemented from YWidget.

◆ hScrollValue()

std::string YRichText::hScrollValue ( ) const
virtual

Get the position value of the horizontal scrollbar.

Might not be available in all frontends.

◆ plainTextMode()

bool YRichText::plainTextMode ( ) const

Return 'true' if this RichText widget is in "plain text" mode, i.e. does not try to interpret RichText/HTML tags.

◆ propertySet()

const YPropertySet & YRichText::propertySet ( )
virtual

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

Reimplemented from YWidget.

Reimplemented from YWidget.

◆ setAutoScrollDown()

void YRichText::setAutoScrollDown ( bool on = true)
virtual

Set this RichText widget's "auto scroll down" mode on or off.

Derived classes may want to reimplement this, but they should call this base class function in the new function.

◆ setHScrollValue()

void YRichText::setHScrollValue ( const std::string & newValue)
virtual

Set the position value of the horizontal scrollbar. Only values previously obtained using hScrollValue() and some special values are allowed.

The special values are:

"minimum": Moves the scrollbar to the start. "maximum": Moves the scrollbar to the end.

The meaning of start and end can depend on the text direction (LTR or RTL).

Might not be available in all frontends.

◆ setPlainTextMode()

void YRichText::setPlainTextMode ( bool on = true)
virtual

Set this RichText widget's "plain text" mode on or off.

Derived classes may want to reimplement this, but they should call this base class function in the new function.

◆ setProperty()

bool YRichText::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.

◆ setShrinkable()

void YRichText::setShrinkable ( bool shrinkable = true)

Make this widget shrinkable, i.e. very small in layouts.

This method is intentionally not virtual because it doesn't have any immediate effect; it is only needed in preferredWidth() / preferredHeight().

◆ setText()

void YRichText::setText ( const std::string & newText)
inline

Alias for setValue().

◆ setValue()

void YRichText::setValue ( const std::string & newValue)
virtual

Change the text content of the RichText widget.

Derived classes should overwrite this function, but call this base class function in the new function.

◆ setVScrollValue()

void YRichText::setVScrollValue ( const std::string & newValue)
virtual

Set the position value of the vertical scrollbar. Only values previously obtained using vScrollValue() and some special values are allowed.

The special values are:

"minimum": Moves the scrollbar to the start. "maximum": Moves the scrollbar to the end.

This might not be available in all frontends.

◆ shrinkable()

bool YRichText::shrinkable ( ) const

Returns 'true' if this widget is "shrinkable", i.e. it should be very small by default.

◆ text()

std::string YRichText::text ( ) const
inline

Alias for value().

◆ value()

string YRichText::value ( ) const

Return the text content of the RichText widget.

◆ vScrollValue()

std::string YRichText::vScrollValue ( ) const
virtual

Get the position value of the vertical scrollbar.

Might not be available in all frontends.

◆ widgetClass()

virtual const char * YRichText::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: