6 #ifndef C_UTILS_LANGSELECT_H
7 #define C_UTILS_LANGSELECT_H
9 #include <Cutelyst/cutelyst_global.h>
10 #include <Cutelyst/plugin.h>
35 class LangSelectPrivate;
350 void setSupportedLocales(
const QVector<QLocale> &locales);
358 void setSupportedLocales(
const QStringList &locales);
364 void addSupportedLocale(
const QLocale &locale);
371 void addSupportedLocale(
const QString &locale);
395 void setLocalesFromDir(
const QString &path,
const QString &name,
const QString &prefix = QStringLiteral(
"."),
const QString &suffix = QStringLiteral(
".qm"));
418 void setLocalesFromDirs(
const QString &path,
const QString &name);
424 QVector<QLocale> supportedLocales()
const;
429 void setQueryKey(
const QString &key);
434 void setSessionKey(
const QString &key);
439 void setCookieName(
const QString &name);
446 void setSubDomainMap(
const QMap<QString,QLocale> &map);
453 void setDomainMap(
const QMap<QString,QLocale> &map);
458 void setFallbackLocale(
const QLocale &fallback);
465 void setDetectFromHeader(
bool enabled);
470 void setLanguageCodeStashKey(
const QString &key = QStringLiteral(
"c_langselect_lang"));
476 void setLanguageDirStashKey(
const QString &key = QStringLiteral(
"c_langselect_dir"));
482 static QVector<QLocale> getSupportedLocales();
501 static bool fromUrlQuery(
Context *c,
const QString &key = QString());
518 static bool fromSession(
Context *c,
const QString &key = QString());
535 static bool fromCookie(
Context *c,
const QString &name = QString());
550 static bool fromSubDomain(
Context *c,
const QMap<QString, QLocale> &subDomainMap = QMap<QString, QLocale>());
565 static bool fromDomain(
Context *c,
const QMap<QString, QLocale> &domainMap = QMap<QString, QLocale>());
581 static bool fromPath(
Context *c,
const QString &locale);
593 LangSelectPrivate *
const d_ptr;
The Cutelyst Application.
Language selection plugin.
The Cutelyst namespace holds all public Cutelyst API.