File indexing completed on 2024-05-12 05:22:15

0001 /*
0002  * This file is part of LibKGAPI library
0003  *
0004  * SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #pragma once
0010 
0011 #include <QSharedPointer>
0012 #include <QString>
0013 
0014 #include "kgapicore_export.h"
0015 #include "types.h"
0016 
0017 namespace KGAPI2
0018 {
0019 
0020 /**
0021  * @brief Base class for all objects
0022  *
0023  * There are many container classes to represent data fetched from Google servers,
0024  * like KGAPI2::Contact, KGAPI2::Event, etc. All these container classes must
0025  * be subclasses of the KGAPI2::Object.
0026  *
0027  * @author Daniel Vrátil <dvratil@redhat.com>
0028  * @since 2.0
0029  */
0030 class KGAPICORE_EXPORT Object
0031 {
0032 public:
0033     /**
0034      * @brief Constructor
0035      */
0036     Object();
0037 
0038     /**
0039      * @brief Copy constructor
0040      */
0041     Object(const Object &other);
0042 
0043     /**
0044      * @brief Destructor
0045      */
0046     virtual ~Object();
0047 
0048     bool operator==(const Object &other) const;
0049 
0050     /**
0051      * @brief Set the etag of this object.
0052      *
0053      * Etag represents a revision of an object. When the object is changed on the
0054      * remote side it is given a new etag.
0055      *
0056      * @param etag
0057      */
0058     void setEtag(const QString &etag);
0059 
0060     /**
0061      * @brief Returns etag of this object.
0062      *
0063      * @return Etag string
0064      */
0065     [[nodiscard]] QString etag() const;
0066 
0067 private:
0068     class Private;
0069     Private *const d;
0070     friend class Private;
0071 };
0072 
0073 } // namespace KGAPI2