1 /*
2     Kopete ContactList Token
3 
4     Copyright (c) 2009 by Roman Jarosz <kedgedev@gmail.com>
5 
6     Kopete    (c) 2009 by the Kopete developers  <kopete-devel@kde.org>
7 
8     *************************************************************************
9     *                                                                       *
10     * This program is free software; you can redistribute it and/or modify  *
11     * it under the terms of the GNU General Public License as published by  *
12     * the Free Software Foundation; either version 2 of the License, or     *
13     * (at your option) any later version.                                   *
14     *                                                                       *
15     *************************************************************************
16 */
17 #ifndef CONTACTLISTTOKEN_H
18 #define CONTACTLISTTOKEN_H
19 
20 #include <TokenWithLayout.h>
21 
22 class ContactListTokenFactory : public TokenFactory
23 {
24 public:
25     Token *createToken(const QString &text, const QString &iconName, int value, QWidget *parent = nullptr) Q_DECL_OVERRIDE;
26 };
27 
28 class ContactListToken : public TokenWithLayout
29 {
30     Q_OBJECT
31 public:
32     ContactListToken(const QString &text, const QString &iconName, int value, QWidget *parent = nullptr);
33 
34     bool small() const;
35     void setSmall(bool small);
36 
37     bool optimalSize() const;
38     void setOptimalSize(bool optimalSize);
39 
40 protected:
41     void fillMenu(QMenu *menu) Q_DECL_OVERRIDE;
42     void menuExecuted(const QAction *action) Q_DECL_OVERRIDE;
43 
44 private:
45     bool m_small;
46     bool m_optimalSize;
47 };
48 
49 #endif
50