Messagelib

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

KDE's Doxygen guidelines are available online.