summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/jabber/ui/dlgjabbervcard.h
blob: 16f7138690c613aa16f1877a3f56178036812961 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

/***************************************************************************
                          dlgjabbervcard.h  -  vCard dialog
                             -------------------
    begin                : Thu Aug 08 2002
    copyright            : (C) 2002-2003 by Till Gerken <till@tantalo.net>
                           (C) 2005      by Michaël Larouche <michael.larouche@kdemail.net>
    email                : kopete-devel@kde.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef DLGJABBERVCARD_H
#define DLGJABBERVCARD_H

#include <kdialogbase.h>
#include "xmpp_vcard.h"

class JabberAccount;
class JabberContact;
class JabberBaseContact;
class TQString;
class dlgVCard;

/**
 * @brief Show the information of a Jabber contact.
 *
 * This dialog shows the information of a Jabber contact from
 * the contact properties(from Kopete). 
 * Also it is used to edit the information of the Account myself contact.
 *
 * First it fetch a new version of the vcard then it display the
 * information. User can force the update using the "Update vCard" button.
 * 
 * @author Till Gerken <till@tantolo.net>
 * @author Michaël Larouche <michael.larouche@kdemail.net>
 */
class dlgJabberVCard : public KDialogBase
{
	TQ_OBJECT
  

public:
	/**
	 * Create the information(vcard) dialog.
	 *
	 * @param account the current Jabber account 
	 * @param contact the contact to display or edit information.
	 * @param widget Parent widget.
	 * @param name widget name.
	 */
	dlgJabberVCard (JabberAccount *account, JabberBaseContact *contact, TQWidget * parent = 0, const char *name = 0);
	~dlgJabberVCard ();

private slots:
	/**
	 * Show the KFileDialog for image to select a photo for the contact.
	 */
	void slotSelectPhoto();
	/**
	 * Remove(clear) the photo. 
	 * Maybe the user doesn't want to export a photo anymore.
	 */
	void slotClearPhoto();
	/**
	 * Send vCard to the server.
	 */
	void slotSaveVCard();
	/**
	 * Put back the information from the dialog into the contact properties
	 */
	void slotVCardSaved();
	/**
	 * Close the dialog.
	 */
	void slotClose();
	/**
	 * Open a link. (ex: the homepage link or the email address)
	 */
	void slotOpenURL(const TQString &url);

	/**
	 * Retrieve vCard information for the current contact.
	 */
	void slotGetVCard();
	/**
	 * vCard was succesfully fetched, update contact properties
	 * and enable display.
	 */
	void slotGotVCard();

private:
	JabberAccount *m_account;
	JabberBaseContact *m_contact;
	dlgVCard *m_mainWidget;
	TQString m_photoPath;

	void assignContactProperties();
	void setReadOnly(bool state);
	void setEnabled(bool state);
	
};

#endif // DLGJABBERVCARD_H