File indexing completed on 2024-05-12 15:58:51

0001 /*
0002  *  SPDX-FileCopyrightText: 2021 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef KISINTERSTROKEDATATRANSACTIONWRAPPERFACTORY_H
0008 #define KISINTERSTROKEDATATRANSACTIONWRAPPERFACTORY_H
0009 
0010 #include <QScopedPointer>
0011 #include "KisTransactionWrapperFactory.h"
0012 
0013 class KisInterstrokeDataFactory;
0014 
0015 /**
0016  * A factory object to extend the behavior of a normal transaction and
0017  * handle management of interstroke data. It will create a new interstorke
0018  * data using passed passed `KisInterstrokeDataFactory` or reset it if the
0019  * current transaction is incompatible with it.
0020  *
0021  * \see KisTransactionWrapperFactory
0022  * \see KisInterstrokeDataFactory
0023  */
0024 class KRITAIMAGE_EXPORT KisInterstrokeDataTransactionWrapperFactory : public KisTransactionWrapperFactory
0025 {
0026 public:
0027     KisInterstrokeDataTransactionWrapperFactory(KisInterstrokeDataFactory *factory, bool supportsContinuedInterstrokeData = true);
0028     ~KisInterstrokeDataTransactionWrapperFactory() override;
0029 
0030     KUndo2Command* createBeginTransactionCommand(KisPaintDeviceSP device) override;
0031     KUndo2Command* createEndTransactionCommand() override;
0032 
0033 private:
0034     struct Private;
0035     QScopedPointer<Private> m_d;
0036 };
0037 
0038 #endif // KISINTERSTROKEDATATRANSACTIONWRAPPERFACTORY_H