Messagelib

defaultgrantleeheaderstyleplugin.cpp
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
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 "messageviewer/grantleeheaderstyle.h"
12#include <KPluginFactory>
13using namespace MessageViewer;
14
15K_PLUGIN_CLASS_WITH_JSON(DefaultGrantleeHeaderStylePlugin, "messageviewer_defaultgrantleeheaderstyleplugin.json")
16
17DefaultGrantleeHeaderStylePlugin::DefaultGrantleeHeaderStylePlugin(QObject *parent, const QList<QVariant> &)
18 : MessageViewer::HeaderStylePlugin(parent)
19 , mHeaderStyle(new GrantleeHeaderStyle)
20 , mHeaderStrategy(new DefaultGrantleeHeaderStrategy)
21{
22 initializePlugin();
23}
24
25DefaultGrantleeHeaderStylePlugin::~DefaultGrantleeHeaderStylePlugin()
26{
27 delete mHeaderStyle;
28 delete mHeaderStrategy;
29}
30
31void DefaultGrantleeHeaderStylePlugin::initializePlugin()
32{
33}
34
35HeaderStyle *DefaultGrantleeHeaderStylePlugin::headerStyle() const
36{
37 return mHeaderStyle;
38}
39
40HeaderStrategy *DefaultGrantleeHeaderStylePlugin::headerStrategy() const
41{
42 return mHeaderStrategy;
43}
44
45HeaderStyleInterface *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
54QString DefaultGrantleeHeaderStylePlugin::name() const
55{
56 return QStringLiteral("defaultgrantlee");
57}
58
59#include "defaultgrantleeheaderstyleplugin.moc"
60
61#include "moc_defaultgrantleeheaderstyleplugin.cpp"
#define K_PLUGIN_CLASS_WITH_JSON(classname, jsonFile)
The GrantleeHeaderStyle class.
The HeaderStrategy class.
The HeaderStyleInterface class.
The HeaderStylePlugin class.
This class encapsulates the visual appearance of message headers.
Definition headerstyle.h:47
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.