kaddressbook
contactlistview.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef CONTACTLISTVIEW_H
00025 #define CONTACTLISTVIEW_H
00026
00027 #include <tqcolor.h>
00028 #include <tqpixmap.h>
00029 #include <tqtooltip.h>
00030 #include <tqstring.h>
00031
00032 #include <tdelistview.h>
00033
00034 #include <tdeabc/field.h>
00035
00036 class TQDropEvent;
00037 class KAddressBookTableView;
00038 class ContactListView;
00039 class KIMProxy;
00040
00044 class DynamicTip : public TQToolTip
00045 {
00046 public:
00047 DynamicTip( ContactListView * parent );
00048
00049 protected:
00050 void maybeTip( const TQPoint & );
00051
00052 private:
00053 };
00054
00055 class ContactListViewItem : public TDEListViewItem
00056 {
00057
00058 public:
00059 ContactListViewItem(const TDEABC::Addressee &a, ContactListView* parent,
00060 TDEABC::AddressBook *doc, const TDEABC::Field::List &fields, KIMProxy *proxy );
00061 const TDEABC::Addressee &addressee() const { return mAddressee; }
00062 virtual void refresh();
00063 virtual ContactListView* parent();
00064 virtual TQString key ( int, bool ) const;
00065 void setHasIM( bool hasIM );
00069 virtual void paintCell(TQPainter * p, const TQColorGroup & cg,
00070 int column, int width, int align );
00071
00072 private:
00073 TDEABC::Addressee mAddressee;
00074 TDEABC::Field::List mFields;
00075 ContactListView *parentListView;
00076 TDEABC::AddressBook *mDocument;
00077 KIMProxy *mIMProxy;
00078 bool mHasIM;
00079 };
00080
00081
00083
00084
00085 class ContactListView : public TDEListView
00086 {
00087 Q_OBJECT
00088
00089
00090 public:
00091 ContactListView(KAddressBookTableView *view,
00092 TDEABC::AddressBook *doc,
00093 TQWidget *parent,
00094 const char *name = 0L );
00095 virtual ~ContactListView() {}
00096
00097
00100 bool tooltips() const { return mToolTips; }
00101 void setToolTipsEnabled(bool enabled) { mToolTips = enabled; }
00102
00103 bool alternateBackground() const { return mABackground; }
00104 void setAlternateBackgroundEnabled(bool enabled);
00105
00106 bool singleLine() const { return mSingleLine; }
00107 void setSingleLineEnabled(bool enabled) { mSingleLine = enabled; }
00108
00109 const TQColor &alternateColor() const { return mAlternateColor; }
00110
00115 void setBackgroundPixmap(const TQString &filename);
00116
00120 void setShowIM( bool enabled );
00121
00125 bool showIM();
00126
00133 void setIMColumn( int column );
00134
00138 int imColumn();
00139
00140 protected:
00144 virtual void paintEmptyArea( TQPainter * p, const TQRect & rect );
00145 virtual void contentsMousePressEvent(TQMouseEvent*);
00146 void contentsMouseMoveEvent( TQMouseEvent *e );
00147 void contentsDropEvent( TQDropEvent *e );
00148 virtual bool acceptDrag(TQDropEvent *e) const;
00149
00150 protected slots:
00151 void itemDropped(TQDropEvent *e);
00152
00153 public slots:
00154
00155 signals:
00156 void startAddresseeDrag();
00157 void addresseeDropped(TQDropEvent *);
00158
00159 private:
00160 KAddressBookTableView *pabWidget;
00161 int oldColumn;
00162 int column;
00163 bool ascending;
00164
00165 bool mABackground;
00166 bool mSingleLine;
00167 bool mToolTips;
00168 bool mShowIM;
00169
00170 TQColor mAlternateColor;
00171
00172 TQPoint presspos;
00173 int mInstantMsgColumn;
00174 };
00175
00176
00177 #endif
|