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 "enterpriseheaderstyleplugin.h" 0008 #include "enterpriseheaderstyle.h" 0009 #include "enterpriseheaderstyleinterface.h" 0010 0011 #include <KPluginFactory> 0012 #include <MessageViewer/RichHeaderStrategy> 0013 0014 using namespace MessageViewer; 0015 0016 K_PLUGIN_CLASS_WITH_JSON(EnterpriseHeaderStylePlugin, "messageviewer_enterpriseheaderstyleplugin.json") 0017 0018 EnterpriseHeaderStylePlugin::EnterpriseHeaderStylePlugin(QObject *parent, const QList<QVariant> &) 0019 : MessageViewer::HeaderStylePlugin(parent) 0020 , mHeaderStyle(new EnterpriseHeaderStyle) 0021 , mHeaderStrategy(new RichHeaderStrategy) 0022 { 0023 } 0024 0025 EnterpriseHeaderStylePlugin::~EnterpriseHeaderStylePlugin() 0026 { 0027 delete mHeaderStyle; 0028 delete mHeaderStrategy; 0029 } 0030 0031 HeaderStyle *EnterpriseHeaderStylePlugin::headerStyle() const 0032 { 0033 return mHeaderStyle; 0034 } 0035 0036 HeaderStrategy *EnterpriseHeaderStylePlugin::headerStrategy() const 0037 { 0038 return mHeaderStrategy; 0039 } 0040 0041 HeaderStyleInterface *EnterpriseHeaderStylePlugin::createView(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac, QObject *parent) 0042 { 0043 MessageViewer::HeaderStyleInterface *view = new MessageViewer::EnterpriseHeaderStyleInterface(this, parent); 0044 if (ac) { 0045 view->createAction(menu, actionGroup, ac); 0046 } 0047 return view; 0048 } 0049 0050 QString EnterpriseHeaderStylePlugin::name() const 0051 { 0052 return QStringLiteral("enterprise"); 0053 } 0054 0055 bool EnterpriseHeaderStylePlugin::hasMargin() const 0056 { 0057 return false; 0058 } 0059 0060 QString EnterpriseHeaderStylePlugin::alignment() const 0061 { 0062 return QStringLiteral("right"); 0063 } 0064 0065 int EnterpriseHeaderStylePlugin::elidedTextSize() const 0066 { 0067 return 180; 0068 } 0069 0070 #include "enterpriseheaderstyleplugin.moc" 0071 0072 #include "moc_enterpriseheaderstyleplugin.cpp"