diff options
Diffstat (limited to 'common/specialpurposepreprocessor.h')
-rw-r--r-- | common/specialpurposepreprocessor.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/common/specialpurposepreprocessor.h b/common/specialpurposepreprocessor.h new file mode 100644 index 0000000..a33701b --- /dev/null +++ b/common/specialpurposepreprocessor.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015 Christian Mollekopf <chrigi_1@fastmail.fm> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
18 | */ | ||
19 | #include "sink_export.h" | ||
20 | |||
21 | #include "pipeline.h" | ||
22 | |||
23 | namespace SpecialPurpose { | ||
24 | bool SINK_EXPORT isSpecialPurposeFolderName(const QString &name); | ||
25 | QByteArray SINK_EXPORT getSpecialPurposeType(const QString &name); | ||
26 | } | ||
27 | |||
28 | class SINK_EXPORT SpecialPurposeProcessor : public Sink::Preprocessor | ||
29 | { | ||
30 | public: | ||
31 | SpecialPurposeProcessor(const QByteArray &resourceType, const QByteArray &resourceInstanceIdentifier); | ||
32 | |||
33 | QByteArray ensureFolder(Sink::Storage::Transaction &transaction, const QByteArray &specialPurpose); | ||
34 | |||
35 | void moveToFolder(Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::Transaction &transaction); | ||
36 | |||
37 | void newEntity(const QByteArray &uid, qint64 revision, Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE; | ||
38 | void modifiedEntity(const QByteArray &uid, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &oldEntity, Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE; | ||
39 | |||
40 | QHash<QByteArray, QByteArray> mSpecialPurposeFolders; | ||
41 | QByteArray mResourceType; | ||
42 | QByteArray mResourceInstanceIdentifier; | ||
43 | }; | ||