Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.3 KB
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2017 Dmitry Kazakov <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef KOINTERACTIONSTRATEGYFACTORY_H
#define KOINTERACTIONSTRATEGYFACTORY_H

#include <QScopedPointer>
#include <QSharedPointer>
#include "kritaflake_export.h"

class QString;
class QPainter;
class KoInteractionStrategy;
class KoPointerEvent;
class KoViewConverter;
class KoColorDisplayRendererInterface;

class KoInteractionStrategyFactory;
typedef QSharedPointer<KoInteractionStrategyFactory> KoInteractionStrategyFactorySP;

class KRITAFLAKE_EXPORT KoInteractionStrategyFactory
{
public:
    KoInteractionStrategyFactory(int priority, const QString &id);
    virtual ~KoInteractionStrategyFactory();

    QString id() const;
    int priority() const;

    virtual KoInteractionStrategy* createStrategy(KoPointerEvent *ev) = 0;
    virtual bool hoverEvent(KoPointerEvent *ev) = 0;
    virtual bool paintOnHover(QPainter &painter, const KoViewConverter &converter, const KoColorDisplayRendererInterface *displayRendererInterface) = 0;
    virtual bool tryUseCustomCursor() = 0;

    static bool compareLess(KoInteractionStrategyFactorySP f1, KoInteractionStrategyFactorySP f2);

private:
    struct Private;
    QScopedPointer<Private> m_d;
};



#endif // KOINTERACTIONSTRATEGYFACTORY_H