Messagelib

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

KDE's Doxygen guidelines are available online.