Messagelib

convertsnippetvariablesjob.h
1 /*
2  SPDX-FileCopyrightText: 2019-2021 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  static Q_REQUIRED_RESULT 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  static Q_REQUIRED_RESULT QString convertVariables(const QString &cmd, int &i, QChar c);
39  static Q_REQUIRED_RESULT QString getFirstNameFromEmail(const QString &address);
40  static Q_REQUIRED_RESULT QString getLastNameFromEmail(const QString &address);
41  static Q_REQUIRED_RESULT QString getNameFromEmail(const QString &address);
42  QString mText;
43  MessageComposer::ComposerViewInterface *mComposerViewInterface = nullptr;
44 };
45 }
The ComposerViewInterface class.
The ConvertSnippetVariablesJob class.
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-2021 The KDE developers.
Generated on Fri Nov 26 2021 23:16:41 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.