TreeFrogFramework  2.8
tfnamespace.h
Go to the documentation of this file.
1 #pragma once
2 class TWebApplication;
3 
9 namespace Tf {
10 
14 };
15 
19 };
20 
21 enum HttpMethod {
22  Invalid = 0,
23  Get,
27  Put,
32 };
33 
35  // Informational 1xx
36  Continue = 100,
38  // Successful 2xx
39  OK = 200,
40  Created = 201,
41  Accepted = 202,
43  NoContent = 204,
44  ResetContent = 205,
46  // Redirection 3xx
49  Found = 302,
50  SeeOther = 303,
51  NotModified = 304,
52  UseProxy = 305,
54  // Client Error 4xx
55  BadRequest = 400,
56  Unauthorized = 401,
58  Forbidden = 403,
59  NotFound = 404,
64  Conflict = 409,
65  Gone = 410,
73  // Server Error 5xx
76  BadGateway = 502,
80 };
81 
82 // Common options for AJAX
83 enum AjaxOption {
84  Asynchronous = 0, // true or false, default:true
85  ContentType, // default:"application/x-www-form-urlencoded"
86  Encoding, // default:"UTF-8"
87  Method, // Tf::Get or Tf::Post, default:Post
88  Parameters, // Default:null
89  PostBody, // Specific contents for the request body on a 'post' method
90  RequestHeaders, // See Prototype API docs
91  EvalJS, // true or false, default:true
92  EvalJSON, // true or false, default:true
93  SanitizeJSON, // true or false, See Prototype API docs
94 };
95 
96 enum AjaxEvent {
97  Create = 100, // Before request is initiated
98  Uninitialized, // Immediately after request is initiated and before loading
99  Loading, // When the remote response is being loaded by the browser
100  Loaded, // When the browser has finished loading the remote response
101  Interactive, // When the user can interact with the remote response, even though it has not finished loading
102  Success, // When the XMLHttpRequest is completed, and the HTTP status code is in the 2XX range
103  Failure, // When the XMLHttpRequest is completed, and the HTTP status code is not in the 2XX range
104  Complete, // When the XMLHttpRequest is complete (fires after success or failure, if they are present)
105 };
106 
108  Required = 0, // This value is required.
109  MaxLength, // This value is too long.
110  MinLength, // This value is too short.
111  IntMax, // This value is too big.
112  IntMin, // This value is too small.
113  DoubleMax, // This value is too big.
114  DoubleMin, // This value is too small.
115  EmailAddress, // This value is not email address.
116  Url, // This value is invalid URL.
117  Date, // This value is invalid date.
118  Time, // This value is invalid time.
119  DateTime, // This value is invalid date or time.
120  Pattern, // This value is bad format.
122 
123  // Add new rules before this line
124  RuleCount
125 };
126 
128  Compatible = 0, // Converts double-quotes and leaves single-quotes alone.
129  Quotes, // Converts both double and single quotes.
130  NoQuotes, // Leaves both double and single quotes unconverted.
131 };
132 
133 enum SortOrder {
136 };
137 
151  SqlQueryLogFile, // Deprecated
186  //
191  //
194  //
199  //
201  //
205  //
209 };
210 
211 // Reason codes why a web socket has been closed
212 enum CloseCode {
214  GoingAway = 1001,
217  Reserved = 1004,
218  NoStatusRcvd = 1005,
227  TLSHandshake = 1015,
228 };
229 
237 };
238 
239 enum class KvsEngine : int {
240  CacheKvs = 0, // For internal use
241  MongoDB,
242  Redis,
243  Memcached,
244  SharedMemory,
245  Num // = 5
246 };
247 
248 enum class SocketState : int {
249  Unconnected = 0,
250  Connecting,
251  Connected,
252 };
253 
254 
255 #if QT_VERSION >= 0x050e00 // 5.14.0
258 #else
259 constexpr auto KeepEmptyParts = QString::KeepEmptyParts;
260 constexpr auto SkipEmptyParts = QString::SkipEmptyParts;
261 #endif
262 } // namespace Tf
263 
264 
270 namespace TSql {
271 
273  Invalid = 0,
274  Equal, // = val
275  NotEqual, // <> val
276  LessThan, // < val
277  GreaterThan, // > val
278  LessEqual, // <= val
279  GreaterEqual, // >= val
280  IsNull, // IS NULL
281  IsEmpty, // (column IS NULL OR column = '')
282  IsNotNull, // IS NOT NULL
283  IsNotEmpty, // column IS NOT NULL AND column <> ''
284  Like, // LIKE val
285  NotLike, // NOT LIKE val
286  LikeEscape, // LIKE val1 ESCAPE val2
287  NotLikeEscape, // NOT LIKE val1 ESCAPE val2
288  ILike, // ILIKE val
289  NotILike, // NOT ILIKE val
290  ILikeEscape, // ILIKE val1 ESCAPE val2
291  NotILikeEscape, // NOT ILIKE val1 ESCAPE val2
292  In, // IN (val1, ...)
293  NotIn, // NOT IN (val1, ...)
294  Between, // BETWEEN val1 AND val2
295  NotBetween, // NOT BETWEEN val1 AND val2
296  Any, // ANY (val1, ...)
297  All, // ALL (val1, ...)
298 };
299 
300 enum JoinMode {
304 };
305 
306 } // namespace TSql
307 
313 namespace TMongo {
314 
316  Invalid = 0,
317  Equal = TSql::Equal, // == val
323  Exists = 100, // $exists : true
324  NotExists, // $exists : false
325  All, // $all : [ val1, ... ]
326  In, // $in : [ val1, ... ]
327  NotIn, // $nin : [ val1, ... ]
328  Mod, // $mod : [ val1, val2 ]
329  Size, // $size : val
330  Type, // $type : val
331 };
332 
333 } // namespace TMongo
The TWebApplication class provides an event loop for TreeFrog applications.
Definition: twebapplication.h:23
The TMongo namespace contains miscellaneous identifiers used throughout the MongoDB library.
ComparisonOperator
Definition: tfnamespace.h:315
@ Type
Definition: tfnamespace.h:330
@ GreaterThan
Definition: tfnamespace.h:320
@ Mod
Definition: tfnamespace.h:328
@ Size
Definition: tfnamespace.h:329
@ NotIn
Definition: tfnamespace.h:327
@ NotEqual
Definition: tfnamespace.h:318
@ Invalid
Definition: tfnamespace.h:316
@ Equal
Definition: tfnamespace.h:317
@ All
Definition: tfnamespace.h:325
@ LessEqual
Definition: tfnamespace.h:321
@ GreaterEqual
Definition: tfnamespace.h:322
@ NotExists
Definition: tfnamespace.h:324
@ LessThan
Definition: tfnamespace.h:319
@ In
Definition: tfnamespace.h:326
@ Exists
Definition: tfnamespace.h:323
The TSql namespace contains miscellaneous identifiers used throughout the SQL library.
ComparisonOperator
Definition: tfnamespace.h:272
@ IsEmpty
Definition: tfnamespace.h:281
@ GreaterThan
Definition: tfnamespace.h:277
@ NotLike
Definition: tfnamespace.h:285
@ Invalid
Definition: tfnamespace.h:273
@ Equal
Definition: tfnamespace.h:274
@ NotIn
Definition: tfnamespace.h:293
@ IsNull
Definition: tfnamespace.h:280
@ In
Definition: tfnamespace.h:292
@ NotBetween
Definition: tfnamespace.h:295
@ Any
Definition: tfnamespace.h:296
@ IsNotNull
Definition: tfnamespace.h:282
@ LessThan
Definition: tfnamespace.h:276
@ ILike
Definition: tfnamespace.h:288
@ Like
Definition: tfnamespace.h:284
@ NotLikeEscape
Definition: tfnamespace.h:287
@ IsNotEmpty
Definition: tfnamespace.h:283
@ LessEqual
Definition: tfnamespace.h:278
@ GreaterEqual
Definition: tfnamespace.h:279
@ NotILike
Definition: tfnamespace.h:289
@ Between
Definition: tfnamespace.h:294
@ All
Definition: tfnamespace.h:297
@ NotILikeEscape
Definition: tfnamespace.h:291
@ ILikeEscape
Definition: tfnamespace.h:290
@ LikeEscape
Definition: tfnamespace.h:286
@ NotEqual
Definition: tfnamespace.h:275
JoinMode
Definition: tfnamespace.h:300
@ InnerJoin
Definition: tfnamespace.h:301
@ RightJoin
Definition: tfnamespace.h:303
@ LeftJoin
Definition: tfnamespace.h:302
The Tf namespace contains miscellaneous identifiers used throughout the library of TreeFrog Framework...
Definition: tdebug.h:10
SocketState
Definition: tfnamespace.h:248
constexpr auto SkipEmptyParts
Definition: tfnamespace.h:257
HttpStatusCode
Definition: tfnamespace.h:34
@ ExpectationFailed
Definition: tfnamespace.h:72
@ NoContent
Definition: tfnamespace.h:43
@ NotModified
Definition: tfnamespace.h:51
@ Conflict
Definition: tfnamespace.h:64
@ UseProxy
Definition: tfnamespace.h:52
@ TemporaryRedirect
Definition: tfnamespace.h:53
@ RequestedRangeNotSatisfiable
Definition: tfnamespace.h:71
@ OK
Definition: tfnamespace.h:39
@ MethodNotAllowed
Definition: tfnamespace.h:60
@ Continue
Definition: tfnamespace.h:36
@ UnsupportedMediaType
Definition: tfnamespace.h:70
@ Unauthorized
Definition: tfnamespace.h:56
@ BadRequest
Definition: tfnamespace.h:55
@ BadGateway
Definition: tfnamespace.h:76
@ PartialContent
Definition: tfnamespace.h:45
@ ProxyAuthenticationRequired
Definition: tfnamespace.h:62
@ NonAuthoritativeInformation
Definition: tfnamespace.h:42
@ SwitchingProtocols
Definition: tfnamespace.h:37
@ PaymentRequired
Definition: tfnamespace.h:57
@ NotFound
Definition: tfnamespace.h:59
@ MovedPermanently
Definition: tfnamespace.h:48
@ ServiceUnavailable
Definition: tfnamespace.h:77
@ RequestTimeout
Definition: tfnamespace.h:63
@ LengthRequired
Definition: tfnamespace.h:66
@ RequestEntityTooLarge
Definition: tfnamespace.h:68
@ Gone
Definition: tfnamespace.h:65
@ GatewayTimeout
Definition: tfnamespace.h:78
@ MultipleChoices
Definition: tfnamespace.h:47
@ SeeOther
Definition: tfnamespace.h:50
@ Created
Definition: tfnamespace.h:40
@ InternalServerError
Definition: tfnamespace.h:74
@ ResetContent
Definition: tfnamespace.h:44
@ HTTPVersionNotSupported
Definition: tfnamespace.h:79
@ RequestURITooLong
Definition: tfnamespace.h:69
@ NotImplemented
Definition: tfnamespace.h:75
@ Found
Definition: tfnamespace.h:49
@ Forbidden
Definition: tfnamespace.h:58
@ Accepted
Definition: tfnamespace.h:41
@ PreconditionFailed
Definition: tfnamespace.h:67
@ NotAcceptable
Definition: tfnamespace.h:61
CloseCode
Definition: tfnamespace.h:212
@ ProtocolError
Definition: tfnamespace.h:215
@ NormalClosure
Definition: tfnamespace.h:213
@ PolicyViolation
Definition: tfnamespace.h:221
@ TLSHandshake
Definition: tfnamespace.h:227
@ AbnormalClosure
Definition: tfnamespace.h:219
@ Reserved
Definition: tfnamespace.h:217
@ MessageTooBig
Definition: tfnamespace.h:222
@ NoStatusRcvd
Definition: tfnamespace.h:218
@ MandatoryExtension
Definition: tfnamespace.h:223
@ GoingAway
Definition: tfnamespace.h:214
@ InternalError
Definition: tfnamespace.h:224
@ TryAgainLater
Definition: tfnamespace.h:226
@ UnsupportedData
Definition: tfnamespace.h:216
@ ServiceRestart
Definition: tfnamespace.h:225
@ InvalidFramePayloadData
Definition: tfnamespace.h:220
HttpMethod
Definition: tfnamespace.h:21
@ Post
Definition: tfnamespace.h:25
@ Put
Definition: tfnamespace.h:27
@ Trace
Definition: tfnamespace.h:29
@ Patch
Definition: tfnamespace.h:31
@ Delete
Definition: tfnamespace.h:28
@ Connect
Definition: tfnamespace.h:30
@ Options
Definition: tfnamespace.h:26
@ Invalid
Definition: tfnamespace.h:22
@ Head
Definition: tfnamespace.h:24
@ Get
Definition: tfnamespace.h:23
KvsEngine
Definition: tfnamespace.h:239
QuotedStrSplitBehavior
Definition: tfnamespace.h:11
@ SplitSkipQuotedString
Definition: tfnamespace.h:13
@ SplitWhereverSep
Definition: tfnamespace.h:12
AjaxOption
Definition: tfnamespace.h:83
@ Encoding
Definition: tfnamespace.h:86
@ PostBody
Definition: tfnamespace.h:89
@ RequestHeaders
Definition: tfnamespace.h:90
@ EvalJSON
Definition: tfnamespace.h:92
@ Asynchronous
Definition: tfnamespace.h:84
@ EvalJS
Definition: tfnamespace.h:91
@ SanitizeJSON
Definition: tfnamespace.h:93
@ Method
Definition: tfnamespace.h:87
@ Parameters
Definition: tfnamespace.h:88
@ ContentType
Definition: tfnamespace.h:85
constexpr auto KeepEmptyParts
Definition: tfnamespace.h:256
SortOrder
Definition: tfnamespace.h:133
@ AscendingOrder
Definition: tfnamespace.h:134
@ DescendingOrder
Definition: tfnamespace.h:135
LogPriority
Definition: tfnamespace.h:230
@ TraceLevel
Finer-grained informational events than the DEBUG.
Definition: tfnamespace.h:236
@ WarnLevel
Potentially harmful situations.
Definition: tfnamespace.h:233
@ DebugLevel
Informational events that are most useful to debug the app.
Definition: tfnamespace.h:235
@ InfoLevel
Informational messages that highlight the progress of the app.
Definition: tfnamespace.h:234
@ FatalLevel
Severe error events that will presumably lead the app to abort.
Definition: tfnamespace.h:231
@ ErrorLevel
Error events that might still allow the app to continue running.
Definition: tfnamespace.h:232
AppAttribute
Definition: tfnamespace.h:138
@ UploadTemporaryDirectory
Definition: tfnamespace.h:144
@ CacheEnableCompression
Definition: tfnamespace.h:198
@ SqlQueryLogLayout
Definition: tfnamespace.h:207
@ Locale
Definition: tfnamespace.h:142
@ SqlQueryLogFilePath
Definition: tfnamespace.h:206
@ SystemLogLayout
Definition: tfnamespace.h:168
@ SessionGcProbability
Definition: tfnamespace.h:160
@ LDPreload
Definition: tfnamespace.h:188
@ MPMEpollMaxAppServers
Definition: tfnamespace.h:166
@ InternalEncoding
Definition: tfnamespace.h:140
@ ActionMailerSmtpPassword
Definition: tfnamespace.h:180
@ ActionMailerSmtpRequireTLS
Definition: tfnamespace.h:204
@ SessionCookieMaxAge
Definition: tfnamespace.h:192
@ EnableForwardedForHeader
Definition: tfnamespace.h:202
@ AccessLogDateTimeFormat
Definition: tfnamespace.h:172
@ ActionMailerSmtpPopServerEnableApop
Definition: tfnamespace.h:184
@ SqlDatabaseSettingsFiles
Definition: tfnamespace.h:145
@ SessionCookiePath
Definition: tfnamespace.h:159
@ JavaScriptPath
Definition: tfnamespace.h:189
@ ActionMailerSmtpPopServerHostName
Definition: tfnamespace.h:182
@ ActionMailerSmtpEnablePopBeforeSmtp
Definition: tfnamespace.h:181
@ SessionSecret
Definition: tfnamespace.h:162
@ SessionCsrfProtectionKey
Definition: tfnamespace.h:163
@ AccessLogLayout
Definition: tfnamespace.h:171
@ DirectViewRenderMode
Definition: tfnamespace.h:150
@ CacheBackend
Definition: tfnamespace.h:196
@ ListenPort
Definition: tfnamespace.h:139
@ MultiProcessingModule
Definition: tfnamespace.h:143
@ ActionMailerSendmailCommandLocation
Definition: tfnamespace.h:185
@ AccessLogFilePath
Definition: tfnamespace.h:170
@ ActionMailerSmtpPort
Definition: tfnamespace.h:177
@ HttpKeepAliveTimeout
Definition: tfnamespace.h:187
@ ActionMailerDelayedDelivery
Definition: tfnamespace.h:175
@ SqlQueryLogFile
Definition: tfnamespace.h:151
@ SqlQueriesStoredDirectory
Definition: tfnamespace.h:149
@ CacheSettingsFile
Definition: tfnamespace.h:195
@ SystemLogFilePath
Definition: tfnamespace.h:167
@ SessionAutoIdRegeneration
Definition: tfnamespace.h:158
@ MemcachedSettingsFile
Definition: tfnamespace.h:148
@ ActionMailerSmtpUserName
Definition: tfnamespace.h:179
@ ActionMailerSmtpAuthentication
Definition: tfnamespace.h:178
@ RedisSettingsFile
Definition: tfnamespace.h:147
@ EnableCsrfProtectionModule
Definition: tfnamespace.h:154
@ MongoDbSettingsFile
Definition: tfnamespace.h:146
@ MPMThreadMaxAppServers
Definition: tfnamespace.h:164
@ CacheGcProbability
Definition: tfnamespace.h:197
@ SessionCookieDomain
Definition: tfnamespace.h:193
@ EnableHttpMethodOverride
Definition: tfnamespace.h:155
@ ActionMailerCharacterSet
Definition: tfnamespace.h:174
@ ActionMailerSmtpHostName
Definition: tfnamespace.h:176
@ ListenAddress
Definition: tfnamespace.h:190
@ LimitRequestBody
Definition: tfnamespace.h:153
@ ApplicationAbortOnFatal
Definition: tfnamespace.h:152
@ MPMThreadMaxThreadsPerAppServer
Definition: tfnamespace.h:165
@ SessionCookieSameSite
Definition: tfnamespace.h:200
@ HttpOutputEncoding
Definition: tfnamespace.h:141
@ ActionMailerDeliveryMethod
Definition: tfnamespace.h:173
@ SessionStoreType
Definition: tfnamespace.h:157
@ SessionGcMaxLifeTime
Definition: tfnamespace.h:161
@ SystemLogDateTimeFormat
Definition: tfnamespace.h:169
@ SqlQueryLogDateTimeFormat
Definition: tfnamespace.h:208
@ TrustedProxyServers
Definition: tfnamespace.h:203
@ ActionMailerSmtpPopServerPort
Definition: tfnamespace.h:183
@ SessionName
Definition: tfnamespace.h:156
AjaxEvent
Definition: tfnamespace.h:96
@ Failure
Definition: tfnamespace.h:103
@ Interactive
Definition: tfnamespace.h:101
@ Create
Definition: tfnamespace.h:97
@ Success
Definition: tfnamespace.h:102
@ Complete
Definition: tfnamespace.h:104
@ Loaded
Definition: tfnamespace.h:100
@ Uninitialized
Definition: tfnamespace.h:98
@ Loading
Definition: tfnamespace.h:99
CaseSensitivity
Definition: tfnamespace.h:16
@ CaseSensitive
Definition: tfnamespace.h:18
@ CaseInsensitive
Definition: tfnamespace.h:17
ValidationRule
Definition: tfnamespace.h:107
@ Time
Definition: tfnamespace.h:118
@ DoubleMax
Definition: tfnamespace.h:113
@ Custom
Definition: tfnamespace.h:121
@ Required
Definition: tfnamespace.h:108
@ IntMax
Definition: tfnamespace.h:111
@ MinLength
Definition: tfnamespace.h:110
@ Url
Definition: tfnamespace.h:116
@ IntMin
Definition: tfnamespace.h:112
@ Pattern
Definition: tfnamespace.h:120
@ EmailAddress
Definition: tfnamespace.h:115
@ MaxLength
Definition: tfnamespace.h:109
@ DateTime
Definition: tfnamespace.h:119
@ RuleCount
Definition: tfnamespace.h:124
@ Date
Definition: tfnamespace.h:117
@ DoubleMin
Definition: tfnamespace.h:114
EscapeFlag
Definition: tfnamespace.h:127
@ Quotes
Definition: tfnamespace.h:129
@ Compatible
Definition: tfnamespace.h:128
@ NoQuotes
Definition: tfnamespace.h:130