00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#ifndef LOOK_DETAILS_H
00025
#define LOOK_DETAILS_H
00026
00027
#include <kabc/addressbook.h>
00028
#include <kaction.h>
00029
#include <klocale.h>
00030
00031
#include <qmap.h>
00032
#include <qpixmap.h>
00033
#include <qptrlist.h>
00034
#include <qrect.h>
00035
00036
#include "look_basic.h"
00037
00038
class KABEntryPainter;
00039
class QComboBox;
00040
00047 class KABDetailedView :
public KABBasicLook
00048 {
00049 Q_OBJECT
00050
00051
public:
00055 enum BackgroundStyle
00056 {
00057 None,
00058 Tiled,
00059 Bordered
00060 };
00061
00065
KABDetailedView( QWidget *parent = 0,
const char* name = 0 );
00066
00070
virtual ~KABDetailedView();
00071
00075
void setAddressee(
const KABC::Addressee& );
00076
00080
void setReadOnly(
bool );
00081
00085
void restoreSettings( KConfig* );
00086
00087
public slots:
00088
void slotBorderedBGSelected(
int index );
00089
void slotTiledBGSelected(
int index );
00090
00091
protected:
00092
void paintEvent( QPaintEvent* );
00093
void mousePressEvent( QMouseEvent* );
00094
void mouseMoveEvent( QMouseEvent* );
00095
00102
bool getBackground( QString path, QPixmap& image );
00103
00104
private:
00105 QPtrList<QRect> mURLRects;
00106 QPtrList<QRect> mEmailRects;
00107 QPtrList<QRect> mPhoneRects;
00108 KABEntryPainter *mPainter;
00109
00110 QMap<QString, QPixmap> mBackgroundMap;
00111 QPixmap mCurrentBackground;
00112
00113 BackgroundStyle mBackgroundStyle;
00114
00115
bool mUseDefaultBGImage;
00116
bool mUseHeadLineBGColor;
00117
00118 QColor mDefaultBGColor;
00119 QColor mHeadLineBGColor;
00120 QColor mHeadLineTextColor;
00121
00122 QPixmap mDefaultBGImage;
00123
00124 KToggleAction *mActionShowAddresses;
00125 KToggleAction *mActionShowEmails;
00126 KToggleAction *mActionShowPhones;
00127 KToggleAction *mActionShowURLs;
00128
00129
const int mGrid;
00130 QStringList mBorders;
00131 QStringList mTiles;
00132
00133 QPopupMenu *mMenuBorderedBG;
00134 QPopupMenu *mMenuTiledBG;
00135
00136
static const QString mBorderedBGDir;
00137
static const QString mTiledBGDir;
00138 };
00139
00140
class KABDetailedViewFactory :
public KABLookFactory
00141 {
00142
public:
00143 KABDetailedViewFactory( QWidget *parent = 0,
const char *name = 0 )
00144 : KABLookFactory( parent, name ) {}
00145
00146
KABBasicLook *create()
00147 {
00148
return new KABDetailedView( mParent, mName );
00149 }
00150
00151 QString description()
00152 {
00153
return i18n(
"Detailed Style: Display all details, no modifications." );
00154 }
00155 };
00156
00157
#endif