Messagelib

headerstyleinterface.cpp
1 /*
2  SPDX-FileCopyrightText: 2015-2020 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "headerstyle.h"
8 #include "headerstyleinterface.h"
9 #include "headerstyleplugin.h"
10 #include "utils/messageviewerutil_p.h"
11 #include <KActionMenu>
12 #include <QAction>
13 #include <KToggleAction>
14 using namespace MessageViewer;
15 
16 HeaderStyleInterface::HeaderStyleInterface(MessageViewer::HeaderStylePlugin *headerStylePlugin, QObject *parent)
17  : QObject(parent)
18  , mHeaderStylePlugin(headerStylePlugin)
19 {
20 }
21 
22 HeaderStyleInterface::~HeaderStyleInterface()
23 {
24 }
25 
26 QList<KToggleAction *> HeaderStyleInterface::action() const
27 {
28  return mAction;
29 }
30 
31 void HeaderStyleInterface::addHelpTextAction(QAction *act, const QString &text)
32 {
33  MessageViewer::Util::addHelpTextAction(act, text);
34 }
35 
36 void HeaderStyleInterface::addActionToMenu(KActionMenu *menu, QActionGroup *actionGroup)
37 {
38  for (KToggleAction *taction : qAsConst(mAction)) {
39  menu->addAction(taction);
40  actionGroup->addAction(taction);
41  }
42 }
43 
44 HeaderStylePlugin *HeaderStyleInterface::headerStylePlugin() const
45 {
46  return mHeaderStylePlugin;
47 }
48 
49 void HeaderStyleInterface::slotStyleChanged()
50 {
51  Q_EMIT styleChanged(mHeaderStylePlugin);
52 }
void addAction(QAction *action)
QAction * addAction(QAction *action)
The HeaderStylePlugin class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Sep 22 2020 23:14:00 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.