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 "briefheaderstyleplugin.h"
0008 #include "briefheaderstrategy.h"
0009 #include "briefheaderstyle.h"
0010 #include "briefheaderstyleinterface.h"
0011 #include <KPluginFactory>
0012 
0013 using namespace MessageViewer;
0014 
0015 K_PLUGIN_CLASS_WITH_JSON(BriefHeaderStylePlugin, "messageviewer_briefheaderstyleplugin.json")
0016 
0017 BriefHeaderStylePlugin::BriefHeaderStylePlugin(QObject *parent, const QList<QVariant> &)
0018     : MessageViewer::HeaderStylePlugin(parent)
0019     , mHeaderStyle(new BriefHeaderStyle)
0020     , mHeaderStrategy(new BriefHeaderStrategy)
0021 {
0022 }
0023 
0024 BriefHeaderStylePlugin::~BriefHeaderStylePlugin()
0025 {
0026     delete mHeaderStyle;
0027     delete mHeaderStrategy;
0028 }
0029 
0030 HeaderStyle *BriefHeaderStylePlugin::headerStyle() const
0031 {
0032     return mHeaderStyle;
0033 }
0034 
0035 HeaderStrategy *BriefHeaderStylePlugin::headerStrategy() const
0036 {
0037     return mHeaderStrategy;
0038 }
0039 
0040 MessageViewer::HeaderStyleInterface *BriefHeaderStylePlugin::createView(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac, QObject *parent)
0041 {
0042     auto view = new MessageViewer::BriefHeaderStyleInterface(this, parent);
0043     if (ac) {
0044         view->createAction(menu, actionGroup, ac);
0045     }
0046     return view;
0047 }
0048 
0049 QString BriefHeaderStylePlugin::name() const
0050 {
0051     return QStringLiteral("brief");
0052 }
0053 
0054 #include "briefheaderstyleplugin.moc"
0055 
0056 #include "moc_briefheaderstyleplugin.cpp"