Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:07:40

0001 // Copyright (C) 2020 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QTRANSLATOR_H
0005 #define QTRANSLATOR_H
0006 
0007 #include <QtCore/qobject.h>
0008 #include <QtCore/qbytearray.h>
0009 
0010 QT_BEGIN_NAMESPACE
0011 
0012 
0013 #ifndef QT_NO_TRANSLATION
0014 
0015 class QLocale;
0016 class QTranslatorPrivate;
0017 
0018 class Q_CORE_EXPORT QTranslator : public QObject
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit QTranslator(QObject *parent = nullptr);
0023     ~QTranslator();
0024 
0025     virtual QString translate(const char *context, const char *sourceText,
0026                               const char *disambiguation = nullptr, int n = -1) const;
0027 
0028     virtual bool isEmpty() const;
0029 
0030     QString language() const;
0031     QString filePath() const;
0032 
0033     [[nodiscard]] bool load(const QString & filename,
0034                             const QString & directory = QString(),
0035                             const QString & search_delimiters = QString(),
0036                             const QString & suffix = QString());
0037     [[nodiscard]] bool load(const QLocale & locale,
0038                             const QString & filename,
0039                             const QString & prefix = QString(),
0040                             const QString & directory = QString(),
0041                             const QString & suffix = QString());
0042     [[nodiscard]] bool load(const uchar *data, int len,
0043                             const QString &directory = QString());
0044 
0045 private:
0046     Q_DISABLE_COPY(QTranslator)
0047     Q_DECLARE_PRIVATE(QTranslator)
0048 };
0049 
0050 #endif // QT_NO_TRANSLATION
0051 
0052 QT_END_NAMESPACE
0053 
0054 #endif // QTRANSLATOR_H