File indexing completed on 2025-01-19 04:46:54
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "grantleeheaderstyleplugin.h" 0008 #include "grantleeheaderstrategy.h" 0009 #include "grantleeheaderstyleinterface.h" 0010 #include <MessageViewer/GrantleeHeaderStyle> 0011 0012 #include <KPluginFactory> 0013 using namespace MessageViewer; 0014 0015 K_PLUGIN_CLASS_WITH_JSON(GrantleeHeaderStylePlugin, "messageviewer_grantleeheaderstyleplugin.json") 0016 0017 GrantleeHeaderStylePlugin::GrantleeHeaderStylePlugin(QObject *parent, const QList<QVariant> &) 0018 : MessageViewer::HeaderStylePlugin(parent) 0019 , mHeaderStyle(new GrantleeHeaderStyle) 0020 , mHeaderStrategy(new GrantleeHeaderStrategy) 0021 { 0022 } 0023 0024 GrantleeHeaderStylePlugin::~GrantleeHeaderStylePlugin() 0025 { 0026 delete mHeaderStyle; 0027 delete mHeaderStrategy; 0028 } 0029 0030 HeaderStyle *GrantleeHeaderStylePlugin::headerStyle() const 0031 { 0032 return mHeaderStyle; 0033 } 0034 0035 HeaderStrategy *GrantleeHeaderStylePlugin::headerStrategy() const 0036 { 0037 return mHeaderStrategy; 0038 } 0039 0040 HeaderStyleInterface *GrantleeHeaderStylePlugin::createView(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac, QObject *parent) 0041 { 0042 MessageViewer::HeaderStyleInterface *view = new MessageViewer::GrantleeHeaderStyleInterface(this, parent); 0043 if (ac) { 0044 view->createAction(menu, actionGroup, ac); 0045 } 0046 return view; 0047 } 0048 0049 QString GrantleeHeaderStylePlugin::name() const 0050 { 0051 return QStringLiteral("grantlee"); 0052 } 0053 0054 #include "grantleeheaderstyleplugin.moc" 0055 0056 #include "moc_grantleeheaderstyleplugin.cpp"