Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Krita
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tusooa Zhu
Krita
Commits
63823205
Commit
63823205
authored
Jun 20, 2018
by
Boudewijn Rempt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add skeleton for specialized storage plugins
parent
309cce59
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
538 additions
and
6 deletions
+538
-6
libs/resources/CMakeLists.txt
libs/resources/CMakeLists.txt
+6
-0
libs/resources/KisAbrStorage.cpp
libs/resources/KisAbrStorage.cpp
+51
-0
libs/resources/KisAbrStorage.h
libs/resources/KisAbrStorage.h
+39
-0
libs/resources/KisAslStorage.cpp
libs/resources/KisAslStorage.cpp
+51
-0
libs/resources/KisAslStorage.h
libs/resources/KisAslStorage.h
+39
-0
libs/resources/KisBundleStorage.cpp
libs/resources/KisBundleStorage.cpp
+49
-0
libs/resources/KisBundleStorage.h
libs/resources/KisBundleStorage.h
+38
-0
libs/resources/KisFolderStorage.cpp
libs/resources/KisFolderStorage.cpp
+50
-0
libs/resources/KisFolderStorage.h
libs/resources/KisFolderStorage.h
+39
-0
libs/resources/KisResourceCacheDb.cpp
libs/resources/KisResourceCacheDb.cpp
+15
-1
libs/resources/KisResourceCacheDb.h
libs/resources/KisResourceCacheDb.h
+1
-0
libs/resources/KisResourceStorage.cpp
libs/resources/KisResourceStorage.cpp
+25
-4
libs/resources/KisResourceStorage.h
libs/resources/KisResourceStorage.h
+39
-1
libs/resources/KisStoragePlugin.cpp
libs/resources/KisStoragePlugin.cpp
+42
-0
libs/resources/KisStoragePlugin.h
libs/resources/KisStoragePlugin.h
+54
-0
No files found.
libs/resources/CMakeLists.txt
View file @
63823205
...
...
@@ -7,6 +7,12 @@ set(kritaresources_LIB_SRCS
KisResourceLocator.cpp
KisResourceStorage.cpp
KisStoragePlugin.cpp
KisAbrStorage.cpp
KisAslStorage.cpp
KisBundleStorage.cpp
KisFolderStorage.cpp
KoResource.cpp
KoMD5Generator.cpp
KoHashGeneratorProvider.cpp
...
...
libs/resources/KisAbrStorage.cpp
0 → 100644
View file @
63823205
/*
* Copyright (C) 2018 Boudewijn Rempt <boud@valdyas.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "KisAbrStorage.h"
KisAbrStorage
::
KisAbrStorage
(
const
QString
&
location
)
:
KisStoragePlugin
(
location
)
{
}
KisAbrStorage
::~
KisAbrStorage
()
{
}
KisResourceStorage
::
ResourceItem
KisAbrStorage
::
resourceItem
(
const
QString
&
url
)
{
return
KisResourceStorage
::
ResourceItem
();
}
KisResourceStorage
::
ResourceItemIterator
KisAbrStorage
::
resourceItems
(
const
QString
&
resourceType
)
{
return
KisResourceStorage
::
ResourceItemIterator
();
}
KoResourceSP
KisAbrStorage
::
resource
(
const
QString
&
url
)
{
return
0
;
}
KisResourceStorage
::
ResourceIterator
KisAbrStorage
::
resources
(
const
QString
&
resourceType
)
{
return
KisResourceStorage
::
ResourceIterator
();
}
libs/resources/KisAbrStorage.h
0 → 100644
View file @
63823205
/*
* Copyright (C) 2018 Boudewijn Rempt <boud@valdyas.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KISABRSTORAGE_H
#define KISABRSTORAGE_H
#include <KisStoragePlugin.h>
class
KisAbrStorage
:
public
KisStoragePlugin
{
public:
KisAbrStorage
(
const
QString
&
location
);
virtual
~
KisAbrStorage
();
KisResourceStorage
::
ResourceItem
resourceItem
(
const
QString
&
url
)
override
;
KisResourceStorage
::
ResourceItemIterator
resourceItems
(
const
QString
&
resourceType
)
override
;
KoResourceSP
resource
(
const
QString
&
url
)
override
;
KisResourceStorage
::
ResourceIterator
resources
(
const
QString
&
resourceType
)
override
;
};
#endif // KISABRSTORAGE_H
libs/resources/KisAslStorage.cpp
0 → 100644
View file @
63823205
/*
* Copyright (C) 2018 Boudewijn Rempt <boud@valdyas.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "KisAslStorage.h"
KisAslStorage
::
KisAslStorage
(
const
QString
&
location
)
:
KisStoragePlugin
(
location
)
{
}
KisAslStorage
::~
KisAslStorage
()
{
}
KisResourceStorage
::
ResourceItem
KisAslStorage
::
resourceItem
(
const
QString
&
url
)
{
return
KisResourceStorage
::
ResourceItem
();
}
KisResourceStorage
::
ResourceItemIterator
KisAslStorage
::
resourceItems
(
const
QString
&
resourceType
)
{
return
KisResourceStorage
::
ResourceItemIterator
();
}
KoResourceSP
KisAslStorage
::
resource
(
const
QString
&
url
)
{
return
0
;
}
KisResourceStorage
::
ResourceIterator
KisAslStorage
::
resources
(
const
QString
&
resourceType
)
{
return
KisResourceStorage
::
ResourceIterator
();
}
libs/resources/KisAslStorage.h
0 → 100644
View file @
63823205
/*
* Copyright (C) 2018 Boudewijn Rempt <boud@valdyas.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KISASLSTORAGE_H
#define KISASLSTORAGE_H
#include <KisStoragePlugin.h>
class
KisAslStorage
:
public
KisStoragePlugin
{
public:
KisAslStorage
(
const
QString
&
location
);
virtual
~
KisAslStorage
();
KisResourceStorage
::
ResourceItem
resourceItem
(
const
QString
&
url
)
override
;
KisResourceStorage
::
ResourceItemIterator
resourceItems
(
const
QString
&
resourceType
)
override
;
KoResourceSP
resource
(
const
QString
&
url
)
override
;
KisResourceStorage
::
ResourceIterator
resources
(
const
QString
&
resourceType
)
override
;
};
#endif // KISASLSTORAGE_H
libs/resources/KisBundleStorage.cpp
0 → 100644
View file @
63823205
/*
* Copyright (C) 2018 Boudewijn Rempt <boud@valdyas.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "KisBundleStorage.h"
KisBundleStorage
::
KisBundleStorage
(
const
QString
&
location
)
:
KisStoragePlugin
(
location
)
{
}
KisBundleStorage
::~
KisBundleStorage
()
{
}
KisResourceStorage
::
ResourceItem
KisBundleStorage
::
resourceItem
(
const
QString
&
url
)
{
return
KisResourceStorage
::
ResourceItem
();
}
KisResourceStorage
::
ResourceItemIterator
KisBundleStorage
::
resourceItems
(
const
QString
&
resourceType
)
{
return
KisResourceStorage
::
ResourceItemIterator
();
}
KoResourceSP
KisBundleStorage
::
resource
(
const
QString
&
url
)
{
return
0
;
}
KisResourceStorage
::
ResourceIterator
KisBundleStorage
::
resources
(
const
QString
&
resourceType
)
{
return
KisResourceStorage
::
ResourceIterator
();
}
libs/resources/KisBundleStorage.h
0 → 100644
View file @
63823205
/*
* Copyright (C) 2018 Boudewijn Rempt <boud@valdyas.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KISBUNDLESTORAGE_H
#define KISBUNDLESTORAGE_H
#include <KisStoragePlugin.h>
class
KisBundleStorage
:
public
KisStoragePlugin
{
public:
KisBundleStorage
(
const
QString
&
location
);
virtual
~
KisBundleStorage
();
KisResourceStorage
::
ResourceItem
resourceItem
(
const
QString
&
url
)
override
;
KisResourceStorage
::
ResourceItemIterator
resourceItems
(
const
QString
&
resourceType
)
override
;
KoResourceSP
resource
(
const
QString
&
url
)
override
;
KisResourceStorage
::
ResourceIterator
resources
(
const
QString
&
resourceType
)
override
;
};
#endif // KISBUNDLESTORAGE_H
libs/resources/KisFolderStorage.cpp
0 → 100644
View file @
63823205
/*
* Copyright (C) 2018 Boudewijn Rempt <boud@valdyas.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "KisFolderStorage.h"
KisFolderStorage
::
KisFolderStorage
(
const
QString
&
location
)
:
KisStoragePlugin
(
location
)
{
}
KisFolderStorage
::~
KisFolderStorage
()
{
}
KisResourceStorage
::
ResourceItem
KisFolderStorage
::
resourceItem
(
const
QString
&
url
)
{
return
KisResourceStorage
::
ResourceItem
();
}
KisResourceStorage
::
ResourceItemIterator
KisFolderStorage
::
resourceItems
(
const
QString
&
resourceType
)
{
return
KisResourceStorage
::
ResourceItemIterator
();
}
KoResourceSP
KisFolderStorage
::
resource
(
const
QString
&
url
)
{
return
0
;
}
KisResourceStorage
::
ResourceIterator
KisFolderStorage
::
resources
(
const
QString
&
resourceType
)
{
return
KisResourceStorage
::
ResourceIterator
();
}
libs/resources/KisFolderStorage.h
0 → 100644
View file @
63823205
/*
* Copyright (C) 2018 Boudewijn Rempt <boud@valdyas.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KISFOLDERSTORAGE_H
#define KISFOLDERSTORAGE_H
#include <KisStoragePlugin.h>
class
KisFolderStorage
:
public
KisStoragePlugin
{
public:
KisFolderStorage
(
const
QString
&
location
);
virtual
~
KisFolderStorage
();
KisResourceStorage
::
ResourceItem
resourceItem
(
const
QString
&
url
)
override
;
KisResourceStorage
::
ResourceItemIterator
resourceItems
(
const
QString
&
resourceType
)
override
;
KoResourceSP
resource
(
const
QString
&
url
)
override
;
KisResourceStorage
::
ResourceIterator
resources
(
const
QString
&
resourceType
)
override
;
};
#endif // KISFOLDERSTORAGE_H
libs/resources/KisResourceCacheDb.cpp
View file @
63823205
...
...
@@ -255,9 +255,23 @@ bool KisResourceCacheDb::initialize(const QString &location)
return
s_valid
;
}
bool
KisResourceCacheDb
::
addResource
(
KoResourceSP
resource
)
{
// XXX
return
false
;
}
bool
KisResourceCacheDb
::
addResources
(
KisResourceStorageSP
storage
,
QString
folder
)
{
qDebug
()
<<
folder
<<
storage
->
resources
(
folder
).
count
();
KisResourceStorage
::
ResourceIterator
iter
=
storage
->
resources
(
folder
);
while
(
iter
.
hasNext
())
{
iter
.
next
();
KoResourceSP
res
=
iter
.
resource
();
if
(
!
addResource
(
res
))
{
qWarning
()
<<
"Could not add resource"
<<
res
->
filename
()
<<
"to the database"
;
}
}
return
true
;
}
...
...
libs/resources/KisResourceCacheDb.h
View file @
63823205
...
...
@@ -66,6 +66,7 @@ private:
~
KisResourceCacheDb
();
KisResourceCacheDb
operator
=
(
const
KisResourceCacheDb
&
);
static
bool
addResource
(
KoResourceSP
resource
);
static
bool
addResources
(
KisResourceStorageSP
storage
,
QString
folder
);
static
bool
addStorage
(
KisResourceStorageSP
storage
,
bool
preinstalled
);
static
bool
synchronize
(
KisResourceStorageSP
storage
);
...
...
libs/resources/KisResourceStorage.cpp
View file @
63823205
...
...
@@ -19,9 +19,15 @@
#include "KisResourceStorage.h"
#include <QFileInfo>
#include <kzip.h>
#include <QFileInfo>
#include "KisStoragePlugin.h"
#include "KisFolderStorage.h"
#include "KisBundleStorage.h"
#include "KisAbrStorage.h"
#include "KisAslStorage.h"
class
KisResourceStorage
::
Private
{
public:
...
...
@@ -29,6 +35,7 @@ public:
QString
location
;
bool
valid
{
false
};
KisResourceStorage
::
StorageType
storageType
{
KisResourceStorage
::
StorageType
::
Unknown
};
QScopedPointer
<
KisStoragePlugin
>
storagePlugin
;
};
...
...
@@ -38,21 +45,25 @@ KisResourceStorage::KisResourceStorage(const QString &location)
d
->
location
=
location
;
QFileInfo
fi
(
d
->
location
);
if
(
fi
.
isDir
())
{
d
->
storagePlugin
.
reset
(
new
KisFolderStorage
(
location
));
d
->
name
=
location
;
d
->
storageType
=
StorageType
::
Folder
;
d
->
valid
=
fi
.
isWritable
();
}
else
{
if
(
d
->
location
.
endsWith
(
".bundle"
))
{
d
->
storagePlugin
.
reset
(
new
KisBundleStorage
(
location
));
d
->
storageType
=
StorageType
::
Bundle
;
// XXX: should we also check whether there's a valid metadata entry? Or is this enough?
d
->
valid
=
(
fi
.
isReadable
()
&&
KZip
(
d
->
location
).
open
(
QIODevice
::
ReadOnly
));
}
else
if
(
d
->
location
.
endsWith
(
".abr"
))
{
d
->
storagePlugin
.
reset
(
new
KisAbrStorage
(
location
));
d
->
storageType
=
StorageType
::
AdobeBrushLibrary
;
d
->
valid
=
fi
.
isReadable
();
}
else
if
(
d
->
location
.
endsWith
(
".asl"
))
{
d
->
storagePlugin
.
reset
(
new
KisAslStorage
(
location
));
d
->
storageType
=
StorageType
::
AdobeStyleLibrary
;
d
->
valid
=
fi
.
isReadable
();
}
...
...
@@ -83,14 +94,24 @@ QDateTime KisResourceStorage::timestamp() const
return
QFileInfo
(
d
->
location
).
lastModified
();
}
KisResourceStorage
::
ResourceItem
KisResourceStorage
::
resourceItem
(
const
QString
&
url
)
{
return
d
->
storagePlugin
->
resourceItem
(
url
);
}
KisResourceStorage
::
ResourceItemIterator
KisResourceStorage
::
resourceItems
(
const
QString
&
resourceType
)
{
return
d
->
storagePlugin
->
resourceItems
(
resourceType
);
}
KoResourceSP
KisResourceStorage
::
resource
(
const
QString
&
url
)
{
return
0
;
return
d
->
storagePlugin
->
resource
(
url
)
;
}
QVector
<
KoResourceSP
>
KisResourceStorage
::
resources
(
const
QString
&
resourceType
)
KisResourceStorage
::
ResourceIterator
KisResourceStorage
::
resources
(
const
QString
&
resourceType
)
{
return
QVector
<
KoResourceSP
>
(
);
return
d
->
storagePlugin
->
resources
(
resourceType
);
}
...
...
libs/resources/KisResourceStorage.h
View file @
63823205
...
...
@@ -30,6 +30,7 @@
#include <kritaresources_export.h>
/**
* The KisResourceStorage class is the base class for
* places where resources can be stored. Examples are
...
...
@@ -40,9 +41,42 @@ class KRITARESOURCES_EXPORT KisResourceStorage
{
public:
/// XXX: replace the default implementations with = 0 when all iterators have been implemented
/// A resource item is simply an entry in the storage,
struct
ResourceItem
{
virtual
~
ResourceItem
()
{}
QString
url
;
QString
type
;
QDateTime
lastModified
;
virtual
QByteArray
md5sum
()
const
{
return
QByteArray
();}
};
class
ResourceItemIterator
{
public:
virtual
~
ResourceItemIterator
()
{}
virtual
bool
hasNext
()
const
{
return
false
;};
virtual
void
next
()
const
{};
virtual
QString
url
()
const
{
return
QString
();}
virtual
QString
type
()
const
{
return
QString
();}
virtual
QDateTime
lastModified
()
const
{
return
QDateTime
();}
virtual
QByteArray
md5sum
()
const
{
return
QByteArray
();}
};
class
ResourceIterator
:
public
ResourceItemIterator
{
public:
virtual
~
ResourceIterator
()
{}
virtual
KoResourceSP
resource
()
const
{
return
0
;}
};
enum
class
StorageType
:
int
{
...
...
@@ -62,8 +96,12 @@ public:
StorageType
type
()
const
;
QDateTime
timestamp
()
const
;
ResourceItem
resourceItem
(
const
QString
&
url
);
ResourceItemIterator
resourceItems
(
const
QString
&
resourceType
);
KoResourceSP
resource
(
const
QString
&
url
);
QVector
<
KoResourceSP
>
resources
(
const
QString
&
resourceType
);
ResourceIterator
resources
(
const
QString
&
resourceType
);
private:
class
Private
;
...
...
libs/resources/KisStoragePlugin.cpp
0 → 100644
View file @
63823205
/*
* Copyright (C) 2018 Boudewijn Rempt <boud@valdyas.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "KisStoragePlugin.h"
class
KisStoragePlugin
::
Private
{
public:
QString
location
;
};
KisStoragePlugin
::
KisStoragePlugin
(
const
QString
&
location
)
:
d
(
new
Private
())
{
d
->
location
=
location
;
}
KisStoragePlugin
::~
KisStoragePlugin
()
{
}
QString
KisStoragePlugin
::
location
()
const
{
return
d
->
location
;
}
libs/resources/KisStoragePlugin.h
0 → 100644
View file @
63823205
/*
* Copyright (C) 2018 Boudewijn Rempt <boud@valdyas.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KISSTORAGEPLUGIN_H
#define KISSTORAGEPLUGIN_H
#include <QScopedPointer>
#include <QString>
#include <KisResourceStorage.h>
/**
* The KisResourceStoragePlugin class is the base class
* for storage plugins. A storage plugin is used by
* KisResourceStorage to locate resources and tags in
* a kind of storage, like a folder, a bundle or an adobe
* resource library.
*/
class
KisStoragePlugin
{
public:
KisStoragePlugin
(
const
QString
&
location
);
virtual
~
KisStoragePlugin
();
virtual
KisResourceStorage
::
ResourceItem
resourceItem
(
const
QString
&
url
)
=
0
;
virtual
KisResourceStorage
::
ResourceItemIterator
resourceItems
(
const
QString
&
resourceType
)
=
0
;
virtual
KoResourceSP
resource
(
const
QString
&
url
)
=
0
;
virtual
KisResourceStorage
::
ResourceIterator
resources
(
const
QString
&
resourceType
)
=
0
;
protected:
QString
location
()
const
;
private:
class
Private
;
QScopedPointer
<
Private
>
d
;
};
#endif // KISSTORAGEPLUGIN_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment