• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/libkopete

  • Kopete
  • UI
  • ListView
  • Component
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
Kopete::UI::ListView::Component Class Referenceabstract

#include <kopetelistviewitem.h>

Inheritance diagram for Kopete::UI::ListView::Component:
Inheritance graph
[legend]

Public Types

enum  RttiValues {
  Rtti_Component, Rtti_BoxComponent, Rtti_TextComponent, Rtti_ImageComponent,
  Rtti_DisplayNameComponent, Rtti_HSpacerComponent, Rtti_VSpacerComponent
}
 

Public Member Functions

virtual ~Component ()=0
 
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)
 
- Public Member Functions inherited from Kopete::UI::ListView::ComponentBase
 ComponentBase ()
 
virtual ~ComponentBase ()=0
 
Component * component (uint n)
 
Component * componentAt (const QPoint &pt)
 
uint components ()
 

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)
 
- Protected Member Functions inherited from Kopete::UI::ListView::ComponentBase
virtual void clear ()
 
virtual void componentResized (Component *component)
 
void updateAnimationPosition (int p, int s)
 

Friends

void ComponentBase::updateAnimationPosition (int p, int s)
 

Detailed Description

This class represents a rectangular subsection of a ListItem.

Author
Richard Smith kde@m.nosp@m.etaf.nosp@m.oo.co.nosp@m..uk

Definition at line 103 of file kopetelistviewitem.h.

Member Enumeration Documentation

enum Kopete::UI::ListView::Component::RttiValues

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 155 of file kopetelistviewitem.cpp.

Kopete::UI::ListView::Component::~Component ( )
pure virtual

Definition at line 164 of file kopetelistviewitem.cpp.

Member Function Documentation

void Kopete::UI::ListView::Component::componentAdded ( Component *  component)
protectedvirtual

A child item has been added to this item.

Reimplemented from Kopete::UI::ListView::ComponentBase.

Reimplemented in Kopete::UI::ListView::BoxComponent.

Definition at line 268 of file kopetelistviewitem.cpp.

void Kopete::UI::ListView::Component::componentRemoved ( Component *  component)
protectedvirtual

A child item has been removed from this item.

Reimplemented from Kopete::UI::ListView::ComponentBase.

Reimplemented in Kopete::UI::ListView::BoxComponent.

Definition at line 274 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::VSpacerComponent, and Kopete::UI::ListView::BoxComponent.

Definition at line 213 of file kopetelistviewitem.cpp.

void Kopete::UI::ListView::Component::hide ( )

Prevents this component to be drawn.

Definition at line 171 of file kopetelistviewitem.cpp.

bool Kopete::UI::ListView::Component::isHidden ( )

Definition at line 186 of file kopetelistviewitem.cpp.

bool Kopete::UI::ListView::Component::isShown ( )

Definition at line 181 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
rectthe 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::DisplayNameComponent, and Kopete::UI::ListView::BoxComponent.

Definition at line 232 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 211 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 210 of file kopetelistviewitem.cpp.

void Kopete::UI::ListView::Component::paint ( QPainter *  painter,
const QPalette &  pal 
)
virtual

Paint this item, inside the rectangle returned by rect().

The default implementation calls paint on all children.

Reimplemented in Kopete::UI::ListView::ImageComponent, and Kopete::UI::ListView::TextComponent.

Definition at line 247 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 206 of file kopetelistviewitem.cpp.

void Kopete::UI::ListView::Component::relayout ( )
virtual

Relayout this item.

Implements Kopete::UI::ListView::ComponentBase.

Definition at line 263 of file kopetelistviewitem.cpp.

void Kopete::UI::ListView::Component::repaint ( )
virtual

Repaint this item.

Implements Kopete::UI::ListView::ComponentBase.

Definition at line 258 of file kopetelistviewitem.cpp.

virtual int Kopete::UI::ListView::Component::rtti ( ) const
inlinevirtual

Reimplemented in Kopete::UI::ListView::VSpacerComponent, Kopete::UI::ListView::HSpacerComponent, Kopete::UI::ListView::DisplayNameComponent, Kopete::UI::ListView::ImageComponent, Kopete::UI::ListView::TextComponent, and Kopete::UI::ListView::BoxComponent.

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
heightthe 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 223 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
widththe 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 215 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 191 of file kopetelistviewitem.cpp.

void Kopete::UI::ListView::Component::show ( )

Makes this component to be drawn.

Definition at line 176 of file kopetelistviewitem.cpp.

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 196 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::HSpacerComponent, Kopete::UI::ListView::TextComponent, and Kopete::UI::ListView::BoxComponent.

Definition at line 212 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

Definition at line 195 of file kopetelistviewitem.h.


The documentation for this class was generated from the following files:
  • kopetelistviewitem.h
  • kopetelistviewitem.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal