File indexing completed on 2024-04-28 03:51:00

0001 /****************************************************************************
0002 **
0003 ** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
0004 **
0005 ** This program is free software; you can redistribute it and/or
0006 ** modify it under the terms of the GNU General Public License as
0007 ** published by the Free Software Foundation; either version 2 of
0008 ** the License or (at your option) version 3 or any later version
0009 ** accepted by the membership of KDE e.V. (or its successor approved
0010 ** by the membership of KDE e.V.), which shall act as a proxy
0011 ** defined in Section 14 of version 3 of the license.
0012 **
0013 ** This program is distributed in the hope that it will be useful,
0014 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
0015 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0016 ** GNU General Public License for more details.
0017 **
0018 ** You should have received a copy of the GNU General Public License
0019 ** along with this program.  If not, see <http://www.gnu.org/licenses/>.
0020 **
0021 ****************************************************************************/
0022 
0023 #ifndef MINUET_UICONTROLLER_H
0024 #define MINUET_UICONTROLLER_H
0025 
0026 #include <interfaces/iuicontroller.h>
0027 
0028 #ifdef Q_OS_ANDROID
0029 #include <QVariant>
0030 
0031 class DummyAndroidLocalizer : public QObject
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036     explicit DummyAndroidLocalizer(QObject *parent = 0) : QObject(parent) {}
0037 
0038     Q_INVOKABLE QString i18n(const QString &message, const QVariant &p1 = QVariant(),
0039                              const QVariant &p2 = QVariant(), const QVariant &p3 = QVariant(),
0040                              const QVariant &p4 = QVariant(), const QVariant &p5 = QVariant(),
0041                              const QVariant &p6 = QVariant(), const QVariant &p7 = QVariant(),
0042                              const QVariant &p8 = QVariant(), const QVariant &p9 = QVariant(),
0043                              const QVariant &p10 = QVariant()) const
0044     {
0045         return message;
0046     }
0047 
0048     Q_INVOKABLE QString i18nc(const QString &context, const QString &message,
0049                               const QVariant &p1 = QVariant(), const QVariant &p2 = QVariant(),
0050                               const QVariant &p3 = QVariant(), const QVariant &p4 = QVariant(),
0051                               const QVariant &p5 = QVariant(), const QVariant &p6 = QVariant(),
0052                               const QVariant &p7 = QVariant(), const QVariant &p8 = QVariant(),
0053                               const QVariant &p9 = QVariant(),
0054                               const QVariant &p10 = QVariant()) const
0055     {
0056         return message;
0057     }
0058 };
0059 #endif
0060 
0061 namespace Minuet
0062 {
0063 class Core;
0064 
0065 class UiController : public IUiController
0066 {
0067     Q_OBJECT
0068 
0069 public:
0070     explicit UiController(QObject *parent = nullptr);
0071     ~UiController() override = default;
0072 
0073     bool initialize(Core *core);
0074     virtual QString errorString() const override;
0075 
0076 private:
0077     QString m_errorString;
0078 };
0079 
0080 }
0081 
0082 #endif