Merge pull request #823 from DavidKarlas/master
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / HttpCapabilitiesBase.cs
1 //
2 // System.Web.Configuration.HttpCapabilitiesBase
3 //
4 // Authors:
5 //      Chris Toshok (toshok@ximian.com)
6 //
7 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
16 // 
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 // 
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28
29 using System.Collections;
30 using System.Security.Permissions;
31 using System.IO;
32 using System.Web.UI;
33
34 namespace System.Web.Configuration
35 {
36         public partial class HttpCapabilitiesBase: IFilterResolutionService
37         {
38                 internal IDictionary capabilities;
39
40                 public HttpCapabilitiesBase () { }
41
42                 public virtual string this [string key]
43                 {
44                         get { return capabilities [key] as string; }
45                 }
46
47                 internal static string GetUserAgentForDetection (HttpRequest request)
48                 {
49                         string ua = null;
50                         if (request.Context.CurrentHandler is System.Web.UI.Page)
51                                 ua = ((System.Web.UI.Page) request.Context.CurrentHandler).ClientTarget;
52                         
53                         if (String.IsNullOrEmpty (ua)) {
54                                 ua = request.ClientTarget;
55
56                                 if (String.IsNullOrEmpty (ua))
57                                         ua = request.UserAgent;
58                         }
59
60                         return ua;
61                 }
62
63                 static HttpBrowserCapabilities GetHttpBrowserCapabilitiesFromBrowscapini(string ua)
64                 {
65                         HttpBrowserCapabilities bcap = new HttpBrowserCapabilities();
66                         bcap.capabilities = CapabilitiesLoader.GetCapabilities (ua);
67                         return bcap;
68                 }
69                 
70                 public static HttpCapabilitiesBase GetConfigCapabilities (string configKey, HttpRequest request)
71                 {
72                         string ua = GetUserAgentForDetection (request);
73                         HttpBrowserCapabilities bcap = GetHttpBrowserCapabilitiesFromBrowscapini(ua);
74                         GetConfigCapabilities_called = true;
75                         if (HttpApplicationFactory.AppBrowsersFiles.Length > 0)
76                                 bcap = HttpApplicationFactory.CapabilitiesProcessor.Process(request, bcap.Capabilities);
77                         bcap.useragent = ua;
78                         bcap.Init ();
79                         return bcap;
80                 }
81
82                 // Used by unit tests to determine whether GetConfigCapabilities was called.
83                 static internal bool GetConfigCapabilities_called;
84
85                 protected virtual void Init ()
86                 {
87                 }
88
89                 int IFilterResolutionService.CompareFilters (string filter1, string filter2)
90                 {
91                         throw new NotImplementedException ();
92                 }
93
94                 bool IFilterResolutionService.EvaluateFilter (string filterName)
95                 {
96                         throw new NotImplementedException ();
97                 }
98                 
99                 public void AddBrowser (string browserName)
100                 {
101                 }
102
103                 public HtmlTextWriter CreateHtmlTextWriter (TextWriter w)
104                 {
105                         return (HtmlTextWriter) Activator.CreateInstance (TagWriter, new object[] {w});
106                 }
107
108                 public void DisableOptimizedCacheKey ()
109                 {
110                         throw new NotImplementedException ();
111                 }
112
113                 IDictionary adapters = null;
114                 public IDictionary Adapters {
115                         get {
116                                 if (!Get (HaveAdapters)) {
117                                         adapters = GetAdapters();
118                                         Set (HaveAdapters);
119                                 }
120
121                                 return adapters;
122                         }
123                 }
124                 
125                 internal virtual IDictionary GetAdapters ()
126                 {
127                         return new Hashtable();
128                 }
129
130                 bool canCombineFormsInDeck;
131                 public virtual bool CanCombineFormsInDeck {
132                         get {
133                                 if (!Get (HaveCanCombineFormsInDeck)) {
134                                         canCombineFormsInDeck = ReadBoolean ("cancombineformsindeck");
135                                         Set (HaveCanCombineFormsInDeck);
136                                 }
137
138                                 return canCombineFormsInDeck;
139                         }
140                 }
141
142                 bool canInitiateVoiceCall;
143                 public virtual bool CanInitiateVoiceCall {
144                         get {
145                                 if (!Get (HaveCanInitiateVoiceCall)) {
146                                         canInitiateVoiceCall = ReadBoolean ("caninitiatevoicecall");
147                                         Set (HaveCanInitiateVoiceCall);
148                                 }
149
150                                 return canInitiateVoiceCall;
151                         }
152                 }
153
154                 bool canRenderAfterInputOrSelectElement;
155                 public virtual bool CanRenderAfterInputOrSelectElement {
156                         get {
157                                 if (!Get (HaveCanRenderAfterInputOrSelectElement)) {
158                                         canRenderAfterInputOrSelectElement = ReadBoolean ("canrenderafterinputorselectelement");
159                                         Set (HaveCanRenderAfterInputOrSelectElement);
160                                 }
161
162                                 return canRenderAfterInputOrSelectElement;
163                         }
164                 }
165
166                 bool canRenderEmptySelects;
167                 public virtual bool CanRenderEmptySelects {
168                         get {
169                                 if (!Get (HaveCanRenderEmptySelects)) {
170                                         canRenderEmptySelects = ReadBoolean ("canrenderemptyselects");
171                                         Set (HaveCanRenderEmptySelects);
172                                 }
173
174                                 return canRenderEmptySelects;
175                         }
176                 }
177
178                 bool canRenderInputAndSelectElementsTogether;
179                 public virtual bool CanRenderInputAndSelectElementsTogether {
180                         get {
181                                 if (!Get (HaveCanRenderInputAndSelectElementsTogether)) {
182                                         canRenderInputAndSelectElementsTogether = ReadBoolean ("canrenderinputandselectelementstogether");
183                                         Set (HaveCanRenderInputAndSelectElementsTogether);
184                                 }
185
186                                 return canRenderInputAndSelectElementsTogether;
187                         }
188                 }
189
190                 bool canRenderMixedSelects;
191                 public virtual bool CanRenderMixedSelects {
192                         get {
193                                 if (!Get (HaveCanRenderMixedSelects)) {
194                                         canRenderMixedSelects = ReadBoolean ("canrendermixedselects");
195                                         Set (HaveCanRenderMixedSelects);
196                                 }
197
198                                 return canRenderMixedSelects;
199                         }
200                 }
201
202                 bool canRenderOneventAndPrevElementsTogether;
203                 public virtual bool CanRenderOneventAndPrevElementsTogether {
204                         get {
205                                 if (!Get (HaveCanRenderOneventAndPrevElementsTogether)) {
206                                         canRenderOneventAndPrevElementsTogether = ReadBoolean ("canrenderoneventandprevelementstogether");
207                                         Set (HaveCanRenderOneventAndPrevElementsTogether);
208                                 }
209
210                                 return canRenderOneventAndPrevElementsTogether;
211                         }
212                 }
213
214                 bool canRenderPostBackCards;
215                 public virtual bool CanRenderPostBackCards {
216                         get {
217                                 if (!Get (HaveCanRenderPostBackCards)) {
218                                         canRenderPostBackCards = ReadBoolean ("canrenderpostbackcards");
219                                         Set (HaveCanRenderPostBackCards);
220                                 }
221
222                                 return canRenderPostBackCards;
223                         }
224                 }
225
226                 bool canRenderSetvarZeroWithMultiSelectionList;
227                 public virtual bool CanRenderSetvarZeroWithMultiSelectionList {
228                         get {
229                                 if (!Get (HaveCanRenderSetvarZeroWithMultiSelectionList)) {
230                                         canRenderSetvarZeroWithMultiSelectionList = ReadBoolean ("canrendersetvarzerowithmultiselectionlist");
231                                         Set (HaveCanRenderSetvarZeroWithMultiSelectionList);
232                                 }
233
234                                 return canRenderSetvarZeroWithMultiSelectionList;
235                         }
236                 }
237
238                 bool canSendMail;
239                 public virtual bool CanSendMail {
240                         get {
241                                 if (!Get (HaveCanSendMail)) {
242                                         canSendMail = ReadBoolean ("cansendmail");
243                                         Set (HaveCanSendMail);
244                                 }
245
246                                 return canSendMail;
247                         }
248                 }
249
250                 public IDictionary Capabilities
251                 {
252                         get { return capabilities; }
253                         set {
254                                 //value comes with duplicated keys, so we filter them out
255                                 capabilities = new Hashtable (value.Keys.Count, StringComparer.OrdinalIgnoreCase);
256                                 foreach (object key in value.Keys) {
257                                         if (!capabilities.Contains (key))
258                                                 capabilities.Add (key, value [key]);
259                                 }
260                         }
261                 }
262
263                 int defaultSubmitButtonLimit;
264                 public virtual int DefaultSubmitButtonLimit {
265                         get {
266                                 if (!Get (HaveDefaultSubmitButtonLimit)) {
267                                         defaultSubmitButtonLimit = ReadInt32 ("defaultsubmitbuttonlimit");
268                                         Set (HaveDefaultSubmitButtonLimit);
269                                 }
270
271                                 return defaultSubmitButtonLimit;
272                         }
273                 }
274
275                 int gatewayMajorVersion;
276                 public virtual int GatewayMajorVersion {
277                         get {
278                                 if (!Get (HaveGatewayMajorVersion)) {
279                                         gatewayMajorVersion = ReadInt32 ("gatewaymajorversion");
280                                         Set (HaveGatewayMajorVersion);
281                                 }
282
283                                 return gatewayMajorVersion;
284                         }
285                 }
286
287                 Double gatewayMinorVersion;
288                 public virtual Double GatewayMinorVersion {
289                         get {
290                                 if (!Get (HaveGatewayMinorVersion)) {
291                                         gatewayMinorVersion = ReadDouble ("gatewayminorversion");
292                                         Set (HaveGatewayMinorVersion);
293                                 }
294
295                                 return gatewayMinorVersion;
296                         }
297                 }
298
299                 string gatewayVersion;
300                 public virtual string GatewayVersion {
301                         get {
302                                 if (!Get (HaveGatewayVersion)) {
303                                         gatewayVersion = ReadString ("gatewayversion");
304                                         Set (HaveGatewayVersion);
305                                 }
306
307                                 return gatewayVersion;
308                         }
309                 }
310
311                 bool hasBackButton;
312                 public virtual bool HasBackButton {
313                         get {
314                                 if (!Get (HaveHasBackButton)) {
315                                         hasBackButton = ReadBoolean ("hasbackbutton");
316                                         Set (HaveHasBackButton);
317                                 }
318
319                                 return hasBackButton;
320                         }
321                 }
322
323                 bool hidesRightAlignedMultiselectScrollbars;
324                 public virtual bool HidesRightAlignedMultiselectScrollbars {
325                         get {
326                                 if (!Get (HaveHidesRightAlignedMultiselectScrollbars)) {
327                                         hidesRightAlignedMultiselectScrollbars = ReadBoolean ("hidesrightalignedmultiselectscrollbars");
328                                         Set (HaveHidesRightAlignedMultiselectScrollbars);
329                                 }
330                                 
331                                 return hidesRightAlignedMultiselectScrollbars;
332                         }
333                 }
334
335                 string htmlTextWriter;
336                 public string HtmlTextWriter {
337                         get {
338                                 if (!Get (HaveHtmlTextWriter)) {
339                                         htmlTextWriter = ReadString ("htmlTextWriter");
340                                         Set (HaveHtmlTextWriter);
341                                 }
342
343                                 return htmlTextWriter;
344                         }
345                         set {
346                                 Set (HaveHtmlTextWriter);
347                                 htmlTextWriter = value;
348                         }
349                 }
350
351                 public string Id {
352                         get { return this.Browser; }
353                 }
354
355                 string inputType;
356                 public virtual string InputType {
357                         get {
358                                 if (!Get (HaveInputType)) {
359                                         inputType = ReadString ("inputtype");
360                                         Set (HaveInputType);
361                                 }
362
363                                 return inputType;
364                         }
365                 }
366
367                 bool isColor;
368                 public virtual bool IsColor {
369                         get {
370                                 if (!Get (HaveIsColor)) {
371                                         isColor = ReadBoolean ("iscolor");
372                                         Set (HaveIsColor);
373                                 }
374
375                                 return isColor;
376                         }
377                 }
378
379                 bool isMobileDevice;
380                 public virtual bool IsMobileDevice {
381                         get {
382                                 if (!Get (HaveIsMobileDevice)) {
383                                         isMobileDevice = ReadBoolean ("ismobiledevice");
384                                         Set (HaveIsMobileDevice);
385                                 }
386
387                                 return isMobileDevice;
388                         }
389                 }
390
391                 Version jscriptVersion;
392                 public Version JScriptVersion {
393                         get {
394                                 if (!Get (HaveJScriptVersion)) {
395                                         jscriptVersion = ReadVersion ("jscriptversion");
396                                         Set (HaveJScriptVersion);
397                                 }
398
399                                 return jscriptVersion;
400                         }
401                 }
402
403                 int maximumHrefLength;
404                 public virtual int MaximumHrefLength {
405                         get {
406                                 if (!Get (HaveMaximumHrefLength)) {
407                                         maximumHrefLength = ReadInt32 ("maximumhreflength");
408                                         Set (HaveMaximumHrefLength);
409                                 }
410
411                                 return maximumHrefLength;
412                         }
413                 }
414
415                 int maximumRenderedPageSize;
416                 public virtual int MaximumRenderedPageSize {
417                         get {
418                                 if (!Get (HaveMaximumRenderedPageSize)) {
419                                         maximumRenderedPageSize = ReadInt32 ("maximumrenderedpagesize");
420                                         Set (HaveMaximumRenderedPageSize);
421                                 }
422
423                                 return maximumRenderedPageSize;
424                         }
425                 }
426
427                 int maximumSoftkeyLabelLength;
428                 public virtual int MaximumSoftkeyLabelLength {
429                         get {
430                                 if (!Get (HaveMaximumSoftkeyLabelLength)) {
431                                         maximumSoftkeyLabelLength = ReadInt32 ("maximumsoftkeylabellength");
432                                         Set (HaveMaximumSoftkeyLabelLength);
433                                 }
434
435                                 return maximumSoftkeyLabelLength;
436                         }
437                 }
438
439                 string minorVersionString;
440                 public string MinorVersionString {
441                         get {
442                                 if (!Get (HaveMinorVersionString)) {
443                                         minorVersionString = ReadString ("minorversionstring");
444                                         Set (HaveMinorVersionString);
445                                 }
446
447                                 return minorVersionString;
448                         }
449                 }
450
451                 string mobileDeviceManufacturer;
452                 public virtual string MobileDeviceManufacturer {
453                         get {
454                                 if (!Get (HaveMobileDeviceManufacturer)) {
455                                         mobileDeviceManufacturer = ReadString ("mobiledevicemanufacturer");
456                                         Set (HaveMobileDeviceManufacturer);
457                                 }
458
459                                 return mobileDeviceManufacturer;
460                         }
461                 }
462
463                 string mobileDeviceModel;
464                 public virtual string MobileDeviceModel {
465                         get {
466                                 if (!Get (HaveMobileDeviceModel)) {
467                                         mobileDeviceModel = ReadString ("mobiledevicemodel");
468                                         Set (HaveMobileDeviceModel);
469                                 }
470
471                                 return mobileDeviceModel;
472                         }
473                 }
474
475                 int numberOfSoftkeys;
476                 public virtual int NumberOfSoftkeys {
477                         get {
478                                 if (!Get (HaveNumberOfSoftkeys)) {
479                                         numberOfSoftkeys = ReadInt32 ("numberofsoftkeys");
480                                         Set (HaveNumberOfSoftkeys);
481                                 }
482
483                                 return numberOfSoftkeys;
484                         }
485                 }
486
487                 string preferredImageMime;
488                 public virtual string PreferredImageMime {
489                         get {
490                                 if (!Get (HavePreferredImageMime)) {
491                                         preferredImageMime = ReadString ("preferredimagemime");
492                                         Set (HavePreferredImageMime);
493                                 }
494
495                                 return preferredImageMime;
496                         }
497                 }
498
499                 string preferredRenderingMime;
500                 public virtual string PreferredRenderingMime {
501                         get {
502                                 if (!Get (HavePreferredRenderingMime)) {
503                                         preferredRenderingMime = ReadString ("preferredrenderingmime");
504                                         Set (HavePreferredRenderingMime);
505                                 }
506
507                                 return preferredRenderingMime;
508                         }
509                 }
510
511                 string preferredRenderingType;
512                 public virtual string PreferredRenderingType {
513                         get {
514                                 if (!Get (HavePreferredRenderingType)) {
515                                         preferredRenderingType = ReadString ("preferredrenderingtype");
516                                         Set (HavePreferredRenderingType);
517                                 }
518
519                                 return preferredRenderingType;
520                         }
521                 }
522
523                 string preferredRequestEncoding;
524                 public virtual string PreferredRequestEncoding {
525                         get {
526                                 if (!Get (HavePreferredRequestEncoding)) {
527                                         preferredRequestEncoding = ReadString ("preferredrequestencoding");
528                                         Set (HavePreferredRequestEncoding);
529                                 }
530
531                                 return preferredRequestEncoding;
532                         }
533                 }
534
535                 string preferredResponseEncoding;
536                 public virtual string PreferredResponseEncoding {
537                         get {
538                                 if (!Get (HavePreferredResponseEncoding)) {
539                                         preferredResponseEncoding = ReadString ("preferredresponseencoding");
540                                         Set (HavePreferredResponseEncoding);
541                                 }
542
543                                 return preferredResponseEncoding;
544                         }
545                 }
546
547                 bool rendersBreakBeforeWmlSelectAndInput;
548                 public virtual bool RendersBreakBeforeWmlSelectAndInput {
549                         get {
550                                 if (!Get (HaveRendersBreakBeforeWmlSelectAndInput)) {
551                                         rendersBreakBeforeWmlSelectAndInput = ReadBoolean ("rendersbreakbeforewmlselectandinput");
552                                         Set (HaveRendersBreakBeforeWmlSelectAndInput);
553                                 }
554
555                                 return rendersBreakBeforeWmlSelectAndInput;
556                         }
557                 }
558
559                 bool rendersBreaksAfterHtmlLists;
560                 public virtual bool RendersBreaksAfterHtmlLists {
561                         get {
562                                 if (!Get (HaveRendersBreaksAfterHtmlLists)) {
563                                         rendersBreaksAfterHtmlLists = ReadBoolean ("rendersbreaksafterhtmllists");
564                                         Set (HaveRendersBreaksAfterHtmlLists);
565                                 }
566
567                                 return rendersBreaksAfterHtmlLists;
568                         }
569                 }
570
571                 bool rendersBreaksAfterWmlAnchor;
572                 public virtual bool RendersBreaksAfterWmlAnchor {
573                         get {
574                                 if (!Get (HaveRendersBreaksAfterWmlAnchor)) {
575                                         rendersBreaksAfterWmlAnchor = ReadBoolean ("rendersbreaksafterwmlanchor");
576                                         Set (HaveRendersBreaksAfterWmlAnchor);
577                                 }
578
579                                 return rendersBreaksAfterWmlAnchor;
580                         }
581                 }
582
583                 bool rendersBreaksAfterWmlInput;
584                 public virtual bool RendersBreaksAfterWmlInput {
585                         get {
586                                 if (!Get (HaveRendersBreaksAfterWmlInput)) {
587                                         rendersBreaksAfterWmlInput = ReadBoolean ("rendersbreaksafterwmlinput");
588                                         Set (HaveRendersBreaksAfterWmlInput);
589                                 }
590
591                                 return rendersBreaksAfterWmlInput;
592                         }
593                 }
594
595                 bool rendersWmlDoAcceptsInline;
596                 public virtual bool RendersWmlDoAcceptsInline {
597                         get {
598                                 if (!Get (HaveRendersWmlDoAcceptsInline)) {
599                                         rendersWmlDoAcceptsInline = ReadBoolean ("renderswmldoacceptsinline");
600                                         Set (HaveRendersWmlDoAcceptsInline);
601                                 }
602
603                                 return rendersWmlDoAcceptsInline;
604                         }
605                 }
606
607                 bool rendersWmlSelectsAsMenuCards;
608                 public virtual bool RendersWmlSelectsAsMenuCards {
609                         get {
610                                 if (!Get (HaveRendersWmlSelectsAsMenuCards)) {
611                                         rendersWmlSelectsAsMenuCards = ReadBoolean ("renderswmlselectsasmenucards");
612                                         Set (HaveRendersWmlSelectsAsMenuCards);
613                                 }
614
615                                 return rendersWmlSelectsAsMenuCards;
616                         }
617                 }
618
619                 string requiredMetaTagNameValue;
620                 public virtual string RequiredMetaTagNameValue {
621                         get {
622                                 if (!Get (HaveRequiredMetaTagNameValue)) {
623                                         requiredMetaTagNameValue = ReadString ("requiredmetatagnamevalue");
624                                         Set (HaveRequiredMetaTagNameValue);
625                                 }
626
627                                 return requiredMetaTagNameValue;
628                         }
629                 }
630
631                 bool requiresAttributeColonSubstitution;
632                 public virtual bool RequiresAttributeColonSubstitution {
633                         get {
634                                 if (!Get (HaveRequiresAttributeColonSubstitution)) {
635                                         requiresAttributeColonSubstitution = ReadBoolean ("requiresattributecolonsubstitution");
636                                         Set (HaveRequiresAttributeColonSubstitution);
637                                 }
638
639                                 return requiresAttributeColonSubstitution;
640                         }
641                 }
642
643                 bool requiresContentTypeMetaTag;
644                 public virtual bool RequiresContentTypeMetaTag {
645                         get {
646                                 if (!Get (HaveRequiresContentTypeMetaTag)) {
647                                         requiresContentTypeMetaTag = ReadBoolean ("requiresContentTypeMetaTag");
648                                         Set (HaveRequiresContentTypeMetaTag);
649                                 }
650
651                                 return requiresContentTypeMetaTag;
652                         }
653                 }
654
655                 bool requiresControlStateInSession;
656                 public bool RequiresControlStateInSession {
657                         get {
658                                 if (!Get (HaveRequiresControlStateInSession)) {
659                                         requiresControlStateInSession = ReadBoolean ("requiresControlStateInSession");
660                                         Set (HaveRequiresControlStateInSession);
661                                 }
662
663                                 return requiresControlStateInSession;
664                         }
665                 }
666
667                 bool requiresDBCSCharacter;
668                 public virtual bool RequiresDBCSCharacter {
669                         get {
670                                 if (!Get (HaveRequiresDBCSCharacter)) {
671                                         requiresDBCSCharacter = ReadBoolean ("requiresdbcscharacter");
672                                         Set (HaveRequiresDBCSCharacter);
673                                 }
674
675                                 return requiresDBCSCharacter;
676                         }
677                 }
678
679                 bool requiresHtmlAdaptiveErrorReporting;
680                 public virtual bool RequiresHtmlAdaptiveErrorReporting {
681                         get {
682                                 if (!Get (HaveRequiresHtmlAdaptiveErrorReporting)) {
683                                         requiresHtmlAdaptiveErrorReporting = ReadBoolean ("requireshtmladaptiveerrorreporting");
684                                         Set (HaveRequiresHtmlAdaptiveErrorReporting);
685                                 }
686
687                                 return requiresHtmlAdaptiveErrorReporting;
688                         }
689                 }
690
691                 bool requiresLeadingPageBreak;
692                 public virtual bool RequiresLeadingPageBreak {
693                         get {
694                                 if (!Get (HaveRequiresLeadingPageBreak)) {
695                                         requiresLeadingPageBreak = ReadBoolean ("requiresleadingpagebreak");
696                                         Set (HaveRequiresLeadingPageBreak);
697                                 }
698
699                                 return requiresLeadingPageBreak;
700                         }
701                 }
702
703                 bool requiresNoBreakInFormatting;
704                 public virtual bool RequiresNoBreakInFormatting {
705                         get {
706                                 if (!Get (HaveRequiresNoBreakInFormatting)) {
707                                         requiresNoBreakInFormatting = ReadBoolean ("requiresnobreakinformatting");
708                                         Set (HaveRequiresNoBreakInFormatting);
709                                 }
710
711                                 return requiresNoBreakInFormatting;
712                         }
713                 }
714
715                 bool requiresOutputOptimization;
716                 public virtual bool RequiresOutputOptimization {
717                         get {
718                                 if (!Get (HaveRequiresOutputOptimization)) {
719                                         requiresOutputOptimization = ReadBoolean ("requiresoutputoptimization");
720                                         Set (HaveRequiresOutputOptimization);
721                                 }
722
723                                 return requiresOutputOptimization;
724                         }
725                 }
726
727                 bool requiresPhoneNumbersAsPlainText;
728                 public virtual bool RequiresPhoneNumbersAsPlainText {
729                         get {
730                                 if (!Get (HaveRequiresPhoneNumbersAsPlainText)) {
731                                         requiresPhoneNumbersAsPlainText = ReadBoolean ("requiresphonenumbersasplaintext");
732                                         Set (HaveRequiresPhoneNumbersAsPlainText);
733                                 }
734
735                                 return requiresPhoneNumbersAsPlainText;
736                         }
737                 }
738
739                 bool requiresSpecialViewStateEncoding;
740                 public virtual bool RequiresSpecialViewStateEncoding {
741                         get {
742                                 if (!Get (HaveRequiresSpecialViewStateEncoding)) {
743                                         requiresSpecialViewStateEncoding = ReadBoolean ("requiresspecialviewstateencoding");
744                                         Set (HaveRequiresSpecialViewStateEncoding);
745                                 }
746
747                                 return requiresSpecialViewStateEncoding;
748                         }
749                 }
750
751                 bool requiresUniqueFilePathSuffix;
752                 public virtual bool RequiresUniqueFilePathSuffix {
753                         get {
754                                 if (!Get (HaveRequiresUniqueFilePathSuffix)) {
755                                         requiresUniqueFilePathSuffix = ReadBoolean ("requiresuniquefilepathsuffix");
756                                         Set (HaveRequiresUniqueFilePathSuffix);
757                                 }
758
759                                 return requiresUniqueFilePathSuffix;
760                         }
761                 }
762
763                 bool requiresUniqueHtmlCheckboxNames;
764                 public virtual bool RequiresUniqueHtmlCheckboxNames {
765                         get {
766                                 if (!Get (HaveRequiresUniqueHtmlCheckboxNames)) {
767                                         requiresUniqueHtmlCheckboxNames = ReadBoolean ("requiresuniquehtmlcheckboxnames");
768                                         Set (HaveRequiresUniqueHtmlCheckboxNames);
769                                 }
770
771                                 return requiresUniqueHtmlCheckboxNames;
772                         }
773                 }
774
775                 bool requiresUniqueHtmlInputNames;
776                 public virtual bool RequiresUniqueHtmlInputNames {
777                         get {
778                                 if (!Get (HaveRequiresUniqueHtmlInputNames)) {
779                                         requiresUniqueHtmlInputNames = ReadBoolean ("requiresuniquehtmlinputnames");
780                                         Set (HaveRequiresUniqueHtmlInputNames);
781                                 }
782
783                                 return requiresUniqueHtmlInputNames;
784                         }
785                 }
786
787                 bool requiresUrlEncodedPostfieldValues;
788                 public virtual bool RequiresUrlEncodedPostfieldValues {
789                         get {
790                                 if (!Get (HaveRequiresUrlEncodedPostfieldValues)) {
791                                         requiresUrlEncodedPostfieldValues = ReadBoolean ("requiresurlencodedpostfieldvalues");
792                                         Set (HaveRequiresUrlEncodedPostfieldValues);
793                                 }
794
795                                 return requiresUrlEncodedPostfieldValues;
796                         }
797                 }
798
799                 int screenBitDepth;
800                 public virtual int ScreenBitDepth {
801                         get {
802                                 if (!Get (HaveScreenBitDepth)) {
803                                         screenBitDepth = ReadInt32 ("screenbitdepth");
804                                         Set (HaveScreenBitDepth);
805                                 }
806
807                                 return screenBitDepth;
808                         }
809                 }
810
811                 int screenCharactersHeight;
812                 public virtual int ScreenCharactersHeight {
813                         get {
814                                 if (!Get (HaveScreenCharactersHeight)) {
815                                         screenCharactersHeight = ReadInt32 ("screencharactersheight");
816                                         Set (HaveScreenCharactersHeight);
817                                 }
818
819                                 return screenCharactersHeight;
820                         }
821                 }
822
823                 int screenCharactersWidth;
824                 public virtual int ScreenCharactersWidth {
825                         get {
826                                 if (!Get (HaveScreenCharactersWidth)) {
827                                         screenCharactersWidth = ReadInt32 ("screencharacterswidth");
828                                         Set (HaveScreenCharactersWidth);
829                                 }
830
831                                 return screenCharactersWidth;
832                         }
833                 }
834
835                 int screenPixelsHeight;
836                 public virtual int ScreenPixelsHeight {
837                         get {
838                                 if (!Get (HaveScreenPixelsHeight)) {
839                                         screenPixelsHeight = ReadInt32 ("screenpixelsheight");
840                                         Set (HaveScreenPixelsHeight);
841                                 }
842
843                                 return screenPixelsHeight;
844                         }
845                 }
846
847                 int screenPixelsWidth;
848                 public virtual int ScreenPixelsWidth {
849                         get {
850                                 if (!Get (HaveScreenPixelsWidth)) {
851                                         screenPixelsWidth = ReadInt32 ("screenpixelswidth");
852                                         Set (HaveScreenPixelsWidth);
853                                 }
854
855                                 return screenPixelsWidth;
856                         }
857                 }
858
859                 bool supportsAccesskeyAttribute;
860                 public virtual bool SupportsAccesskeyAttribute {
861                         get {
862                                 if (!Get (HaveSupportsAccesskeyAttribute)) {
863                                         supportsAccesskeyAttribute = ReadBoolean ("supportsaccesskeyattribute");
864                                         Set (HaveSupportsAccesskeyAttribute);
865                                 }
866
867                                 return supportsAccesskeyAttribute;
868                         }
869                 }
870
871                 bool supportsBodyColor;
872                 public virtual bool SupportsBodyColor {
873                         get {
874                                 if (!Get (HaveSupportsBodyColor)) {
875                                         supportsBodyColor = ReadBoolean ("supportsbodycolor");
876                                         Set (HaveSupportsBodyColor);
877                                 }
878
879                                 return supportsBodyColor;
880                         }
881                 }
882
883                 bool supportsBold;
884                 public virtual bool SupportsBold {
885                         get {
886                                 if (!Get (HaveSupportsBold)) {
887                                         supportsBold = ReadBoolean ("supportsbold");
888                                         Set (HaveSupportsBold);
889                                 }
890
891                                 return supportsBold;
892                         }
893                 }
894
895                 bool supportsCacheControlMetaTag;
896                 public virtual bool SupportsCacheControlMetaTag {
897                         get {
898                                 if (!Get (HaveSupportsCacheControlMetaTag)) {
899                                         supportsCacheControlMetaTag = ReadBoolean ("supportscachecontrolmetatag");
900                                         Set (HaveSupportsCacheControlMetaTag);
901                                 }
902
903                                 return supportsCacheControlMetaTag;
904                         }
905                 }
906
907                 bool supportsCallback;
908                 public virtual bool SupportsCallback {
909                         get {
910                                 if (!Get (HaveSupportsCallback)) {
911                                         supportsCallback = ReadBoolean ("supportscallback");
912                                         Set (HaveSupportsCallback);
913                                 }
914
915                                 return supportsCallback;
916                         }
917                 }
918
919                 bool supportsCss;
920                 public virtual bool SupportsCss {
921                         get {
922                                 if (!Get (HaveSupportsCss)) {
923                                         supportsCss = ReadBoolean ("supportscss");
924                                         Set (HaveSupportsCss);
925                                 }
926
927                                 return supportsCss;
928                         }
929                 }
930
931                 bool supportsDivAlign;
932                 public virtual bool SupportsDivAlign {
933                         get {
934                                 if (!Get (HaveSupportsDivAlign)) {
935                                         supportsDivAlign = ReadBoolean ("supportsdivalign");
936                                         Set (HaveSupportsDivAlign);
937                                 }
938
939                                 return supportsDivAlign;
940                         }
941                 }
942
943                 bool supportsDivNoWrap;
944                 public virtual bool SupportsDivNoWrap {
945                         get {
946                                 if (!Get (HaveSupportsDivNoWrap)) {
947                                         supportsDivNoWrap = ReadBoolean ("supportsdivnowrap");
948                                         Set (HaveRequiresDBCSCharacter);
949                                 }
950
951                                 return supportsDivNoWrap;
952                         }
953                 }
954
955                 bool supportsEmptyStringInCookieValue;
956                 public virtual bool SupportsEmptyStringInCookieValue {
957                         get {
958                                 if (!Get (HaveSupportsEmptyStringInCookieValue)) {
959                                         supportsEmptyStringInCookieValue = ReadBoolean ("supportsemptystringincookievalue");
960                                         Set (HaveSupportsEmptyStringInCookieValue);
961                                 }
962
963                                 return supportsEmptyStringInCookieValue;
964                         }
965                 }
966
967                 bool supportsFontColor;
968                 public virtual bool SupportsFontColor {
969                         get {
970                                 if (!Get (HaveSupportsFontColor)) {
971                                         supportsFontColor = ReadBoolean ("supportsfontcolor");
972                                         Set (HaveSupportsFontColor);
973                                 }
974
975                                 return supportsFontColor;
976                         }
977                 }
978
979                 bool supportsFontName;
980                 public virtual bool SupportsFontName {
981                         get {
982                                 if (!Get (HaveSupportsFontName)) {
983                                         supportsFontName = ReadBoolean ("supportsfontname");
984                                         Set (HaveSupportsFontName);
985                                 }
986
987                                 return supportsFontName;
988                         }
989                 }
990
991                 bool supportsFontSize;
992                 public virtual bool SupportsFontSize {
993                         get {
994                                 if (!Get (HaveSupportsFontSize)) {
995                                         supportsFontSize = ReadBoolean ("supportsfontsize");
996                                         Set (HaveSupportsFontSize);
997                                 }
998
999                                 return supportsFontSize;
1000                         }
1001                 }
1002
1003                 bool supportsImageSubmit;
1004                 public virtual bool SupportsImageSubmit {
1005                         get {
1006                                 if (!Get (HaveSupportsImageSubmit)) {
1007                                         supportsImageSubmit = ReadBoolean ("supportsimagesubmit");
1008                                         Set (HaveSupportsImageSubmit);
1009                                 }
1010
1011                                 return supportsImageSubmit;
1012                         }
1013                 }
1014
1015                 bool supportsIModeSymbols;
1016                 public virtual bool SupportsIModeSymbols {
1017                         get {
1018                                 if (!Get (HaveSupportsIModeSymbols)) {
1019                                         supportsIModeSymbols = ReadBoolean ("supportsimodesymbols");
1020                                         Set (HaveSupportsIModeSymbols);
1021                                 }
1022
1023                                 return supportsIModeSymbols;
1024                         }
1025                 }
1026
1027                 bool supportsInputIStyle;
1028                 public virtual bool SupportsInputIStyle {
1029                         get {
1030                                 if (!Get (HaveSupportsInputIStyle)) {
1031                                         supportsInputIStyle = ReadBoolean ("supportsinputistyle");
1032                                         Set (HaveSupportsInputIStyle);
1033                                 }
1034
1035                                 return supportsInputIStyle;
1036                         }
1037                 }
1038
1039                 bool supportsInputMode;
1040                 public virtual bool SupportsInputMode {
1041                         get {
1042                                 if (!Get (HaveSupportsInputMode)) {
1043                                         supportsInputMode = ReadBoolean ("supportsinputmode");
1044                                         Set (HaveSupportsInputMode);
1045                                 }
1046
1047                                 return supportsInputMode;
1048                         }
1049                 }
1050
1051                 bool supportsItalic;
1052                 public virtual bool SupportsItalic {
1053                         get {
1054                                 if (!Get (HaveSupportsItalic)) {
1055                                         supportsItalic = ReadBoolean ("supportsitalic");
1056                                         Set (HaveSupportsItalic);
1057                                 }
1058
1059                                 return supportsItalic;
1060                         }
1061                 }
1062
1063                 bool supportsJPhoneMultiMediaAttributes;
1064                 public virtual bool SupportsJPhoneMultiMediaAttributes {
1065                         get {
1066                                 if (!Get (HaveSupportsJPhoneMultiMediaAttributes)) {
1067                                         supportsJPhoneMultiMediaAttributes = ReadBoolean ("supportsjphonemultimediaattributes");
1068                                         Set (HaveSupportsJPhoneMultiMediaAttributes);
1069                                 }
1070
1071                                 return supportsJPhoneMultiMediaAttributes;
1072                         }
1073                 }
1074
1075                 bool supportsJPhoneSymbols;
1076                 public virtual bool SupportsJPhoneSymbols {
1077                         get {
1078                                 if (!Get (HaveSupportsJPhoneSymbols)) {
1079                                         supportsJPhoneSymbols = ReadBoolean ("supportsjphonesymbols");
1080                                         Set (HaveSupportsJPhoneSymbols);
1081                                 }
1082
1083                                 return supportsJPhoneSymbols;
1084                         }
1085                 }
1086
1087                 bool supportsQueryStringInFormAction;
1088                 public virtual bool SupportsQueryStringInFormAction {
1089                         get {
1090                                 if (!Get (HaveSupportsQueryStringInFormAction)) {
1091                                         supportsQueryStringInFormAction = ReadBoolean ("supportsquerystringinformaction");
1092                                         Set (HaveSupportsQueryStringInFormAction);
1093                                 }
1094
1095                                 return supportsQueryStringInFormAction;
1096                         }
1097                 }
1098
1099                 bool supportsRedirectWithCookie;
1100                 public virtual bool SupportsRedirectWithCookie {
1101                         get {
1102                                 if (!Get (HaveSupportsRedirectWithCookie)) {
1103                                         supportsRedirectWithCookie = ReadBoolean ("supportsredirectwithcookie");
1104                                         Set (HaveSupportsRedirectWithCookie);
1105                                 }
1106
1107                                 return supportsRedirectWithCookie;
1108                         }
1109                 }
1110
1111                 bool supportsSelectMultiple;
1112                 public virtual bool SupportsSelectMultiple {
1113                         get {
1114                                 if (!Get (HaveSupportsSelectMultiple)) {
1115                                         supportsSelectMultiple = ReadBoolean ("supportsselectmultiple");
1116                                         Set (HaveSupportsSelectMultiple);
1117                                 }
1118
1119                                 return supportsSelectMultiple;
1120                         }
1121                 }
1122
1123                 bool supportsUncheck;
1124                 public virtual bool SupportsUncheck {
1125                         get {
1126                                 if (!Get (HaveSupportsUncheck)) {
1127                                         supportsUncheck = ReadBoolean ("supportsuncheck");
1128                                         Set (HaveSupportsUncheck);
1129                                 }
1130
1131                                 return supportsUncheck;
1132                         }
1133                 }
1134
1135                 bool supportsXmlHttp;
1136                 public virtual bool SupportsXmlHttp {
1137                         get {
1138                                 if (!Get (HaveSupportsXmlHttp)) {
1139                                         supportsXmlHttp = ReadBoolean ("supportsxmlhttp");
1140                                         Set (HaveSupportsXmlHttp);
1141                                 }
1142
1143                                 return supportsXmlHttp;
1144                         }
1145                 }
1146
1147                 bool useOptimizedCacheKey;
1148                 public bool UseOptimizedCacheKey {
1149                         get {
1150                                 if (!Get (HaveUseOptimizedCacheKey)) {
1151                                         useOptimizedCacheKey = ReadBoolean ("useoptimizedcachekey");
1152                                         Set (HaveUseOptimizedCacheKey);
1153                                 }
1154
1155                                 return useOptimizedCacheKey;
1156                         }
1157                 }
1158                 
1159 #if NET_4_0
1160                 static HttpCapabilitiesProvider _provider = new HttpCapabilitiesDefaultProvider();
1161                 public static HttpCapabilitiesProvider BrowserCapabilitiesProvider { 
1162                         get { return _provider; }
1163                         set { _provider = value; }
1164                 }
1165 #endif
1166         }
1167 }
1168