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.2 KB
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2018 Boudewijn Rempt <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */
#ifndef KISRESOURCEMODELPROVIDER_H
#define KISRESOURCEMODELPROVIDER_H

#include <qglobal.h>

#include "kritaresources_export.h"

class KisAllResourcesModel;
class KisAllTagsModel;
class KisAllTagResourceModel;
class KisResourceMetaDataModel;

/**
 * KisResourceModelProvider should be used to retrieve resource models.
 * For every resource type, there is only one instance of the resource model,
 * so all views on these models show the same state.
 */ 
class KRITARESOURCES_EXPORT KisResourceModelProvider
{
public:
    KisResourceModelProvider();
    ~KisResourceModelProvider();

    static KisAllResourcesModel *resourceModel(const QString &resourceType);
    static KisAllTagsModel *tagModel(const QString& resourceType);
    static KisAllTagResourceModel *tagResourceModel(const QString& resourceType);

    static void testingResetAllModels();
    static void testingCloseAllQueries();
    static KisResourceMetaDataModel *resourceMetadataModel();
private:

    struct Private;
    Private *const d;

    Q_DISABLE_COPY(KisResourceModelProvider)
};

#endif // KISRESOURCEMODELPROVIDER_H