KoResourceServerProvider.h 2.47 KB
Newer Older
1 2 3 4 5 6 7 8 9
/*  This file is part of the KDE project

    Copyright (c) 1999 Matthias Elter <elter@kde.org>
    Copyright (c) 2003 Patrick Julien <freak@codepimps.org>
    Copyright (c) 2005 Sven Langkamp <sven.langkamp@gmail.com>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
10
    version 2.1 of the License, or (at your option) any later version.
11 12 13 14 15 16 17 18 19 20 21

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

22 23
#ifndef KORESOURCESERVERPROVIDER_H
#define KORESOURCESERVERPROVIDER_H
24

25
#include <kritawidgets_export.h>
26

27
#include <QThread>
28

29
#include <WidgetsDebug.h>
30

31
#include "KoResourceServer.h"
32 33 34
#include <resources/KoPattern.h>
#include <resources/KoAbstractGradient.h>
#include <resources/KoColorSet.h>
35
#include <resources/KoSvgSymbolCollectionResource.h>
36
#include <resources/KoGamutMask.h>
37

38

Sven Langkamp's avatar
Sven Langkamp committed
39 40 41
/**
 * Provides default resource servers for gradients, patterns and palettes
 */
42
class KRITAWIDGETS_EXPORT KoResourceServerProvider : public QObject
43
{
44 45
    Q_OBJECT

46
public:
47
    KoResourceServerProvider();
48
    ~KoResourceServerProvider() override;
49

50
    static KoResourceServerProvider* instance();
51 52 53 54 55 56 57

    /**
     * @brief blacklistFileNames filters the filenames with the list of blacklisted file names
     * @param fileNames all files
     * @param blacklistedFileNames the files we don't want
     * @return the result
     */
58
    static QStringList blacklistFileNames(QStringList fileNames, const QStringList &blacklistedFileNames);
59 60


61 62 63 64
    KoResourceServer<KoPattern>* patternServer();
    KoResourceServer<KoAbstractGradient>* gradientServer();
    KoResourceServer<KoColorSet>* paletteServer();
    KoResourceServer<KoSvgSymbolCollectionResource>* svgSymbolCollectionServer();
65
    KoResourceServer<KoGamutMask>* gamutMaskServer();
66

67
private:
68 69
    KoResourceServerProvider(const KoResourceServerProvider&);
    KoResourceServerProvider operator=(const KoResourceServerProvider&);
70

71
private:
72 73
    struct Private;
    Private* const d;
74 75
};

76
#endif // KORESOURCESERVERPROVIDER_H