kaddressbook Library API Documentation

look_details.h

00001 /* 00002 This file is part of KAddressBook. 00003 Copyright (c) 1996-2002 Mirko Boehm <mirko@kde.org> 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 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
KDE Logo
This file is part of the documentation for kaddressbook Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 21 19:46:37 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003