ListItem Class Reference

Base class for list items. More...

#include <listitem.h>

Inheritance diagram for ListItem:
Inheritance graph
[legend]

List of all members.

Public Types

enum  TextSize { TEXT_SIZE_NORMAL, TEXT_SIZE_SMALL }
 

Defines text size.


Public Member Functions

 ListItem ()
 Constructor.
void setImage (const QPixmap &image)
 Sets item's image.
void setTitle (const QString &name)
 Sets item's title.
virtual void setSelected (bool selected)=0
 Sets item selected.
void setSize (const QSize &size)
 Sets item size.
QString shortenText (const QString &text, int textWidth, TextSize textSize)
 Shortens text defined by text width.
QString title () const
 Returns item's title.
virtual bool toggleSelection ()=0
 Toggles selection.

Private Attributes

QPixmap m_image
 Item's image.
QString m_name
 Item's name.

Detailed Description

Base class for list items.

Stores item's name and image and includes method to shorten texts.

Author:
Jussi Laitinen - jussi.laitinen (at) ixonos.com

Member Function Documentation

void ListItem::setImage ( const QPixmap &  image  ) 

Sets item's image.

Parameters:
image QPixmap
virtual void ListItem::setSelected ( bool  selected  )  [pure virtual]

Sets item selected.

Parameters:
selected true if selected, false otherwise

Implemented in ExtendedListItem.

void ListItem::setSize ( const QSize &  size  ) 

Sets item size.

Parameters:
size item size
void ListItem::setTitle ( const QString &  name  ) 

Sets item's title.

Parameters:
name item's title
QString ListItem::shortenText ( const QString &  text,
int  textWidth,
TextSize  textSize 
)

Shortens text defined by text width.

Parameters:
text text to be shortened
textWidth the width the text can use
textSize which text size to use
Returns:
shortened text
QString ListItem::title (  )  const

Returns item's title.

Returns:
item's title
virtual bool ListItem::toggleSelection (  )  [pure virtual]

Toggles selection.

Returns:
true if selection was toggled, false otherwise

Implemented in ExtendedListItem.


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

Generated on Fri Sep 3 12:05:41 2010 for Situare client for Maemo by  doxygen 1.6.1