summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/ui/userinfodialog.h
blob: 246d15ec12ea431e5b2bbb82d9089231d73eb608 (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
/*
    userinfodialog.h

    Copyright (c) 2003 by Zack Rusin <zack@kde.org>

    Kopete    (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>

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

#ifndef USERINFODIALOG_H
#define USERINFODIALOG_H

#include <kdialogbase.h>
#include <tqstring.h>

#include "kopete_export.h"

class KLineEdit;

namespace Kopete {

	class KOPETE_EXPORT UserInfoDialog : public KDialogBase
	{
		Q_OBJECT
	public:
		UserInfoDialog( const TQString& descr );
		virtual ~UserInfoDialog();


		/**
		 * Specifies the look of this dialog. If set to HTML only
		 * KHTMLPart will be in the dialog and it's look can be customized
		 * through setStyleSheet
		 * @see setStyleSheet
		 */
		enum DialogStyle { HTML, Widget };
		void setStyle( DialogStyle style );

		// The functions below set elements as specified in the name.
		// If an element is not set it won't be displayed.
		void setName( const TQString& name );
		void setId( const TQString& id );
		void setAwayMessage( const TQString& msg );
		void setStatus( const TQString& status );
		void setWarningLevel(const TQString& level  );
		void setOnlineSince( const TQString& since );
		void setInfo( const TQString& info );
		void setAddress( const TQString& addr );
		void setPhone( const TQString& phone );

		void addCustomField( const TQString& name, const TQString& txt );
		void addHTMLText( const TQString& str );

		///Shows the dialog
		virtual void show();
	protected:
		/**
		 * This function has to be called after setting all the fields.
		 * It builds the GUI for the dialog. By default show() calls it.
		 */
		virtual void create();
		//Fills the dialog HTML if DialogStyle is HTML
		virtual void fillHTML();
		//Fills the dialog with widgets if DialogStyle is Widget
		virtual void fillWidgets();

		/**
		 * If the DialogStyle is set to HTML one can customize the look of this
		 * dialog by setting the right stylesheet. The CSS id elements that can be
		 * customized include : "name", "id", "warningLevel", "onlineSince",
		 * "address", "phone", "status", "awayMessage" and "info".
		 */
		void setStyleSheet( const TQString& css );

		TQHBox* addLabelEdit( const TQString& label, const TQString& text, KLineEdit*& edit );

	private:
		struct UserInfoDialogPrivate;
		UserInfoDialogPrivate *d;
	};

}
#endif