29 #include <tqptrlist.h> 31 #include <tqscrollview.h> 40 class CardViewItemPrivate;
41 class CardViewPrivate;
58 typedef TQPair<TQString, TQString>
Field;
74 const TQString &
caption()
const;
87 virtual void paintCard( TQPainter *p, TQColorGroup &cg );
102 void insertField(
const TQString &label,
const TQString &value );
112 TQString
fieldValue(
const TQString &label )
const;
143 Field *
fieldAt(
const TQPoint &itempos )
const;
145 CardView *cardView()
const {
return mView; };
155 int height(
bool allowCache =
true )
const;
176 TQString trimString(
const TQString &text,
int width, TQFontMetrics &fm )
const;
178 CardViewItemPrivate *d;
205 CardView( TQWidget *parent,
const char *name );
260 enum SelectionMode { Single, Multi, Extended, NoSelection };
267 void setSelectionMode( SelectionMode mode );
272 SelectionMode selectionMode()
const;
283 void selectAll(
bool state );
313 int childCount()
const;
324 CardViewItem *findItem(
const TQString &text,
const TQString &label,
325 TQt::StringComparisonMode compare = TQt::BeginsWith )
const;
334 uint columnWidth()
const;
341 void setDrawCardBorder(
bool enabled );
346 bool drawCardBorder()
const;
354 void setDrawColSeparators(
bool enabled );
359 bool drawColSeparators()
const;
367 void setDrawFieldLabels(
bool enabled );
372 bool drawFieldLabels()
const;
378 void setShowEmptyFields(
bool show );
383 bool showEmptyFields()
const;
396 uint itemMargin()
const;
401 void setItemMargin( uint margin );
411 uint itemSpacing()
const;
417 void setItemSpacing( uint spacing );
422 int itemWidth()
const;
427 void setItemWidth(
int width );
432 void setHeaderFont(
const TQFont &fnt );
437 TQFont headerFont()
const;
442 void setFont(
const TQFont &fnt );
447 void setSeparatorWidth(
int width );
452 int separatorWidth()
const;
458 void setMaxFieldLines(
int howmany );
463 int maxFieldLines()
const;
470 void selectionChanged();
509 void contextMenuRequested(
CardViewItem*,
const TQPoint& );
516 void drawContents( TQPainter *p,
int clipx,
int clipy,
int clipw,
int cliph );
521 void resizeEvent( TQResizeEvent* );
526 void contentsWheelEvent( TQWheelEvent* );
531 void setLayoutDirty(
bool dirty );
540 virtual void contentsMousePressEvent( TQMouseEvent* );
541 virtual void contentsMouseMoveEvent( TQMouseEvent* );
542 virtual void contentsMouseReleaseEvent( TQMouseEvent* );
543 virtual void contentsMouseDoubleClickEvent( TQMouseEvent* );
545 virtual void enterEvent( TQEvent* );
546 virtual void leaveEvent( TQEvent* );
548 virtual void focusInEvent( TQFocusEvent* );
549 virtual void focusOutEvent( TQFocusEvent* );
551 virtual void keyPressEvent( TQKeyEvent* );
558 virtual void startDrag();
566 void tryShowFullText();
575 void drawRubberBands(
int pos );
virtual void paintCard(TQPainter *p, TQColorGroup &cg)
Paints the card using the given painter and color group.
TQPair< TQString, TQString > Field
A single field in the card view.
void setCaption(const TQString &caption)
Sets the caption of the card.
void removeField(const TQString &label)
Removes the field with label label from the card.
int height(bool allowCache=true) const
Field * fieldAt(const TQPoint &itempos) const
void insertField(const TQString &label, const TQString &value)
Adds a field to the card.
CardViewItem(CardView *parent, const TQString &caption=TQString())
Constructor.
void setSelected(bool selected)
Sets the card as selected.
virtual void repaintCard()
Repaints the card.
TQString fieldValue(const TQString &label) const
Represents a single card (item) in the card view.
The CardView is a method of displaying data in cards.
void showFullString(const TQPoint &pos, CardViewTip *tip)
Called by the parent card view when the mouse has been resting for a certain amount of time...
void clearFields()
Removes all the fields from this card.
const TQString & caption() const
CardViewItem * nextItem() const