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

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 "kgapicalendar_export.h"
0012 #include "object.h"
0013 #include "types.h"
0014 
0015 #include <QColor>
0016 #include <QScopedPointer>
0017 
0018 namespace KGAPI2
0019 {
0020 
0021 /**
0022  * @brief An object that represents a Google calendar.
0023  *
0024  * @author Daniel Vrátil <dvratil@redhat.com>
0025  * @since 0.1
0026  */
0027 class KGAPICALENDAR_EXPORT Calendar : public KGAPI2::Object
0028 {
0029 public:
0030     /**
0031      * @brief Constructor
0032      */
0033     explicit Calendar();
0034 
0035     /**
0036      * @brief Copy constructor
0037      */
0038     Calendar(const Calendar &other);
0039 
0040     /**
0041      * @brief Destructor
0042      */
0043     ~Calendar() override;
0044 
0045     bool operator==(const Calendar &other) const;
0046 
0047     /**
0048      * @brief Returns uID of the calendar.
0049      */
0050     [[nodiscard]] QString uid() const;
0051 
0052     /**
0053      * @brief Sets UID of the calendar.
0054      *
0055      * @param uid
0056      */
0057     void setUid(const QString &uid);
0058 
0059     /**
0060      * @brief Returns calendar title (name).
0061      */
0062     [[nodiscard]] QString title() const;
0063 
0064     /**
0065      * @brief Sets a calendar title (name).
0066      *
0067      * @param title
0068      */
0069     void setTitle(const QString &title);
0070 
0071     /**
0072      * @brief Returns detailed description of the calendar.
0073      */
0074     [[nodiscard]] QString details() const;
0075 
0076     /**
0077      * @brief Sets detailed description of a calendar.
0078      *
0079      * @param details
0080      */
0081     void setDetails(const QString &details);
0082 
0083     /**
0084      * @brief Returns geographic location of the calendar.
0085      */
0086     [[nodiscard]] QString location() const;
0087 
0088     /**
0089      * @brief Sets geographic location of the calendar.
0090      *
0091      * @param location
0092      */
0093     void setLocation(const QString &location);
0094 
0095     /**
0096      * @brief Returns timezone of the calendar.
0097      */
0098     [[nodiscard]] QString timezone() const;
0099 
0100     /**
0101      * @brief Sets timezone of the calendar.
0102      *
0103      * @param timezone
0104      */
0105     void setTimezone(const QString &timezone);
0106 
0107     /**
0108      * @brief Returns whether calendar is editable or read-only.
0109      */
0110     [[nodiscard]] bool editable() const;
0111 
0112     /**
0113      * @brief Sets calendar to read-only or editable.
0114      *
0115      * @param editable
0116      */
0117     void setEditable(const bool editable);
0118 
0119     /**
0120      * @brief Sets default reminders for all new events in the calendar.
0121      *
0122      * @param reminders
0123      */
0124     void setDefaultReminders(const RemindersList &reminders);
0125 
0126     /**
0127      * @brief Adds a default reminder for all events in the calendar.
0128      *
0129      * @param reminder
0130      */
0131     void addDefaultReminer(const ReminderPtr &reminder);
0132 
0133     /**
0134      * @brief Returns default reminders for all events in the calendar.
0135      */
0136     RemindersList defaultReminders() const;
0137 
0138     /**
0139      * @brief Returns calendar background color.
0140      *
0141      * @since 2.1
0142      */
0143     [[nodiscard]] QColor backgroundColor() const;
0144 
0145     /**
0146      * @brief Sets calendar background color.
0147      *
0148      * @param color
0149      *
0150      * @since 2.1
0151      */
0152     void setBackgroundColor(const QColor &color);
0153 
0154     /**
0155      * @brief Returns calendar foreground color.
0156      *
0157      * @since 2.1
0158      */
0159     [[nodiscard]] QColor foregroundColor() const;
0160 
0161     /**
0162      * @brief Sets calendar foreground color
0163      *
0164      * @param color
0165      *
0166      * @since 2.1
0167      */
0168     void setForegroundColor(const QColor &color);
0169 
0170 protected:
0171     class Private;
0172     QScopedPointer<Private> const d;
0173 };
0174 
0175 } // namespace KGAPI2