summaryrefslogtreecommitdiffstats
path: root/kopete/kopete/chatwindow/emoticonselector.h
blob: 7d7b484285dda721b8538069452f3a6d03991488 (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
/*
    emoticonselector.h

    a button that pops up a list of all emoticons and returns
    the emoticon-string if one is selected in the list

    Copyright (c) 2002 by Stefan Gehn            <metz AT gehn.net>
    Kopete    (c) 2002-2003 by the Kopete developers  <[email protected]>

    *************************************************************************
    *                                                                       *
    * 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 __emoticonselector_h__
#define __emoticonselector_h__

#include <qlabel.h>
#include <qwidget.h>
class QGridLayout;
class QHideEvent;
class QShowEvent;

class EmoticonLabel : public QLabel
{
	Q_OBJECT

public:
	EmoticonLabel(const QString &emoticonText, const QString &pixmapPath, QWidget *parent=0, const char *name=0);
//	~EmoticonLabel();

signals:
	void clicked(const QString &text);

protected:
	void mouseReleaseEvent(QMouseEvent*);
	QString mText;
};

class EmoticonSelector : public QWidget
{
	Q_OBJECT

public:

	EmoticonSelector ( QWidget *parent = 0, const char *name = 0 );
//	~EmoticonSelector();

	typedef QValueList<QMovie*> MovieList;
signals:
	/**
	* gets emitted when an emoticon has been selected from the list
	* the QString holds the emoticon as a string or is 0L if nothing was selected
	**/
	void ItemSelected(const QString &);

public slots:
	void prepareList();

protected:
	virtual void hideEvent( QHideEvent* );
	virtual void showEvent( QShowEvent* );
	MovieList movieList;
	QGridLayout *lay;

protected slots:
	void emoticonClicked(const QString &);
};

#endif
// vim: set noet ts=4 sts=4 sw=4: