File indexing completed on 2024-11-03 07:45:45

0001 /*
0002 
0003  * SPDX-FileCopyrightText: 2016 Riccardo Iaconelli <riccardo@kde.org>
0004  * SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.0-or-later
0007  *
0008  */
0009 
0010 #pragma once
0011 
0012 #include "config-ruqola.h"
0013 #include "libruqolacore_export.h"
0014 #include <QObject>
0015 
0016 class RocketChatAccount;
0017 class AccountManager;
0018 namespace TextAutoCorrection
0019 {
0020 class AutoCorrection;
0021 }
0022 namespace TextAutoCorrectionCore
0023 {
0024 class AutoCorrection;
0025 }
0026 class CustomEmojiIconManager;
0027 class LIBRUQOLACORE_EXPORT Ruqola : public QObject
0028 {
0029     Q_OBJECT
0030 public:
0031     ~Ruqola() override;
0032     /**
0033      * @brief Singleton provider
0034      *
0035      * @return Returns the singleton object
0036      */
0037     static Ruqola *self();
0038 
0039     static void destroy();
0040     RocketChatAccount *rocketChatAccount() const;
0041 
0042     AccountManager *accountManager() const;
0043 
0044     explicit Ruqola(QObject *parent = nullptr);
0045 
0046     void setCurrentAccount(const QString &accountName);
0047 
0048     void openMessageUrl(const QString &url);
0049 #if HAVE_TEXT_AUTOCORRECTION_WIDGETS
0050     TextAutoCorrectionCore::AutoCorrection *autoCorrection() const;
0051 #endif
0052 
0053     CustomEmojiIconManager *customEmojiIconManager() const;
0054 
0055     [[nodiscard]] bool debug() const;
0056 
0057 Q_SIGNALS:
0058     void translatorMenuChanged();
0059 
0060 private:
0061     Q_DISABLE_COPY(Ruqola)
0062     AccountManager *mAccountManager = nullptr;
0063 #if HAVE_TEXT_AUTOCORRECTION_WIDGETS
0064     TextAutoCorrectionCore::AutoCorrection *const mAutoCorrection = nullptr;
0065 #endif
0066 
0067     CustomEmojiIconManager *const mCustomEmojiIconManager;
0068     bool mDebug = false;
0069 };