]> err.no Git - sope/blob - sope-appserver/NGObjWeb/NGObjWeb/WEClientCapabilities.h
fixed copyrights for 2005
[sope] / sope-appserver / NGObjWeb / NGObjWeb / WEClientCapabilities.h
1 /*
2   Copyright (C) 2000-2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
6   SOPE is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with SOPE; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21
22 #ifndef __WEExtensions_WEClientCapabilities_H__
23 #define __WEExtensions_WEClientCapabilities_H__
24
25 #import <Foundation/NSObject.h>
26
27 @class NSString;
28
29 @interface WEClientCapabilities : NSObject
30 {
31   NSString *userAgent;
32   
33   unsigned short browser;
34   unsigned short os;
35   unsigned short cpu;
36   unsigned char  browserMajorVersion;
37   unsigned char  browserMinorVersion;
38   
39   struct {
40     int acceptUTF8:1;
41     int reserved:31;
42   } flags;
43 }
44
45 /* accessors */
46
47 - (NSString *)userAgent;
48 - (NSString *)userAgentType;
49 - (NSString *)os;
50 - (NSString *)cpu;
51 - (unsigned char)majorVersion;
52 - (unsigned char)minorVersion;
53
54 /* browser capabilities */
55
56 - (BOOL)isJavaScriptBrowser;
57 - (BOOL)isVBScriptBrowser;
58 - (BOOL)isFastTableBrowser;
59 - (BOOL)isCSS1Browser;
60 - (BOOL)isCSS2Browser;
61 - (BOOL)ignoresCSSOnFormElements;
62 - (BOOL)isTextModeBrowser;
63 - (BOOL)isIFrameBrowser;
64 - (BOOL)isXULBrowser;
65 - (BOOL)isRobot;
66 - (BOOL)isDAVClient;
67 - (BOOL)isXmlRpcClient;
68 - (BOOL)isBLogClient;
69 - (BOOL)isRSSClient;
70
71 - (BOOL)doesSupportCSSOverflow;
72 - (BOOL)doesSupportDHTMLDragAndDrop;
73 - (BOOL)doesSupportXMLDataIslands;
74 - (BOOL)doesSupportUTF8Encoding;
75
76 /* user-agent (it's better to use ^capabilities !) */
77
78 - (BOOL)isInternetExplorer;
79 - (BOOL)isInternetExplorer5;
80 - (BOOL)isNetscape;
81 - (BOOL)isNetscape6;
82 - (BOOL)isLynx;
83 - (BOOL)isOpera;
84 - (BOOL)isAmaya;
85 - (BOOL)isEmacs;
86 - (BOOL)isWget;
87 - (BOOL)isWebFolder;
88 - (BOOL)isMozilla;
89 - (BOOL)isOmniWeb;
90 - (BOOL)isICab;
91 - (BOOL)isKonqueror;
92
93 /* OS */
94
95 - (BOOL)isWindowsBrowser;
96 - (BOOL)isLinuxBrowser;
97 - (BOOL)isMacBrowser;
98 - (BOOL)isSunOSBrowser;
99 - (BOOL)isUnixBrowser;
100 - (BOOL)isX11Browser;
101
102 @end
103
104 #include <NGObjWeb/WORequest.h>
105
106 @interface WORequest(ClientCapabilities)
107
108 /* the object is cached in the WORequest's userInfo */
109 - (WEClientCapabilities *)clientCapabilities;
110
111 @end
112
113 #include <NGObjWeb/WODynamicElement.h>
114
115 /*
116   The following element uses JavaScript to find out even more about the client
117   browser.
118 */
119
120 @interface JSClientCapabilityDetector : WODynamicElement
121 {
122   WOAssociation *formName;
123   WOAssociation *clientCaps;
124 }
125 @end
126
127 #endif /* __WEExtensions_WEClientCapabilities_H__ */