KTextAddons

translator.h
1/*
2 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6#pragma once
7#include "libbergamot_private_export.h"
8#include <QJsonObject>
9
10class LIBBERGAMOT_TESTS_EXPORT Translator
11{
12public:
13 Translator();
14 ~Translator();
15
16 void parse(const QJsonObject &obj, bool remote = true);
17
18 [[nodiscard]] QString shortName() const;
19 void setShortName(const QString &newShortName);
20
21 [[nodiscard]] QString modelName() const;
22 void setModelName(const QString &newModelName);
23
24 [[nodiscard]] QString source() const;
25 void setSource(const QString &newSource);
26
27 [[nodiscard]] QString checkSum() const;
28 void setCheckSum(const QString &newCheckSum);
29
30 [[nodiscard]] QString target() const;
31 void setTarget(const QString &newTarget);
32
33 [[nodiscard]] int version() const;
34 void setVersion(int newVersion);
35
36 [[nodiscard]] int api() const;
37 void setApi(int newApi);
38
39 [[nodiscard]] QString url() const;
40 void setUrl(const QString &newUrl);
41
42 [[nodiscard]] QString repository() const;
43 void setRepository(const QString &newRepository);
44
45 [[nodiscard]] QString type() const;
46 void setType(const QString &newType);
47
48 [[nodiscard]] bool isValid() const;
49
50 [[nodiscard]] bool operator==(const Translator &other) const;
51
52 [[nodiscard]] bool remote() const;
53 void setRemote(bool newRemote);
54
55private:
56 QString mShortName;
57 QString mModelName;
58 QString mSource;
59 QString mTarget;
60 QString mCheckSum;
61 QString mRepository;
62 QString mUrl;
63 QString mType;
64 int mVersion = -1;
65 int mApi = -1;
66 bool mRemote = true;
67};
68LIBBERGAMOT_EXPORT QDebug operator<<(QDebug d, const Translator &t);
69Q_DECLARE_METATYPE(Translator)
70Q_DECLARE_TYPEINFO(Translator, Q_MOVABLE_TYPE);
void setTarget(const SkyPoint &targetCoord)
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
KDB_EXPORT KDbVersionInfo version()
bool isValid(QStringView ifopt)
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
bool operator==(const StyleDelim &l, const StyleDelim &r)
FeedPtr parse(const DocumentSource &src, const QString &formatHint=QString())
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.