File indexing completed on 2024-06-23 05:06:49
0001 /* 0002 SPDX-FileCopyrightText: 2013 Christian Mollekopf <mollekopf@kolabsys.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QObject> 0010 0011 namespace Akonadi 0012 { 0013 class Item; 0014 0015 /** 0016 * @short An interface to extract the GID of an object contained in an akonadi item. 0017 * 0018 * @author Christian Mollekopf <mollekopf@kolabsys.com> 0019 * @since 4.11 0020 */ 0021 class GidExtractorInterface 0022 { 0023 public: 0024 /** 0025 * Destructor. 0026 */ 0027 virtual ~GidExtractorInterface() 0028 { 0029 } 0030 /** 0031 * Extracts the globally unique id of @p item 0032 * 0033 * If you want to clear the gid from the database return QString(""). 0034 */ 0035 virtual QString extractGid(const Item &item) const = 0; 0036 0037 protected: 0038 explicit GidExtractorInterface() = default; 0039 0040 private: 0041 Q_DISABLE_COPY_MOVE(GidExtractorInterface) 0042 }; 0043 0044 } 0045 0046 Q_DECLARE_INTERFACE(Akonadi::GidExtractorInterface, "org.freedesktop.Akonadi.GidExtractorInterface/1.0")