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

kaddressbook

contactlistview.h

Go to the documentation of this file.
00001 /*
00002     This file is part of KAddressBook.
00003     Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018 
00019     As a special exception, permission is given to link this program
00020     with any edition of Qt, and distribute the resulting executable,
00021     without including the source code for Qt in the source distribution.
00022 */
00023 
00024 #ifndef CONTACTLISTVIEW_H
00025 #define CONTACTLISTVIEW_H
00026 
00027 #include <QtCore/QString>
00028 #include <QtGui/QColor>
00029 
00030 #include <k3listview.h>
00031 #include <kabc/field.h>
00032 
00033 class QDropEvent;
00034 class QMouseEvent;
00035 
00036 class KAddressBookTableView;
00037 class ContactListView;
00038 class KIMProxy;
00039 
00043 #if 0
00044 class DynamicTip : public QToolTip
00045 {
00046   public:
00047     DynamicTip( ContactListView * parent );
00048 
00049   protected:
00050     void maybeTip( const QPoint & );
00051 
00052   private:
00053 };
00054 #endif
00055 
00056 class ContactListViewItem : public K3ListViewItem
00057 {
00058 
00059 public:
00060   ContactListViewItem(const KABC::Addressee &a, ContactListView* parent,
00061                       KABC::AddressBook *doc, const KABC::Field::List &fields, KIMProxy *proxy );
00062   const KABC::Addressee &addressee() const { return mAddressee; }
00063   virtual void refresh();
00064   virtual ContactListView* parent();
00065   virtual QString key ( int, bool ) const;
00066   void setHasIM( bool hasIM );
00070   virtual void paintCell(QPainter * p, const QColorGroup & cg,
00071                          int column, int width, int align );
00072 
00073 private:
00074   KABC::Addressee mAddressee;
00075   KABC::Field::List mFields;
00076   ContactListView *parentListView;
00077   KABC::AddressBook *mDocument;
00078   KIMProxy *mIMProxy;
00079   bool mHasIM;
00080 };
00081 
00082 
00084 // ContactListView
00085 
00086 class ContactListView : public K3ListView
00087 {
00088   Q_OBJECT
00089 
00090 public:
00091   ContactListView(KAddressBookTableView *view,
00092                   KABC::AddressBook *doc,
00093                   QWidget *parent,
00094                   const char *name = 0L );
00095   virtual ~ContactListView() {}
00096   //void resort();
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 QColor &alternateColor() const { return mAlternateColor; }
00110 
00115   void setBackgroundPixmap(const QString &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( QPainter * p, const QRect & rect );
00145   virtual void contentsMousePressEvent(QMouseEvent*);
00146   void contentsMouseMoveEvent( QMouseEvent *e );
00147   void contentsDropEvent( QDropEvent *e );
00148   virtual bool acceptDrag(QDropEvent *e) const;
00149 
00150 protected Q_SLOTS:
00151   void itemDropped(QDropEvent *e);
00152 
00153 Q_SIGNALS:
00154   void startAddresseeDrag();
00155   void addresseeDropped(QDropEvent *);
00156 
00157 private:
00158   KAddressBookTableView *pabWidget;
00159   int oldColumn;
00160   int column;
00161   bool ascending;
00162 
00163   bool mABackground;
00164   bool mSingleLine;
00165   bool mToolTips;
00166   bool mShowIM;
00167 
00168   QColor mAlternateColor;
00169 
00170   QPoint presspos;
00171   int mInstantMsgColumn;
00172 };
00173 
00174 
00175 #endif

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