File indexing completed on 2024-05-05 05:21:06

0001 /*
0002    SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #pragma once
0007 
0008 #include <Akonadi/AgentBase>
0009 class NotesManager;
0010 class NotesAgent : public Akonadi::AgentBase, public Akonadi::AgentBase::ObserverV3
0011 {
0012     Q_OBJECT
0013 public:
0014     explicit NotesAgent(const QString &id);
0015     ~NotesAgent() override;
0016 
0017     void showConfigureDialog(qlonglong windowId = 0);
0018 
0019     void setEnableAgent(bool b);
0020     [[nodiscard]] bool enabledAgent() const;
0021 
0022     void reload();
0023 
0024     [[nodiscard]] bool receiveNotes() const;
0025     void setReceiveNotes(bool b);
0026 
0027     void setPort(int value);
0028     [[nodiscard]] int port() const;
0029 
0030     [[nodiscard]] int alarmCheckInterval() const;
0031     void setAlarmCheckInterval(int value);
0032 
0033     void configurationChanged();
0034 
0035 public Q_SLOTS:
0036     void configure(WId windowId) override;
0037 
0038 protected:
0039     void doSetOnline(bool online) override;
0040 
0041 private:
0042     void slotStartAgent();
0043     bool mAgentInitialized = false;
0044     NotesManager *mNotesManager = nullptr;
0045 };