summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/webkit/WebScriptObject.inc
blob: a61e00ad114c6494f8d4752eceeb4f51691a6d70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{ Parsed from Webkit.framework WebScriptObject.h }

{$ifdef TYPES}
{$ifndef WEBSCRIPTOBJECT_PAS_T}
{$define WEBSCRIPTOBJECT_PAS_T}

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef WEBSCRIPTOBJECT_PAS_R}
{$define WEBSCRIPTOBJECT_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef WEBSCRIPTOBJECT_PAS_F}
{$define WEBSCRIPTOBJECT_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef WEBSCRIPTOBJECT_PAS_S}
{$define WEBSCRIPTOBJECT_PAS_S}

{$endif}
{$endif}

{$ifdef FORWARD}
  WebScriptObject = objcclass;
  WebScriptObjectPointer = ^WebScriptObject;
  WebScriptObjectPtr = WebScriptObjectPointer;
  WebUndefined = objcclass;
  WebUndefinedPointer = ^WebUndefined;
  WebUndefinedPtr = WebUndefinedPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef WEBSCRIPTOBJECT_PAS_C}
{$define WEBSCRIPTOBJECT_PAS_C}

{ WebScriptObject }
  WebScriptObject = objcclass external (NSObject)
  private
    _private: WebScriptObjectPrivate;
    
  public
    class function throwException(exceptionMessage: NSString): Boolean; message 'throwException:';
    function JSObject: JSObjectRef; message 'JSObject';
    function callWebScriptMethod_withArguments(name: NSString; arguments: NSArray): id; message 'callWebScriptMethod:withArguments:';
    function evaluateWebScript(script: NSString): id; message 'evaluateWebScript:';
    procedure removeWebScriptKey(name: NSString); message 'removeWebScriptKey:';
    function stringRepresentation: NSString; message 'stringRepresentation';
    function webScriptValueAtIndex(index: cuint): id; message 'webScriptValueAtIndex:';
    procedure setWebScriptValueAtIndex_value(index: cuint; value: id); message 'setWebScriptValueAtIndex:value:';
    procedure setException(description_: NSString); message 'setException:';
  end;

{ WebUndefined }
  WebUndefined = objcclass external (NSObject, NSCodingProtocol, NSCopyingProtocol)
    
  public
    class function undefined: WebUndefined; message 'undefined';

    { Adopted Protocols }
    procedure encodeWithCoder(aCoder: NSCoder);
    function initWithCoder(aDecoder: NSCoder): id;
    function copyWithZone(zone_: NSZonePtr): id;
  end;

{ WebScriptingCategory }
  WebScriptingCategory = objccategory external (NSObject)
    class function webScriptNameForSelector(selector: SEL): NSString; message 'webScriptNameForSelector:';
    class function isSelectorExcludedFromWebScript(selector: SEL): Boolean; message 'isSelectorExcludedFromWebScript:';
    class function webScriptNameForKey(name: PChar): NSString; message 'webScriptNameForKey:';
    class function isKeyExcludedFromWebScript(name: PChar): Boolean; message 'isKeyExcludedFromWebScript:';
    function invokeUndefinedMethodFromWebScript_withArguments(name: NSString; arguments: NSArray): id; message 'invokeUndefinedMethodFromWebScript:withArguments:';
    function invokeDefaultMethodWithArguments(arguments: NSArray): id; message 'invokeDefaultMethodWithArguments:';
    procedure finalizeForWebScript; message 'finalizeForWebScript';
  end;

{$endif}
{$endif}