Krita Source Code Documentation
Loading...
Searching...
No Matches
KoToolManager_p.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2006 Thomas Zander <zander@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#include "KoToolManager_p.h"
8
9#include <KoShapeManager.h>
10#include <KoSelection.h>
11#include <KoToolBase.h>
12#include <KoToolFactoryBase.h>
13#include "kis_action_registry.h"
14
15// ************ KoToolAction::Private **********
16
17class Q_DECL_HIDDEN KoToolAction::Private
18{
19public:
21};
22
24 : d(new Private)
25{
26 d->toolFactory = toolFactory;
27}
28
30{
31 delete d;
32}
33
38
39
41{
42 // There is no specific iconText in KoToolFactoryBase
43 return d->toolFactory->toolTip();
44}
45
46QString KoToolAction::toolTip() const
47{
48 return d->toolFactory->toolTip();
49}
50
51QString KoToolAction::id() const
52{
53 return d->toolFactory->id();
54}
55
57{
58 return d->toolFactory->iconName();
59}
60
61QKeySequence KoToolAction::shortcut() const
62{
63 return d->toolFactory->shortcut();
64}
65
66
67QString KoToolAction::section() const
68{
69 return d->toolFactory->section();
70}
71
73{
74 return d->toolFactory->priority();
75}
76
78{
79 return d->toolFactory->activationShapeId();
80}
81
83{
84 return d->toolFactory;
85}
86
87// ************ Connector **********
89 : QObject(parent),
90 m_shapeManager(parent)
91{
93}
94
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
Connector(KoShapeManager *parent)
void selectionChanged()
KoShapeManager * m_shapeManager
const QList< KoShape * > selectedShapes() const
KoSelection * selection
QString iconText() const
The icontext of the tool.
Private *const d
QKeySequence shortcut() const
The shortcut to activate the tool.
QString iconName() const
The icon name of the tool.
QString section() const
The section the tool wants to be in.
KoToolFactoryBase * toolFactory
~KoToolAction() override
KoToolAction(KoToolFactoryBase *toolFactory)
QString toolTip() const
The tooltip of the tool.
QString id() const
The id of the tool.
void trigger()
Request the activation of the tool.
int priority() const
Lower number (higher priority) means coming first in the section.
QString visibilityCode() const
This tool should become visible when we Q_EMIT this string in toolCodesSelected()
void switchToolRequested(const QString &id)
static KoToolManager * instance()
Return the toolmanager singleton.