• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kaddressbook

CardViewItem Class Reference

#include <cardview.h>

Inherited by AddresseeCardViewItem.

List of all members.


Detailed Description

Represents a single card (item) in the card view.

A card has a caption and a list of fields. A Field is a label<->value pair. The labels in a card should be unique, since they will be used to index the values.

Definition at line 54 of file cardview.h.


Public Types

typedef QPair< QString, QString > Field

Public Member Functions

const QString & caption () const
CardView * cardView () const
 CardViewItem (CardView *parent, const QString &caption=QString())
void clearFields ()
Field * fieldAt (const QPoint &itempos) const
QString fieldValue (const QString &label) const
int height (bool allowCache=true) const
void insertField (const QString &label, const QString &value)
bool isSelected () const
CardViewItem * nextItem () const
virtual void paintCard (QPainter *p, const QPalette &pal)
void removeField (const QString &label)
virtual void repaintCard ()
void setCaption (const QString &caption)
void showFullString (const QPoint &pos, CardViewTip *tip)
virtual ~CardViewItem ()

Protected Member Functions

void setSelected (bool selected)

Member Typedef Documentation

typedef QPair<QString, QString> CardViewItem::Field

A single field in the card view.

The first item is the label and the second item is the value.

Definition at line 63 of file cardview.h.


Constructor & Destructor Documentation

CardViewItem::CardViewItem ( CardView *  parent,
const QString &  caption = QString() 
) [explicit]

Constructor.

Parameters:
parent The CardView that this card should be displayed on.
caption The caption of the card. This is the text that will appear at the top of the card. This is also the string that will be used to sort the cards in the view.

Definition at line 203 of file cardview.cpp.

CardViewItem::~CardViewItem (  )  [virtual]

Definition at line 211 of file cardview.cpp.


Member Function Documentation

const QString & CardViewItem::caption (  )  const

Returns:
The caption of the card, or QString() if none was ever set.

Definition at line 338 of file cardview.cpp.

CardView* CardViewItem::cardView (  )  const [inline]

Definition at line 150 of file cardview.h.

void CardViewItem::clearFields (  ) 

Removes all the fields from this card.

Definition at line 421 of file cardview.cpp.

CardViewItem::Field * CardViewItem::fieldAt ( const QPoint &  itempos  )  const

Returns:
a pointer to the Field at the position itempos in this item.

0 is returned if itempos is in the caption.

Parameters:
itempos the position in item coordinates

Definition at line 561 of file cardview.cpp.

QString CardViewItem::fieldValue ( const QString &  label  )  const

Returns:
The value of the field with label label.

Definition at line 475 of file cardview.cpp.

int CardViewItem::height ( bool  allowCache = true  )  const

Returns:
The height of this item as rendered, in pixels.

if allowCache is true, the item may use an internally cached value rather than recalculating from scratch. The argument is mainly to allow the cardView to change global settings (like maxFieldLines) that might influence the items heights

Definition at line 344 of file cardview.cpp.

void CardViewItem::insertField ( const QString &  label,
const QString &  value 
)

Adds a field to the card.

Parameters:
label The label of the field. The field labels must be unique within a card.
value The value of the field.

Definition at line 390 of file cardview.cpp.

bool CardViewItem::isSelected (  )  const

Returns:
True if this card is currently selected, false otherwise.

Definition at line 380 of file cardview.cpp.

CardViewItem * CardViewItem::nextItem (  )  const

Returns:
The next card item.

The order of the items will be the same as the display order in the view. 0 will be returned if this is the last card.

Definition at line 453 of file cardview.cpp.

void CardViewItem::paintCard ( QPainter *  p,
const QPalette &  pal 
) [virtual]

Paints the card using the given painter and palette.

The card will handle painting itself selected if it is selected.

Definition at line 233 of file cardview.cpp.

void CardViewItem::removeField ( const QString &  label  ) 

Removes the field with label label from the card.

Definition at line 402 of file cardview.cpp.

void CardViewItem::repaintCard (  )  [virtual]

Repaints the card.

This is done by sending a repaint event to the view with the clip rect defined as this card.

Definition at line 463 of file cardview.cpp.

void CardViewItem::setCaption ( const QString &  caption  ) 

Sets the caption of the card.

This is the text that will appear at the top of the card. This is also the string that will be used to sort the cards in the view.

Definition at line 469 of file cardview.cpp.

void CardViewItem::setSelected ( bool  selected  )  [protected]

Sets the card as selected.

This is usually only called from the card view.

Definition at line 385 of file cardview.cpp.

void CardViewItem::showFullString ( const QPoint &  pos,
CardViewTip *  tip 
)

Called by the parent card view when the mouse has been resting for a certain amount of time.

If the label or value at pos is obscured (trimmed) make the label display the full text.

Definition at line 486 of file cardview.cpp.


The documentation for this class was generated from the following files:
  • cardview.h
  • cardview.cpp

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal