Messagelib

convertsnippetvariablesjob.h
1/*
2 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messagecomposer_export.h"
10#include <QObject>
11namespace MessageComposer
12{
13class ComposerViewInterface;
14/**
15 * @brief The ConvertSnippetVariablesJob class
16 * @author Laurent Montel <montel@kde.org>
17 */
18class MESSAGECOMPOSER_EXPORT ConvertSnippetVariablesJob : public QObject
19{
20 Q_OBJECT
21public:
22 explicit ConvertSnippetVariablesJob(QObject *parent = nullptr);
24 void start();
25
26 void setText(const QString &str);
27 [[nodiscard]] QString text() const;
28
29 [[nodiscard]] MessageComposer::ComposerViewInterface *composerViewInterface() const;
30 void setComposerViewInterface(MessageComposer::ComposerViewInterface *composerViewInterface);
31 [[nodiscard]] static QString convertVariables(MessageComposer::ComposerViewInterface *composerView, const QString &text);
32
33 [[nodiscard]] bool canStart() const;
34Q_SIGNALS:
35 void textConverted(const QString &str);
36
37private:
38 [[nodiscard]] static QString convertVariables(const QString &cmd, int &i, QChar c);
39 [[nodiscard]] static QString getFirstNameFromEmail(const QString &address);
40 [[nodiscard]] static QString getLastNameFromEmail(const QString &address);
41 [[nodiscard]] static QString getNameFromEmail(const QString &address);
42 QString mText;
43 MessageComposer::ComposerViewInterface *mComposerViewInterface = nullptr;
44};
45}
The ComposerViewInterface class.
Q_SCRIPTABLE Q_NOREPLY void start()
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 11:56:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.