Akonadi

mimetypechecker.h
1 /*
2  Copyright (c) 2009 Kevin Krammer <[email protected]>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef MIMETYPECHECKER_H
21 #define MIMETYPECHECKER_H
22 
23 #include "akonadicore_export.h"
24 
25 #include <QSharedDataPointer>
26 
27 class QString;
28 class QStringList;
29 
30 namespace Akonadi
31 {
32 class Collection;
33 class Item;
34 class MimeTypeCheckerPrivate;
35 
110 class AKONADICORE_EXPORT MimeTypeChecker
111 {
112 public:
118  MimeTypeChecker();
119 
123  MimeTypeChecker(const MimeTypeChecker &other);
124 
128  ~MimeTypeChecker();
129 
133  MimeTypeChecker &operator=(const MimeTypeChecker &other);
134 
143  Q_REQUIRED_RESULT QStringList wantedMimeTypes() const;
144 
152  Q_REQUIRED_RESULT bool hasWantedMimeTypes() const;
153 
161  void setWantedMimeTypes(const QStringList &mimeTypes);
162 
170  void addWantedMimeType(const QString &mimeType);
171 
179  void removeWantedMimeType(const QString &mimeType);
180 
192  Q_REQUIRED_RESULT bool isWantedItem(const Item &item) const;
193 
206  Q_REQUIRED_RESULT bool isWantedCollection(const Collection &collection) const;
207 
218  Q_REQUIRED_RESULT bool isWantedMimeType(const QString &mimeType) const;
219 
230  Q_REQUIRED_RESULT bool containsWantedMimeType(const QStringList &mimeTypes) const;
231 
244  Q_REQUIRED_RESULT static bool isWantedItem(const Item &item, const QString &wantedMimeType);
245 
259  Q_REQUIRED_RESULT static bool isWantedCollection(const Collection &collection, const QString &wantedMimeType);
260 
261 private:
262  //@cond PRIVATE
264  //@endcond
265 };
266 
267 }
268 
269 #endif
Represents a collection of PIM items.
Definition: collection.h:76
Helper for checking MIME types of Collections and Items.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon May 25 2020 22:46:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.