Dillo
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
dw::ListItem Class Reference

#include <listitem.hh>

Public Member Functions

 ListItem (ListItem *ref, bool limitTextWidth)
 
 ~ListItem ()
 
void initWithWidget (core::Widget *widget, core::style::Style *style)
 
void initWithText (const char *text, core::style::Style *style)
 
- Public Member Functions inherited from dw::AlignedTextblock
 ~AlignedTextblock ()
 
- Public Member Functions inherited from dw::Textblock
 Textblock (bool limitTextWidth)
 
 ~Textblock ()
 
core::Iteratoriterator (core::Content::Type mask, bool atEnd)
 Return an iterator for this widget.
 
void flush ()
 
void addText (const char *text, size_t len, core::style::Style *style)
 
void addText (const char *text, core::style::Style *style)
 
void addWidget (core::Widget *widget, core::style::Style *style)
 
bool addAnchor (const char *name, core::style::Style *style)
 
void addSpace (core::style::Style *style)
 
void addBreakOption (core::style::Style *style)
 
void addHyphen ()
 
void addParbreak (int space, core::style::Style *style)
 
void addLinebreak (core::style::Style *style)
 
core::WidgetgetWidgetAtPoint (int x, int y, int level)
 Search recursively through widget.
 
void handOverBreak (core::style::Style *style)
 
void changeLinkColor (int link, int newColor)
 
void changeWordStyle (int from, int to, core::style::Style *style, bool includeFirstSpace, bool includeLastSpace)
 
- Public Member Functions inherited from dw::core::Widget
void setDeleteCallback (DW_Callback_t func, void *data)
 
 Widget ()
 
 ~Widget ()
 
bool needsResize ()
 
bool needsAllocate ()
 
bool extremesChanged ()
 
bool wasAllocated ()
 
bool usesHints ()
 
bool hasContents ()
 
bool blockLevel ()
 
void setParent (Widget *parent)
 
style::StylegetStyle ()
 
AllocationgetAllocation ()
 
void sizeRequest (Requisition *requisition)
 This method is a wrapper for Widget::sizeRequestImpl(); it calls the latter only when needed.
 
void getExtremes (Extremes *extremes)
 Wrapper for Widget::getExtremesImpl().
 
void sizeAllocate (Allocation *allocation)
 Wrapper for Widget::sizeAllocateImpl, calls the latter only when needed.
 
bool intersects (Rectangle *area, Rectangle *intersection)
 Calculates the intersection of widget->allocation and area, returned in intersection (in widget coordinates!).
 
bool buttonPress (EventButton *event)
 
bool buttonRelease (EventButton *event)
 
bool motionNotify (EventMotion *event)
 
void enterNotify (EventCrossing *event)
 
void leaveNotify (EventCrossing *event)
 
virtual void setStyle (style::Style *style)
 Change the style of a widget.
 
void setBgColor (style::Color *bgColor)
 Set the background "behind" the widget, if it is not the background of the parent widget, e.g. the background of a table row.
 
style::ColorgetBgColor ()
 Get the actual background of a widget.
 
void drawBox (View *view, style::Style *style, Rectangle *area, int x, int y, int width, int height, bool inverse)
 Draw borders and background of a widget part, which allocation is given by (x, y, width, height) (widget coordinates).
 
void drawWidgetBox (View *view, Rectangle *area, bool inverse)
 Draw borders and background of a widget.
 
void drawSelected (View *view, Rectangle *area)
 
void setButtonSensitive (bool buttonSensitive)
 
bool isButtonSensitive ()
 
WidgetgetParent ()
 
WidgetgetTopLevel ()
 Get the widget at the root of the tree, this widget is part from.
 
int getLevel ()
 Get the level of the widget within the tree.
 
WidgetgetNearestCommonAncestor (Widget *otherWidget)
 Get the widget with the highest level, which is a direct ancestor of widget1 and widget2.
 
LayoutgetLayout ()
 
void scrollTo (HPosition hpos, VPosition vpos, int x, int y, int width, int height)
 
virtual void removeChild (Widget *child)
 
- Public Member Functions inherited from lout::identity::IdentifiableObject
 IdentifiableObject ()
 
virtual void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer.
 
int getClassId ()
 Returns the class identifier.
 
const char * getClassName ()
 Return the name, under which the class of this object was registered.
 
bool instanceOf (int otherClassId)
 Returns, whether this class is an instance of the class, given by otherClassId, or of a sub class of this class.
 
- Public Member Functions inherited from lout::object::Object
virtual ~Object ()
 The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly.
 
virtual bool equals (Object *other)
 Returns, whether two objects are equal.
 
virtual int hashValue ()
 Return a hash value for the object.
 
virtual Objectclone ()
 Return an exact copy of the object.
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object.
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses.
 

Static Public Attributes

static int CLASS_ID = -1
 
- Static Public Attributes inherited from dw::AlignedTextblock
static int CLASS_ID = -1
 
- Static Public Attributes inherited from dw::Textblock
static int CLASS_ID = -1
 
- Static Public Attributes inherited from dw::core::Widget
static int CLASS_ID = -1
 

Protected Member Functions

int getValue ()
 
void setMaxValue (int maxValue, int value)
 
- Protected Member Functions inherited from dw::AlignedTextblock
 AlignedTextblock (bool limitTextWidth)
 
void setRefTextblock (AlignedTextblock *ref)
 
void updateValue ()
 
- Protected Member Functions inherited from dw::Textblock
void printWord (Word *word)
 
void queueDrawRange (int index1, int index2)
 
void getWordExtremes (Word *word, core::Extremes *extremes)
 
void markChange (int ref)
 
void justifyLine (Line *line, int diff)
 
LineaddLine (int firstWord, int lastWord, bool temporary)
 
void calcWidgetSize (core::Widget *widget, core::Requisition *size)
 
void rewrap ()
 
void showMissingLines ()
 
void removeTemporaryLines ()
 
void decorateText (core::View *view, core::style::Style *style, core::style::Color::Shading shading, int x, int yBase, int width)
 
void drawText (core::View *view, core::style::Style *style, core::style::Color::Shading shading, int x, int y, const char *text, int start, int len)
 
void drawWord (Line *line, int wordIndex1, int wordIndex2, core::View *view, core::Rectangle *area, int xWidget, int yWidgetBase)
 
void drawWord0 (int wordIndex1, int wordIndex2, const char *text, int totalWidth, core::style::Style *style, core::View *view, core::Rectangle *area, int xWidget, int yWidgetBase)
 
void drawSpace (int wordIndex, core::View *view, core::Rectangle *area, int xWidget, int yWidgetBase)
 
void drawLine (Line *line, core::View *view, core::Rectangle *area)
 
int findLineIndex (int y)
 
int findLineOfWord (int wordIndex)
 Find the line of word wordIndex.
 
WordfindWord (int x, int y, bool *inSpace)
 Find the index of the word, or -1.
 
WordaddWord (int width, int ascent, int descent, bool canBeHyphenated, core::style::Style *style)
 
void fillWord (Word *word, int width, int ascent, int descent, bool canBeHyphenated, core::style::Style *style)
 
void fillSpace (Word *word, core::style::Style *style)
 
void setBreakOption (Word *word, core::style::Style *style)
 
int textWidth (const char *text, int start, int len, core::style::Style *style)
 
void calcTextSize (const char *text, size_t len, core::style::Style *style, core::Requisition *size)
 
int lineXOffsetContents (Line *line)
 Returns the x offset (the indentation plus any offset needed for centering or right justification) for the line.
 
int lineXOffsetWidget (Line *line)
 Like lineXOffset, but relative to the allocation (i.e. including border etc.).
 
int lineYOffsetWidgetAllocation (Line *line, core::Allocation *allocation)
 
int lineYOffsetWidget (Line *line)
 
int lineYOffsetCanvasAllocation (Line *line, core::Allocation *allocation)
 
int lineYOffsetCanvas (Line *line)
 
int lineYOffsetWidgetI (int lineIndex)
 
int lineYOffsetCanvasI (int lineIndex)
 
bool sendSelectionEvent (core::SelectionState::EventType eventType, core::MousePositionEvent *event)
 Send event to selection.
 
void accumulateWordExtremes (int firstWord, int lastWord, int *maxOfMinWidth, int *sumOfMaxWidth)
 
virtual void wordWrap (int wordIndex, bool wrapAll)
 
int hyphenateWord (int wordIndex)
 
void accumulateWordForLine (int lineIndex, int wordIndex)
 
void accumulateWordData (int wordIndex)
 
int calcAvailWidth (int lineIndex)
 
void initLine1Offset (int wordIndex)
 
void alignLine (int lineIndex)
 
void sizeRequestImpl (core::Requisition *requisition)
 
void getExtremesImpl (core::Extremes *extremes)
 See Sizes of Dillo Widgets.
 
void sizeAllocateImpl (core::Allocation *allocation)
 See Sizes of Dillo Widgets.
 
void resizeDrawImpl ()
 Called after sizeAllocateImpl() to redraw necessary areas. By default the whole widget is redrawn.
 
void markSizeChange (int ref)
 See Sizes of Dillo Widgets.
 
void markExtremesChange (int ref)
 See Sizes of Dillo Widgets.
 
void setWidth (int width)
 
void setAscent (int ascent)
 
void setDescent (int descent)
 
void draw (core::View *view, core::Rectangle *area)
 
bool buttonPressImpl (core::EventButton *event)
 
bool buttonReleaseImpl (core::EventButton *event)
 
bool motionNotifyImpl (core::EventMotion *event)
 
void enterNotifyImpl (core::EventCrossing *event)
 
void leaveNotifyImpl (core::EventCrossing *event)
 
void removeChild (Widget *child)
 
void addText0 (const char *text, size_t len, bool canBeHyphenated, core::style::Style *style, core::Requisition *size)
 
void calcTextSizes (const char *text, size_t textLen, core::style::Style *style, int numBreaks, int *breakPos, core::Requisition *wordSize)
 
- Protected Member Functions inherited from dw::core::Widget
int getHeight ()
 
int getContentWidth ()
 
int getContentHeight ()
 
void setFlags (Flags f)
 
void unsetFlags (Flags f)
 
void queueDraw ()
 
void queueDrawArea (int x, int y, int width, int height)
 
void queueResize (int ref, bool extremesChanged)
 This method should be called, when a widget changes its size.
 
char * addAnchor (const char *name)
 
char * addAnchor (const char *name, int y)
 
void changeAnchor (char *name, int y)
 
void removeAnchor (char *name)
 
void setCursor (style::Cursor cursor)
 
bool selectionButtonPress (Iterator *it, int charPos, int linkNo, EventButton *event, bool withinContent)
 
bool selectionButtonRelease (Iterator *it, int charPos, int linkNo, EventButton *event, bool withinContent)
 
bool selectionButtonMotion (Iterator *it, int charPos, int linkNo, EventMotion *event, bool withinContent)
 
bool selectionHandleEvent (SelectionState::EventType eventType, Iterator *it, int charPos, int linkNo, MousePositionEvent *event)
 
- Protected Member Functions inherited from lout::identity::IdentifiableObject
void registerName (const char *className, int *classId)
 This method must be called in the constructor for the sub class. See class comment for details.
 

Additional Inherited Members

- Public Attributes inherited from dw::core::Widget
int parentRef
 This value is defined by the parent widget, and used for incremential resizing.
 
- Protected Types inherited from dw::Textblock
enum  { HYPHEN_BREAK = 100 }
 
- Protected Attributes inherited from dw::Textblock
bool hasListitemValue
 
int innerPadding
 
int line1Offset
 
int line1OffsetEff
 
bool ignoreLine1OffsetSometimes
 
bool mustQueueResize
 
bool limitTextWidth
 
int redrawY
 
int lastWordDrawn
 
int availWidth
 
int availAscent
 
int availDescent
 
int wrapRef
 
lout::misc::SimpleVector< Line > * lines
 
int nonTemporaryLines
 
lout::misc::NotSoSimpleVector
< Word > * 
words
 
lout::misc::SimpleVector
< Anchor > * 
anchors
 
struct {
   int   index
 
   int   nChar
 
hlStart [core::HIGHLIGHT_NUM_LAYERS]
 
struct {
   int   index
 
   int   nChar
 
hlEnd [core::HIGHLIGHT_NUM_LAYERS]
 
int hoverLink
 

Constructor & Destructor Documentation

dw::ListItem::ListItem ( ListItem ref,
bool  limitTextWidth 
)
dw::ListItem::~ListItem ( )

Member Function Documentation

int dw::ListItem::getValue ( )
protectedvirtual
void dw::ListItem::initWithText ( const char *  text,
core::style::Style style 
)
void dw::ListItem::initWithWidget ( core::Widget widget,
core::style::Style style 
)
void dw::ListItem::setMaxValue ( int  maxValue,
int  value 
)
protectedvirtual

Member Data Documentation

int dw::ListItem::CLASS_ID = -1
static

Referenced by ListItem().


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