summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/oscar/oscarvisibilitydialog.h
blob: fc45039fa728307902037cd7fd01f08ffa66d38a (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
/*
    oscarvisibilitydialog.h  -  Visibility Dialog

    Copyright (c) 2005 by Roman Jarosz <kedgedev@centrum.cz>
    Kopete    (c) 2005 by the Kopete developers  <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 OSCARVISIBILITYDIALOG_H
#define OSCARVISIBILITYDIALOG_H

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

/**
	@author Roman Jarosz <kedgedev@centrum.cz>
*/
class OscarVisibilityBase;
class QStringList;
class Client;

class KOPETE_EXPORT OscarVisibilityDialog : public KDialogBase
{
	Q_OBJECT
public:
	typedef QMap<QString, QString> ContactMap;

	OscarVisibilityDialog( Client* client, QWidget* parent );
	~OscarVisibilityDialog() {}

	void addContacts( const ContactMap& contacts );
	void addVisibleContacts( const QStringList& contactList );
	void addInvisibleContacts( const QStringList& contactList );

signals:
	void closing();

protected:
	virtual void slotOk();
	virtual void slotCancel();

protected slots:
	void slotAddToVisible();
	void slotRemoveFromVisible();
	void slotAddToInvisible();
	void slotRemoveFromInvisible();

private:
	enum Action{ Remove = 0, Add };
	typedef QMap<QString, Action> ChangeMap;
	
	//maps with changes that should be send to server
	ChangeMap m_visibleListChangesMap;
	ChangeMap m_invisibleListChangesMap;
	
	ContactMap m_contactMap;
	
	OscarVisibilityBase* m_visibilityUI;
	Client* m_client;
};

#endif