Akonadi

preprocessorbase.h
1 /******************************************************************************
2  *
3  * Copyright (c) 2009 Szymon Stefanek <s.stefanek at gmail dot com>
4  *
5  * This library is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU Library General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13  * License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to the
17  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18  * MA, 02110-1301, USA.
19  *
20  *****************************************************************************/
21 
22 #ifndef AKONADI_PREPROCESSORBASE_H
23 #define AKONADI_PREPROCESSORBASE_H
24 
25 #include "akonadiagentbase_export.h"
26 #include "agentbase.h"
27 #include "collection.h"
28 #include "item.h"
29 
30 namespace Akonadi
31 {
32 
33 class ItemFetchScope;
34 
35 class PreprocessorBasePrivate;
36 
54 class AKONADIAGENTBASE_EXPORT PreprocessorBase : public AgentBase
55 {
56  Q_OBJECT
57 
58 public:
68 
77 
84 
93  ProcessingRefused
94  };
95 
114  virtual ProcessingResult processItem(const Item &item) = 0;
115 
127  void finishProcessing(ProcessingResult result);
128 
140  void setFetchScope(const ItemFetchScope &fetchScope);
141 
154  ItemFetchScope &fetchScope();
155 
156 protected:
162  PreprocessorBase(const QString &id);
163 
167  ~PreprocessorBase() override;
168 
169 private:
170  //@cond PRIVATE
171  Q_DECLARE_PRIVATE(PreprocessorBase)
172  //@endcond
173 
174 }; // class PreprocessorBase
175 
176 } // namespace Akonadi
177 
178 #ifndef AKONADI_PREPROCESSOR_MAIN
179 
182 #define AKONADI_PREPROCESSOR_MAIN( preProcessorClass ) \
183  int main( int argc, char **argv ) \
184  { \
185  return Akonadi::PreprocessorBase::init<preProcessorClass>( argc, argv ); \
186  }
187 #endif
188 
189 #endif
ProcessingResult
Describes the possible return values of the processItem() method.
Processing completed successfully for this item.
The base class for all Akonadi agents and resources.
Definition: agentbase.h:84
Processing was delayed to a later stage.
Specifies which parts of an item should be fetched from the Akonadi storage.
The base class for all Akonadi preprocessor agents.
Helper integration between Akonadi and Qt.
Processing for this item failed (and the failure is unrecoverable).
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 23:08:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.