00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#ifndef KPIM_ADDRESSEEVIEW_H
00023
#define KPIM_ADDRESSEEVIEW_H
00024
00025
#include <qcstring.h>
00026
00027
#include <kabc/addressee.h>
00028
#include <ktextbrowser.h>
00029
00030
namespace KIO {
00031
class Job;
00032 }
00033
class KToggleAction;
00034
00035
class QPopupMenu;
00036
00037 namespace KPIM {
00038
00039
class AddresseeView :
public KTextBrowser
00040 {
00041 Q_OBJECT
00042
00043
public:
00050 AddresseeView( QWidget *parent = 0,
const char *name = 0,
00051 KConfig *config = 0 );
00052
00053 ~AddresseeView();
00054
00060
void setAddressee(
const KABC::Addressee& addr );
00061
00065 KABC::Addressee addressee()
const;
00066
00067 signals:
00068
void urlHighlighted(
const QString &url );
00069
void emailHighlighted(
const QString &email );
00070
void phoneNumberHighlighted(
const QString &number );
00071
void faxNumberHighlighted(
const QString &number );
00072
00073
void highlightedMessage(
const QString &message );
00074
00075
protected:
00076
virtual void urlClicked(
const QString &url );
00077
virtual void emailClicked(
const QString &mail );
00078
virtual void phoneNumberClicked(
const QString &number );
00079
virtual void faxNumberClicked(
const QString &number );
00080
00081
virtual QPopupMenu *createPopupMenu(
const QPoint& );
00082
00083
private slots:
00084
void slotMailClicked(
const QString&,
const QString& );
00085
void slotUrlClicked(
const QString& );
00086
void slotHighlighted(
const QString& );
00087
void configChanged();
00088
00089
void data( KIO::Job*,
const QByteArray& );
00090
void result( KIO::Job* );
00091
00092
private:
00093
void load();
00094
void save();
00095
00096
void updateView();
00097
00098 QString strippedNumber(
const QString &number );
00099
00100 KConfig *mConfig;
00101
bool mDefaultConfig;
00102
00103 QByteArray mImageData;
00104 KIO::Job *mImageJob;
00105
00106 KToggleAction *mActionShowBirthday;
00107 KToggleAction *mActionShowAddresses;
00108 KToggleAction *mActionShowEmails;
00109 KToggleAction *mActionShowPhones;
00110 KToggleAction *mActionShowURLs;
00111
00112 KABC::Addressee mAddressee;
00113
00114
class AddresseeViewPrivate;
00115 AddresseeViewPrivate *d;
00116 };
00117
00118 }
00119
00120
#endif