1 /***************************************************************************
2 *                                                                         *
3 *   This program is free software; you can redistribute it and/or modify  *
4 *   it under the terms of the GNU General Public License as published by  *
5 *   the Free Software Foundation; either version 3 of the License, or     *
6 *   (at your option) any later version.                                   *
7 *                                                                         *
8 ***************************************************************************/
9 
10 #pragma once
11 
12 #include <QString>
13 #include <QMap>
14 #include <QList>
15 #include <QStringList>
16 #include <QPixmap>
17 #include <QLabel>
18 #include <QMouseEvent>
19 
20 class EmoticonLabel: public QLabel{
21 Q_OBJECT
22 public:
QLabel(parent)23     EmoticonLabel(QWidget *parent = NULL) : QLabel(parent){}
~EmoticonLabel()24     virtual ~EmoticonLabel(){}
25 
26 Q_SIGNALS:
27     void clicked();
28 
29 protected:
mousePressEvent(QMouseEvent * ev)30     virtual void mousePressEvent(QMouseEvent *ev){
31         QLabel::mousePressEvent(ev);
32 
33         emit clicked();
34     }
35 };
36 
37 struct EmoticonObject{
38     QString fileName;
39     QPixmap pixmap;
40 
41     int id;
42 };
43 
44 typedef QMap<QString, EmoticonObject*> EmoticonMap;
45 typedef QList<EmoticonObject*> EmoticonList;
46