Messagelib

headerstyleplugin.h
1 /*
2  SPDX-FileCopyrightText: 2015-2023 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  Q_REQUIRED_RESULT virtual QString name() const = 0;
37  Q_REQUIRED_RESULT virtual bool hasMargin() const;
38  Q_REQUIRED_RESULT virtual QString alignment() const;
39  Q_REQUIRED_RESULT virtual int elidedTextSize() const;
40 
41  void setIsEnabled(bool enabled);
42  Q_REQUIRED_RESULT bool isEnabled() const;
43 
44  Q_REQUIRED_RESULT virtual QString attachmentHtml() const;
45 
46  Q_REQUIRED_RESULT virtual bool hasConfigureDialog() const;
47 
48  virtual void showConfigureDialog(QWidget *parent);
49 
50  Q_REQUIRED_RESULT virtual QString extraScreenCss(const QString &headerFont) const;
51  Q_REQUIRED_RESULT virtual QString extraPrintCss(const QString &headerFont) const;
52  Q_REQUIRED_RESULT virtual QString extraCommonCss(const QString &headerFont) const;
53 
54 private:
55  std::unique_ptr<HeaderStylePluginPrivate> const d;
56 };
57 }
The HeaderStrategy class.
This class encapsulates the visual appearance of message headers.
Definition: headerstyle.h:46
The HeaderStyleInterface class.
The HeaderStylePlugin class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Mar 24 2023 04:08:31 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.