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:
22};
23
25 : d(new Private)
26{
27 d->toolFactory = toolFactory;
28 d->toolManager = toolManager;
29}
30
32{
33 delete d;
34}
35
37{
38 d->toolManager->switchToolRequested(id());
39}
40
41
43{
44 // There is no specific iconText in KoToolFactoryBase
45 return d->toolFactory->toolTip();
46}
47
48QString KoToolAction::toolTip() const
49{
50 return d->toolFactory->toolTip();
51}
52
54{
55 return d->toolFactory->toolName();
56}
57
58QString KoToolAction::id() const
59{
60 return d->toolFactory->id();
61}
62
64{
65 return d->toolFactory->iconName();
66}
67
68QKeySequence KoToolAction::shortcut() const
69{
70 return d->toolFactory->shortcut();
71}
72
73
74QString KoToolAction::section() const
75{
76 return d->toolFactory->section();
77}
78
80{
81 return d->toolFactory->priority();
82}
83
85{
86 return d->toolFactory->activationShapeId();
87}
88
90{
91 return d->toolFactory;
92}
93
94// ************ Connector **********
96 : QObject(parent),
97 m_shapeManager(parent)
98{
99 connect(m_shapeManager, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
100}
101
Connector(KoShapeManager *parent)
void selectionChanged()
KoShapeManager * m_shapeManager
const QList< KoShape * > selectedShapes() const
KoSelection * selection
QString iconText() const
The icontext of the tool.
KoToolManager * toolManager
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, KoToolManager *toolManager)
QString toolTip() const
The tooltip of the tool.
QString id() const
The id of the tool.
QString toolName() const
The localized tool name.
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()