Messagelib

defaultgrantleeheaderstyleplugin.cpp
1 /*
2  SPDX-FileCopyrightText: 2015-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "defaultgrantleeheaderstyleplugin.h"
8 #include "defaultgrantleeheaderstrategy.h"
9 #include "defaultgrantleeheaderstyleinterface.h"
10 #include "globalsettings_base.h"
11 #include <KPluginFactory>
12 #include <messageviewer/grantleeheaderstyle.h>
13 using namespace MessageViewer;
14 
15 K_PLUGIN_CLASS_WITH_JSON(DefaultGrantleeHeaderStylePlugin, "messageviewer_defaultgrantleeheaderstyleplugin.json")
16 
17 DefaultGrantleeHeaderStylePlugin::DefaultGrantleeHeaderStylePlugin(QObject *parent, const QList<QVariant> &)
19  , mHeaderStyle(new GrantleeHeaderStyle)
20  , mHeaderStrategy(new DefaultGrantleeHeaderStrategy)
21 {
22  initializePlugin();
23 }
24 
25 DefaultGrantleeHeaderStylePlugin::~DefaultGrantleeHeaderStylePlugin()
26 {
27  delete mHeaderStyle;
28  delete mHeaderStrategy;
29 }
30 
31 void DefaultGrantleeHeaderStylePlugin::initializePlugin()
32 {
33 }
34 
35 HeaderStyle *DefaultGrantleeHeaderStylePlugin::headerStyle() const
36 {
37  return mHeaderStyle;
38 }
39 
40 HeaderStrategy *DefaultGrantleeHeaderStylePlugin::headerStrategy() const
41 {
42  return mHeaderStrategy;
43 }
44 
45 HeaderStyleInterface *DefaultGrantleeHeaderStylePlugin::createView(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac, QObject *parent)
46 {
47  MessageViewer::HeaderStyleInterface *view = new MessageViewer::DefaultGrantleeHeaderStyleInterface(this, parent);
48  if (ac) {
49  view->createAction(menu, actionGroup, ac);
50  }
51  return view;
52 }
53 
54 QString DefaultGrantleeHeaderStylePlugin::name() const
55 {
56  return QStringLiteral("defaultgrantlee");
57 }
58 
59 #include "defaultgrantleeheaderstyleplugin.moc"
This class encapsulates the visual appearance of message headers.
Definition: headerstyle.h:46
The HeaderStrategy class.
The HeaderStyleInterface class.
#define K_PLUGIN_CLASS_WITH_JSON(classname, jsonFile)
The HeaderStylePlugin class.
The GrantleeHeaderStyle class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Dec 5 2021 23:04:53 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.