24 #ifndef CONTACTLISTVIEW_H
25 #define CONTACTLISTVIEW_H
29 #include <tqtooltip.h>
32 #include <klistview.h>
34 #include <kabc/field.h>
38 class ContactListView;
50 void maybeTip( const TQPoint & );
55 class ContactListViewItem : public KListViewItem
59 ContactListViewItem( const KABC::Addressee &a, ContactListView* parent,
60 KABC::AddressBook *doc, const KABC::Field::List &fields, KIMProxy *proxy );
61 const KABC::Addressee &addressee() const { return mAddressee; }
62 virtual void refresh();
63 virtual ContactListView* parent();
64 virtual TQString key ( int, bool ) const;
65 void setHasIM( bool hasIM );
69 virtual void paintCell(TQPainter * p, const TQColorGroup & cg,
70 int column, int width, int align );
73 KABC::Addressee mAddressee;
74 KABC::Field::List mFields;
75 ContactListView *parentListView;
76 KABC::AddressBook *mDocument;
85 class ContactListView : public KListView
92 KABC::AddressBook *doc,
94 const char *name = 0L );
95 virtual ~ContactListView() {}
100 bool tooltips() const { return mToolTips; }
101 void setToolTipsEnabled( bool enabled) { mToolTips = enabled; }
103 bool alternateBackground() const { return mABackground; }
104 void setAlternateBackgroundEnabled( bool enabled);
106 bool singleLine() const { return mSingleLine; }
107 void setSingleLineEnabled( bool enabled) { mSingleLine = enabled; }
109 const TQColor &alternateColor() const { return mAlternateColor; }
115 void setBackgroundPixmap( const TQString &filename);
120 void setShowIM( bool enabled );
133 void setIMColumn( int column );
144 virtual void paintEmptyArea( TQPainter * p, const TQRect & rect );
145 virtual void contentsMousePressEvent(TQMouseEvent*);
146 void contentsMouseMoveEvent( TQMouseEvent *e );
147 void contentsDropEvent( TQDropEvent *e );
148 virtual bool acceptDrag(TQDropEvent *e) const;
151 void itemDropped(TQDropEvent *e);
156 void startAddresseeDrag();
157 void addresseeDropped(TQDropEvent *);
170 TQColor mAlternateColor;
173 int mInstantMsgColumn;
|