2 Copyright (c) 2015 Montel Laurent <montel@kde.org>
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License, version 2, as
6 published by the Free Software Foundation.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #include "fancyheaderstyleinterface.h"
19 #include "fancyheaderstyleplugin.h"
20 #include "header/fancyheaderstyle.h"
22 #include "header/headerstrategy_p.h"
23 #include <kpluginfactory.h>
24 using namespace MessageViewer
;
26 K_PLUGIN_FACTORY_WITH_JSON(MessageViewerFancyHeaderStylePluginFactory
, "messageviewer_fancyheaderstyleplugin.json", registerPlugin
<FancyHeaderStylePlugin
>();)
28 FancyHeaderStylePlugin::FancyHeaderStylePlugin(QObject
*parent
, const QList
<QVariant
> &)
29 : MessageViewer::HeaderStylePlugin(parent
),
30 mHeaderStyle(new FancyHeaderStyle
),
31 mHeaderStrategy(new RichHeaderStrategy
)
35 FancyHeaderStylePlugin::~FancyHeaderStylePlugin()
40 HeaderStyle
*FancyHeaderStylePlugin::headerStyle() const
45 HeaderStrategy
*FancyHeaderStylePlugin::headerStrategy() const
47 return mHeaderStrategy
;
50 HeaderStyleInterface
*FancyHeaderStylePlugin::createView(KActionMenu
*menu
, QActionGroup
*actionGroup
, KActionCollection
*ac
, QObject
*parent
)
52 MessageViewer::HeaderStyleInterface
*view
= new MessageViewer::FancyHeaderStyleInterface(mHeaderStyle
, mHeaderStrategy
, parent
);
53 view
->createAction(menu
, actionGroup
, ac
);
57 QString
FancyHeaderStylePlugin::name() const
59 return QStringLiteral("fancy");
62 #include "fancyheaderstyleplugin.moc"