kopete/libkopete
Kopete::UI::ListView::Component Class Reference
#include <kopetelistviewitem.h>

Detailed Description
This class represents a rectangular subsection of a ListItem.
Definition at line 103 of file kopetelistviewitem.h.
Public Types | |
| enum | RttiValues { Rtti_Component, Rtti_BoxComponent, Rtti_TextComponent, Rtti_ImageComponent, Rtti_DisplayNameComponent, Rtti_HSpacerComponent, Rtti_VSpacerComponent } |
Public Member Functions | |
| virtual int | heightForWidth (int width) |
| void | hide () |
| bool | isHidden () |
| bool | isShown () |
| virtual void | layout (const QRect &rect) |
| int | minHeight () |
| int | minWidth () |
| virtual void | paint (QPainter *painter, const QPalette &pal) |
| QRect | rect () |
| void | relayout () |
| void | repaint () |
| virtual int | rtti () const |
| void | setToolTipSource (ToolTipSource *source=0) |
| void | show () |
| std::pair< QString, QRect > | toolTip (const QPoint &relativePos) |
| virtual int | widthForHeight (int height) |
| virtual | ~Component ()=0 |
Static Public Attributes | |
| static int | RTTI = Rtti_Component |
Protected Member Functions | |
| Component (ComponentBase *parent) | |
| void | componentAdded (Component *component) |
| void | componentRemoved (Component *component) |
| bool | setMinHeight (int height) |
| bool | setMinWidth (int width) |
Friends | |
| void | ComponentBase::updateAnimationPosition (int p, int s) |
Member Enumeration Documentation
RTTI: Runtime Type Information Exactly the same as Qt's approach to identify types of QCanvasItems.
- Enumerator:
-
Rtti_Component Rtti_BoxComponent Rtti_TextComponent Rtti_ImageComponent Rtti_DisplayNameComponent Rtti_HSpacerComponent Rtti_VSpacerComponent
Definition at line 189 of file kopetelistviewitem.h.
Constructor & Destructor Documentation
| Kopete::UI::ListView::Component::Component | ( | ComponentBase * | parent | ) | [protected] |
Definition at line 157 of file kopetelistviewitem.cpp.
| Kopete::UI::ListView::Component::~Component | ( | ) | [pure virtual] |
Definition at line 166 of file kopetelistviewitem.cpp.
Member Function Documentation
| void Kopete::UI::ListView::Component::componentAdded | ( | Component * | component | ) | [protected, virtual] |
A child item has been added to this item.
Reimplemented from Kopete::UI::ListView::ComponentBase.
Reimplemented in Kopete::UI::ListView::BoxComponent.
Definition at line 270 of file kopetelistviewitem.cpp.
| void Kopete::UI::ListView::Component::componentRemoved | ( | Component * | component | ) | [protected, virtual] |
A child item has been removed from this item.
Reimplemented from Kopete::UI::ListView::ComponentBase.
Reimplemented in Kopete::UI::ListView::BoxComponent.
Definition at line 276 of file kopetelistviewitem.cpp.
| int Kopete::UI::ListView::Component::heightForWidth | ( | int | width | ) | [virtual] |
Returns the height this component desires for a given width.
By default this function returns minHeight().
Reimplemented in Kopete::UI::ListView::BoxComponent, and Kopete::UI::ListView::VSpacerComponent.
Definition at line 215 of file kopetelistviewitem.cpp.
| void Kopete::UI::ListView::Component::hide | ( | ) |
| bool Kopete::UI::ListView::Component::isHidden | ( | ) |
Definition at line 188 of file kopetelistviewitem.cpp.
| bool Kopete::UI::ListView::Component::isShown | ( | ) |
Definition at line 183 of file kopetelistviewitem.cpp.
| void Kopete::UI::ListView::Component::layout | ( | const QRect & | rect | ) | [virtual] |
Set the size and position of this item relative to the list view item.
Should only be called by the containing item.
- Parameters:
-
rect the new rectangle this component will paint in, relative to the painter passed to the paint() function by the parent item.
Reimplemented in Kopete::UI::ListView::BoxComponent, and Kopete::UI::ListView::DisplayNameComponent.
Definition at line 234 of file kopetelistviewitem.cpp.
| int Kopete::UI::ListView::Component::minHeight | ( | ) |
Returns the smallest this component can become vertically while still being useful.
Definition at line 213 of file kopetelistviewitem.cpp.
| int Kopete::UI::ListView::Component::minWidth | ( | ) |
Returns the smallest this component can become horizontally while still being useful.
Definition at line 212 of file kopetelistviewitem.cpp.
Paint this item, inside the rectangle returned by rect().
The default implementation calls paint on all children.
Reimplemented in Kopete::UI::ListView::TextComponent, and Kopete::UI::ListView::ImageComponent.
Definition at line 249 of file kopetelistviewitem.cpp.
| QRect Kopete::UI::ListView::Component::rect | ( | ) |
- Returns:
- the rect this component was allocated last time it was laid out
Definition at line 208 of file kopetelistviewitem.cpp.
| void Kopete::UI::ListView::Component::relayout | ( | ) | [virtual] |
Relayout this item.
Implements Kopete::UI::ListView::ComponentBase.
Definition at line 265 of file kopetelistviewitem.cpp.
| void Kopete::UI::ListView::Component::repaint | ( | ) | [virtual] |
Repaint this item.
Implements Kopete::UI::ListView::ComponentBase.
Definition at line 260 of file kopetelistviewitem.cpp.
| virtual int Kopete::UI::ListView::Component::rtti | ( | ) | const [inline, virtual] |
Reimplemented in Kopete::UI::ListView::BoxComponent, Kopete::UI::ListView::TextComponent, Kopete::UI::ListView::ImageComponent, Kopete::UI::ListView::DisplayNameComponent, Kopete::UI::ListView::HSpacerComponent, and Kopete::UI::ListView::VSpacerComponent.
Definition at line 196 of file kopetelistviewitem.h.
| bool Kopete::UI::ListView::Component::setMinHeight | ( | int | height | ) | [protected] |
Change the minimum height, in pixels, this component requires in order to be at all useful.
Note: do not call this from your layout() function.
- Parameters:
-
height the minimum height
- Returns:
- true if the size has actually changed, false if it's been set to the existing values. If it returns true, you do not need to relayout, since the parent component will do that for you.
Definition at line 225 of file kopetelistviewitem.cpp.
| bool Kopete::UI::ListView::Component::setMinWidth | ( | int | width | ) | [protected] |
Change the minimum width, in pixels, this component requires in order to be at all useful.
Note: do not call this from your layout() function.
- Parameters:
-
width the minimum width
- Returns:
- true if the size has actually changed, false if it's been set to the existing values. if it returns true, you do not need to relayout, since the parent component will do that for you.
Definition at line 217 of file kopetelistviewitem.cpp.
| void Kopete::UI::ListView::Component::setToolTipSource | ( | ToolTipSource * | source = 0 |
) |
Set a tool tip source for this item.
The tool tip source object is still owned by the caller, and must live for at least as long as this component.
Definition at line 193 of file kopetelistviewitem.cpp.
| void Kopete::UI::ListView::Component::show | ( | ) |
| std::pair< QString, QRect > Kopete::UI::ListView::Component::toolTip | ( | const QPoint & | relativePos | ) | [virtual] |
Get the tool tip string and rectangle for a tip request at position relativePos relative to this item.
If a tooltip source is set, it will be used. Otherwise calls the base class.
- Returns:
- a pair where the first element is the tooltip, and the second is the rectangle within the item for which the tip should be displayed.
Reimplemented from Kopete::UI::ListView::ComponentBase.
Reimplemented in Kopete::UI::ListView::ContactComponent.
Definition at line 198 of file kopetelistviewitem.cpp.
| int Kopete::UI::ListView::Component::widthForHeight | ( | int | height | ) | [virtual] |
Returns the width this component desires for a given height.
By default this function returns minWidth().
Reimplemented in Kopete::UI::ListView::BoxComponent, Kopete::UI::ListView::TextComponent, and Kopete::UI::ListView::HSpacerComponent.
Definition at line 214 of file kopetelistviewitem.cpp.
Friends And Related Function Documentation
| void ComponentBase::updateAnimationPosition | ( | int | p, | |
| int | s | |||
| ) | [friend] |
Member Data Documentation
int Kopete::UI::ListView::Component::RTTI = Rtti_Component [static] |
Reimplemented in Kopete::UI::ListView::BoxComponent, Kopete::UI::ListView::TextComponent, Kopete::UI::ListView::ImageComponent, Kopete::UI::ListView::DisplayNameComponent, Kopete::UI::ListView::HSpacerComponent, and Kopete::UI::ListView::VSpacerComponent.
Definition at line 195 of file kopetelistviewitem.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference