Libksieve

sieveeditorutil.cpp
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
6 
7 #include "sieveeditorutil.h"
8 
9 QUrl KSieveUi::SieveEditorUtil::helpUrl(KSieveUi::SieveEditorUtil::HelpVariableName type)
10 {
11  switch (type) {
12  case AddressCondition:
13  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5228#page-16"));
14  case BodyCondition:
15  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5173"));
16  case ConvertCondition:
17  return QUrl(); // TODO
18  case CurrentdateCondition:
19  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5260#page-6"));
20  case DateCondition:
21  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5260#page-4"));
22  case EnvelopeCondition:
23  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-24"));
24  case EnvironmentCondition:
25  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5183"));
26  case ExistsCondition:
27  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-25"));
28  case FalseCondition:
29  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-25"));
30  case HasflagCondition:
31  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5232#page-5"));
32  case HeaderCondition:
33  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5228#page-9"));
34  case IhaveCondition:
35  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5463"));
36  case MailboxexistsCondition:
37  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5490#page-2"));
38  case MetadataexistsCondition:
39  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5490#page-6"));
40  case MetadataCondition:
41  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5490#page-5"));
42  case ServermetadataexistsCondition:
43  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5490#page-4"));
44  case ServermetadataCondition:
45  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5490#page-5"));
46  case SizeCondition:
47  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-26"));
48  case SpamtestCondition:
49  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3685#page-3"));
50  case TrueCondition:
51  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-26"));
52  case NotCondition:
53  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-26"));
54  case AnyOf:
55  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-24"));
56  case Allof:
57  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-23"));
58  case VirustestCondition:
59  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3685#page-4"));
60  case AbstracteditheaderAction:
61  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5228#page-9"));
62  case AddflagsAction:
63  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5232#page-5"));
64  case AddheaderAction:
65  case DeleteheaderAction:
66  case EditHeaderExtension:
67  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5293"));
68  case BreakAction:
69  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5703#page-3"));
70  case ConvertAction:
71  return QUrl(); // TODO
72  case DiscardAction:
73  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-22"));
74  case EncloseAction:
75  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5703#page-10"));
76  case ExtracttextAction:
77  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5703#page-11"));
78  case FileintoAction:
79  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-20"));
80  case KeepAction:
81  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-21"));
82  case NotifyAction:
83  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5435#page-3"));
84  case RedirectAction:
85  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-20"));
86  case RejectAction:
87  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-20"));
88  case ERejectAction:
89  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5429#section-2.1"));
90  case RemoveflagsAction:
91  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5232#page-5"));
92  case ReplaceAction:
93  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5703#page-8"));
94  case ReturnAction:
95  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc6609#page-7"));
96  case SetflagsAction:
97  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5232#page-4"));
98  case SetvariableAction:
99  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5229"));
100  case StopAction:
101  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3028#page-19"));
102  case VacationAction:
103  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5230#page-3"));
104  case GlobalVariable:
105  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5229"));
106  case Includes:
107  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc6609#page-4"));
108  case ForEveryPart:
109  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5703#page-3"));
110  case CopyExtension:
111  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc3894"));
112  case MBoxMetaDataExtension:
113  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5490#page-2"));
114  case SubAddressExtension:
115  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5233"));
116  case ImapFlagsExtension:
117  return QUrl(QStringLiteral("https://tools.ietf.org/html/rfc5232"));
118  case UnknownHelp:
119  break;
120  }
121  return QUrl();
122 }
123 
124 KSieveUi::SieveEditorUtil::HelpVariableName KSieveUi::SieveEditorUtil::strToVariableName(const QString &str)
125 {
126  if (str == QLatin1String("address")) {
127  return AddressCondition;
128  } else if (str == QLatin1String("body")) {
129  return BodyCondition;
130  } else if (str == QLatin1String("currentdate")) {
131  return CurrentdateCondition;
132  } else if (str == QLatin1String("date")) {
133  return DateCondition;
134  } else if (str == QLatin1String("envelope")) {
135  return EnvelopeCondition;
136  } else if (str == QLatin1String("environment")) {
137  return EnvironmentCondition;
138  } else if (str == QLatin1String("exists")) {
139  return ExistsCondition;
140  } else if (str == QLatin1String("false")) {
141  return FalseCondition;
142  } else if (str == QLatin1String("hasflag")) {
143  return HasflagCondition;
144  } else if (str == QLatin1String("header")) {
145  return HeaderCondition;
146  } else if (str == QLatin1String("ihave")) {
147  return IhaveCondition;
148  } else if (str == QLatin1String("mailboxexists")) {
149  return MailboxexistsCondition;
150  } else if (str == QLatin1String("metadata")) {
151  return MetadataCondition;
152  } else if (str == QLatin1String("metadataexists")) {
153  return MetadataexistsCondition;
154  } else if (str == QLatin1String("servermetadata")) {
155  return ServermetadataCondition;
156  } else if (str == QLatin1String("servermetadataexists")) {
157  return ServermetadataexistsCondition;
158  } else if (str == QLatin1String("size")) {
159  return SizeCondition;
160  } else if (str == QLatin1String("spamtest")) {
161  return SpamtestCondition;
162  } else if (str == QLatin1String("true")) {
163  return TrueCondition;
164  } else if (str == QLatin1String("not")) {
165  return NotCondition;
166  } else if (str == QLatin1String("anyof")) {
167  return AnyOf;
168  } else if (str == QLatin1String("allof")) {
169  return Allof;
170  } else if (str == QLatin1String("virustest")) {
171  return VirustestCondition;
172  } else if (str == QLatin1String("break")) {
173  return BreakAction;
174  } else if (str == QLatin1String("convert")) {
175  return ConvertAction; // TODO
176  } else if (str == QLatin1String("discard")) {
177  return DiscardAction;
178  } else if (str == QLatin1String("enclose")) {
179  return EncloseAction;
180  } else if (str == QLatin1String("extracttext")) {
181  return ExtracttextAction;
182  } else if (str == QLatin1String("fileinto")) {
183  return FileintoAction;
184  } else if (str == QLatin1String("keep")) {
185  return KeepAction;
186  } else if (str == QLatin1String("notify")) {
187  return NotifyAction;
188  } else if (str == QLatin1String("redirect")) {
189  return RedirectAction;
190  } else if (str == QLatin1String("reject")) {
191  return RejectAction;
192  } else if (str == QLatin1String("ereject")) {
193  return ERejectAction;
194  } else if (str == QLatin1String("replace")) {
195  return ReplaceAction;
196  } else if (str == QLatin1String("return")) {
197  return ReturnAction;
198  } else if (str == QLatin1String("set")) {
199  return SetvariableAction;
200  } else if (str == QLatin1String("stop")) {
201  return StopAction;
202  } else if (str == QLatin1String("vacation")) {
203  return VacationAction;
204  } else if (str == QLatin1String("include")) {
205  return Includes;
206  } else if (str == QLatin1String("globalvariable")) {
207  return GlobalVariable;
208  } else if (str == QLatin1String("foreverypart")) {
209  return ForEveryPart;
210  } else if (str == QLatin1String("copy")) {
211  return CopyExtension;
212  } else if (str == QLatin1String("mboxmetadata")) {
213  return MBoxMetaDataExtension;
214  } else if (str == QLatin1String("subaddress")) {
215  return SubAddressExtension;
216  } else if (str == QLatin1String("imapflags")) {
217  return ImapFlagsExtension;
218  } else if (str == QLatin1String("editheader")) {
219  return EditHeaderExtension;
220  }
221 
222  // TODO
223  return UnknownHelp;
224 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 16 2021 23:09:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.