look_details.h
00001 /* -*- C++ -*- 00002 This file implements the detailed look. 00003 00004 the KDE addressbook 00005 00006 $ Author: Mirko Boehm $ 00007 $ Copyright: (C) 1996-2001, Mirko Boehm $ 00008 $ Contact: mirko@kde.org 00009 http://www.kde.org $ 00010 $ License: GPL with the following explicit clarification: 00011 This code may be linked against any version of the Qt toolkit 00012 from Troll Tech, Norway. $ 00013 00014 $Revision: 1.1 $ 00015 */ 00016 00017 #ifndef LOOK_DETAILS_H 00018 #define LOOK_DETAILS_H 00019 00020 #include <kaction.h> 00021 // the common interface for looks: 00022 #include "look_basic.h" 00023 #include <qpixmap.h> 00024 #include <qptrlist.h> 00025 #include <qrect.h> 00026 #include <qmap.h> 00027 #include <klocale.h> 00028 #include <kabc/addressbook.h> 00029 00030 class QComboBox; 00031 class KABEntryPainter; 00032 00037 class KABDetailedView : public KABBasicLook 00038 { 00039 Q_OBJECT 00040 public: 00042 enum BackgroundStyle { 00045 None, 00047 Tiled, 00051 Bordered 00052 }; 00054 KABDetailedView(QWidget* parent=0, const char* name=0); 00056 virtual ~KABDetailedView(); 00059 void setEntry(const KABC::Addressee&); 00061 void setReadonly(bool); 00063 void configure(KConfig* config); 00064 protected: 00066 void paintEvent(QPaintEvent *); 00068 void mousePressEvent(QMouseEvent*); 00070 void mouseMoveEvent(QMouseEvent*); 00072 QPtrList<QRect> locURLs; 00074 QPtrList<QRect> locEmails; 00076 QPtrList<QRect> locPhones; 00078 KABEntryPainter *epainter; 00084 bool getBackground(QString path, QPixmap& image); 00086 QMap<QString, QPixmap> backgrounds; 00088 QPixmap background; 00090 BackgroundStyle bgStyle; 00092 bool useDefaultBGImage; 00094 QColor defaultBGColor; 00096 bool useHeadlineBGColor; 00098 QColor headlineBGColor; 00100 QColor headlineTextColor; 00102 QPixmap defaultBGImage; 00104 KToggleAction *actionShowAddresses; 00106 KToggleAction *actionShowEmails; 00108 KToggleAction *actionShowTelephones; 00110 KToggleAction *actionShowURLs; 00112 const int Grid; 00114 QStringList borders; 00116 QStringList tiles; 00119 QPopupMenu *menuBorderedBG; 00122 QPopupMenu *menuTiledBG; 00123 public slots: 00124 void slotBorderedBGSelected(int index); 00125 void slotTiledBGSelected(int index); 00126 protected: // statics: 00127 static const QString BorderedBGDir; 00128 static const QString TiledBGDir; 00129 }; 00130 00131 class KABDetailedViewFactory : public KABLookFactory 00132 { 00133 public: 00134 KABDetailedViewFactory(QWidget* parent=0, const char* name=0) 00135 : KABLookFactory(parent, name) {} 00136 KABBasicLook *create() 00137 { return new KABDetailedView(parent, name); } 00138 QString description() 00139 { return i18n("Detailed Style: Display all details, no modifications."); } 00140 }; 00141 00142 #endif // LOOK_DETAILS_H