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
#include "kimproxy.h"
00030
00031
namespace KIO {
00032
class Job;
00033 }
00034
class KToggleAction;
00035
00036
class QPopupMenu;
00037
00038
00039
namespace KPIM {
00040
00041
00042
class AddresseeView :
public KTextBrowser
00043 {
00044 Q_OBJECT
00045
public:
00052 AddresseeView(
QWidget *parent = 0,
const char *name = 0,
00053 KConfig *config = 0 );
00054
00055 ~AddresseeView();
00056
00062
void setAddressee(
const KABC::Addressee& addr );
00063
00067 KABC::Addressee addressee() const;
00068
00069
00074 enum LinkMask { AddressLinks = 1, EmailLinks = 2, PhoneLinks = 4, URLLinks = 8, IMLinks = 16 };
00075
00080
void enableLinks(
int linkMask );
00081
00107
static QString vCardAsHTML(
const KABC::Addressee& addr, ::
KIMProxy *proxy,
int linkMask =
true,
00108
bool internalLoading =
true,
00109
bool showBirthday =
true,
bool showAddresses =
true,
00110
bool showEmails =
true,
bool showPhones =
true,
00111
bool showURLs =
true,
bool showIMAddresses =
true );
00117
static QString pixmapAsDataUrl(
const QPixmap& pixmap );
00118
00119 signals:
00120
void urlHighlighted(
const QString &url );
00121
void emailHighlighted(
const QString &email );
00122
void phoneNumberHighlighted(
const QString &number );
00123
void faxNumberHighlighted(
const QString &number );
00124
00125
void highlightedMessage(
const QString &message );
00126
00127
void addressClicked(
const QString &uid );
00128
00129
protected:
00130
virtual void urlClicked(
const QString &url );
00131
virtual void emailClicked(
const QString &mail );
00132
virtual void phoneNumberClicked(
const QString &number );
00133
virtual void faxNumberClicked(
const QString &number );
00134
virtual void imAddressClicked();
00135
00136
virtual QPopupMenu *createPopupMenu(
const QPoint& );
00137
00138
private slots:
00139
void slotMailClicked(
const QString&,
const QString& );
00140
void slotUrlClicked(
const QString& );
00141
void slotHighlighted(
const QString& );
00142
void slotPresenceChanged(
const QString & );
00143
void slotPresenceInfoExpired();
00144
void configChanged();
00145
00146
void data( KIO::Job*,
const QByteArray& );
00147
void result( KIO::Job* );
00148
00149
private:
00150
void load();
00151
void save();
00152
00153
void updateView();
00154
00155
QString strippedNumber(
const QString &number );
00156
00157 KConfig *mConfig;
00158
bool mDefaultConfig;
00159
00160
QByteArray mImageData;
00161 KIO::Job *mImageJob;
00162
00163 KToggleAction *mActionShowBirthday;
00164 KToggleAction *mActionShowAddresses;
00165 KToggleAction *mActionShowEmails;
00166 KToggleAction *mActionShowPhones;
00167 KToggleAction *mActionShowURLs;
00168
00169 KABC::Addressee mAddressee;
00170
int mLinkMask;
00171
00172
class AddresseeViewPrivate;
00173 AddresseeViewPrivate *d;
00174 ::KIMProxy *mKIMProxy;
00175 };
00176
00177 }
00178
00179
#endif