quicktextmenu.h 1.72 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
/*
Laurent Montel's avatar
Laurent Montel committed
2
   Copyright (C) 2019-2020 Laurent Montel <montel@kde.org>
Laurent Montel's avatar
Laurent Montel committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

   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.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
*/

#ifndef QUICKTEXTMENU_H
#define QUICKTEXTMENU_H

#include <QObject>
24
#include "quicktext_export.h"
Laurent Montel's avatar
Laurent Montel committed
25
#include <MessageComposer/ConvertSnippetVariablesUtil>
Laurent Montel's avatar
Laurent Montel committed
26
class QMenu;
Laurent Montel's avatar
Laurent Montel committed
27
28
namespace MessageComposer {
class PluginComposerInterface;
Laurent Montel's avatar
Laurent Montel committed
29
class ConvertSnippetVariableMenu;
Laurent Montel's avatar
Laurent Montel committed
30
}
31
class QUICKTEXT_EXPORT QuickTextMenu : public QObject
Laurent Montel's avatar
Laurent Montel committed
32
33
34
35
36
37
38
{
    Q_OBJECT
public:
    explicit QuickTextMenu(QWidget *parentWidget, QObject *parent = nullptr);
    ~QuickTextMenu();
    QMenu *menu() const;

Laurent Montel's avatar
Laurent Montel committed
39
40
    void setPluginComposerInterface(MessageComposer::PluginComposerInterface *composerInterface);

Laurent Montel's avatar
Laurent Montel committed
41
42
Q_SIGNALS:
    void insertText(const QString &str);
Laurent Montel's avatar
Laurent Montel committed
43
    void insertVariable(MessageComposer::ConvertSnippetVariablesUtil::VariableType type);
Laurent Montel's avatar
Laurent Montel committed
44
private:
Laurent Montel's avatar
Laurent Montel committed
45
    void initializeMenu();
Laurent Montel's avatar
Laurent Montel committed
46
    QWidget *mParentWidget = nullptr;
Laurent Montel's avatar
Laurent Montel committed
47
    MessageComposer::ConvertSnippetVariableMenu *mMenu = nullptr;
Laurent Montel's avatar
Laurent Montel committed
48
    MessageComposer::PluginComposerInterface *mComposerInterface = nullptr;
Laurent Montel's avatar
Laurent Montel committed
49
50
51
};

#endif // QUICKTEXTMENU_H