18 #ifndef CUTELYSTVALIDATOREMAIL_H
19 #define CUTELYSTVALIDATOREMAIL_H
21 #include <Cutelyst/cutelyst_global.h>
22 #include "validatorrule.h"
26 class ValidatorEmailPrivate;
74 DnsWarnNoMxRecord = 5,
78 RFC5321TLDNumberic = 10,
79 RFC5321QuotedString = 11,
80 RFC5321AddressLiteral = 12,
81 RFC5321IPv6Deprecated = 13,
86 DeprecatedLocalpart = 33,
90 DeprecatedComment = 37,
92 DeprecatedCFWSNearAt = 49,
96 RFC5322LocalTooLong = 67,
97 RFC5322DomainTooLong = 68,
98 RFC5322LabelTooLong = 69,
99 RFC5322DomainLiteral = 70,
100 RFC5322DomLitOBSDText = 71,
101 RFC5322IPv6GroupCount = 72,
102 RFC5322IPv62x2xColon = 73,
103 RFC5322IPv6BadChar = 74,
104 RFC5322IPv6MaxGroups = 75,
105 RFC5322IPv6ColonStart = 76,
106 RFC5322IPv6ColonEnd = 77,
108 ErrorExpectingDText = 129,
109 ErrorNoLocalPart = 130,
111 ErrorConsecutiveDots = 132,
112 ErrorATextAfterCFWS = 133,
113 ErrorATextAfterQS = 134,
114 ErrorATextAfterDomLit = 135,
115 ErrorExpectingQpair = 136,
116 ErrorExpectingAText = 137,
117 ErrorExpectingQText = 138,
118 ErrorExpectingCText = 139,
119 ErrorBackslashEnd = 140,
122 ErrorDomainHyphenStart = 143,
123 ErrorDomainHyphenEnd = 144,
124 ErrorUnclosedQuotedStr = 145,
125 ErrorUnclosedComment = 146,
126 ErrorUnclosedDomLiteral = 147,
127 ErrorFWSCRLFx2 = 148,
128 ErrorFWSCRLFEnd = 149,
139 AllowUTF8 = UTF8Local|AllowIDN
141 Q_DECLARE_FLAGS(Options, Option)
164 static QString diagnoseString(
Context *c, Diagnose diagnose,
const QString &label = QString());
173 static QString categoryString(
Context *c, Category category,
const QString &label = QString());
180 static Category category(Diagnose diagnose);
189 static QString categoryString(
Context *c, Diagnose diagnose,
const QString &label = QString());
200 static bool validate(
const QString &email, Category threshold = RFC5321, Options options = NoOption, QList<Diagnose> *diagnoses =
nullptr);
215 QString genericValidationError(
Context *c,
const QVariant &errorData = QVariant())
const override;
224 Q_DECLARE_OPERATORS_FOR_FLAGS(Cutelyst::ValidatorEmail::Options)
226 #endif //CUTELYSTVALIDATOREMAIL_H