Messagelib

headerstyleplugin.h
1 /*
2  SPDX-FileCopyrightText: 2015-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QObject>
10 
11 #include "messageviewer_export.h"
12 #include <memory>
13 class KActionCollection;
14 class QActionGroup;
15 class KActionMenu;
16 namespace MessageViewer
17 {
18 class HeaderStyle;
19 class HeaderStrategy;
20 class HeaderStylePluginPrivate;
21 class HeaderStyleInterface;
22 /**
23  * @brief The HeaderStylePlugin class
24  * @author Laurent Montel <[email protected]>
25  */
26 class MESSAGEVIEWER_EXPORT HeaderStylePlugin : public QObject
27 {
28  Q_OBJECT
29 public:
30  explicit HeaderStylePlugin(QObject *parent = nullptr);
31  ~HeaderStylePlugin() override;
32 
33  virtual HeaderStyle *headerStyle() const = 0;
34  virtual HeaderStrategy *headerStrategy() const = 0;
35  virtual HeaderStyleInterface *createView(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac, QObject *parent = nullptr) = 0;
36  virtual Q_REQUIRED_RESULT QString name() const = 0;
37  virtual Q_REQUIRED_RESULT bool hasMargin() const;
38  virtual Q_REQUIRED_RESULT QString alignment() const;
39  virtual Q_REQUIRED_RESULT int elidedTextSize() const;
40 
41  void setIsEnabled(bool enabled);
42  Q_REQUIRED_RESULT bool isEnabled() const;
43 
44  virtual Q_REQUIRED_RESULT QString attachmentHtml() const;
45 
46  virtual Q_REQUIRED_RESULT bool hasConfigureDialog() const;
47 
48  virtual void showConfigureDialog(QWidget *parent);
49 
50  virtual Q_REQUIRED_RESULT QString extraScreenCss(const QString &headerFont) const;
51  virtual Q_REQUIRED_RESULT QString extraPrintCss(const QString &headerFont) const;
52  virtual Q_REQUIRED_RESULT QString extraCommonCss(const QString &headerFont) const;
53 
54 private:
55  std::unique_ptr<HeaderStylePluginPrivate> const d;
56 };
57 }
This class encapsulates the visual appearance of message headers.
Definition: headerstyle.h:46
The HeaderStrategy class.
const QLatin1String name
The HeaderStyleInterface class.
The HeaderStylePlugin class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.