summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/foundation/NSScriptCommand.inc
blob: b014efa1952434bec4b05f8d35db96a9176a7d10 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{ Parsed from Foundation.framework NSScriptCommand.h }

{$ifdef TYPES}
{$ifndef NSSCRIPTCOMMAND_PAS_T}
{$define NSSCRIPTCOMMAND_PAS_T}

{ Constants }

const
  NSNoScriptError = 0;
  NSReceiverEvaluationScriptError = 1;
  NSKeySpecifierEvaluationScriptError = 2;
  NSArgumentEvaluationScriptError = 3;
  NSReceiversCantHandleCommandScriptError = 4;
  NSRequiredArgumentsMissingScriptError = 5;
  NSArgumentsWrongScriptError = 6;
  NSUnknownKeyScriptError = 7;
  NSInternalScriptError = 8;
  NSOperationNotSupportedForKeyScriptError = 9;
  NSCannotCreateScriptCommandError = 10;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSSCRIPTCOMMAND_PAS_R}
{$define NSSCRIPTCOMMAND_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSSCRIPTCOMMAND_PAS_F}
{$define NSSCRIPTCOMMAND_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSSCRIPTCOMMAND_PAS_S}
{$define NSSCRIPTCOMMAND_PAS_S}

{$endif}
{$endif}

{$ifdef FORWARD}
  NSScriptCommand = objcclass;
  NSScriptCommandPointer = ^NSScriptCommand;
  NSScriptCommandPtr = NSScriptCommandPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSSCRIPTCOMMAND_PAS_C}
{$define NSSCRIPTCOMMAND_PAS_C}

{ NSScriptCommand }
  NSScriptCommand = objcclass external (NSObject, NSCodingProtocol)
  private
    _commandDescription: NSScriptCommandDescription;
    _directParameter: id;
    _receiversSpecifier: NSScriptObjectSpecifier;
    _evaluatedReceivers: id;
    _arguments: NSDictionary;
    _evaluatedArguments: NSMutableDictionary;
    __flags: record
      case byte of
       0: (_anonbitfield_NSScriptCommand0: cuint);
       1: (data: bitpacked record
        hasEvaluatedReceivers: 0..1;
        hasEvaluatedArguments: 0..1;
        RESERVED: 0..((1 shl 30)-1);
       end;
      );
      end;
    _moreVars: id;
    _reserved: Pointer;
    
  public
    function initWithCommandDescription(commandDef: NSScriptCommandDescription): id; message 'initWithCommandDescription:';
    function commandDescription: NSScriptCommandDescription; message 'commandDescription';
    procedure setDirectParameter(directParameter_: id); message 'setDirectParameter:';
    function directParameter: id; message 'directParameter';
    procedure setReceiversSpecifier(receiversRef: NSScriptObjectSpecifier); message 'setReceiversSpecifier:';
    function receiversSpecifier: NSScriptObjectSpecifier; message 'receiversSpecifier';
    function evaluatedReceivers: id; message 'evaluatedReceivers';
    procedure setArguments(args: NSDictionary); message 'setArguments:';
    function arguments: NSDictionary; message 'arguments';
    function evaluatedArguments: NSDictionary; message 'evaluatedArguments';
    function isWellFormed: Boolean; message 'isWellFormed';
    function performDefaultImplementation: id; message 'performDefaultImplementation';
    function executeCommand: id; message 'executeCommand';
    procedure setScriptErrorNumber(errorNumber: cint); message 'setScriptErrorNumber:';
    procedure setScriptErrorOffendingObjectDescriptor(errorOffendingObjectDescriptor: NSAppleEventDescriptor); message 'setScriptErrorOffendingObjectDescriptor:';
    procedure setScriptErrorExpectedTypeDescriptor(errorExpectedTypeDescriptor: NSAppleEventDescriptor); message 'setScriptErrorExpectedTypeDescriptor:';
    procedure setScriptErrorString(errorString: NSString); message 'setScriptErrorString:';
    function scriptErrorNumber: cint; message 'scriptErrorNumber';
    function scriptErrorOffendingObjectDescriptor: NSAppleEventDescriptor; message 'scriptErrorOffendingObjectDescriptor';
    function scriptErrorExpectedTypeDescriptor: NSAppleEventDescriptor; message 'scriptErrorExpectedTypeDescriptor';
    function scriptErrorString: NSString; message 'scriptErrorString';
    class function currentCommand: NSScriptCommand; message 'currentCommand';
    function appleEvent: NSAppleEventDescriptor; message 'appleEvent';
    procedure suspendExecution; message 'suspendExecution';
    procedure resumeExecutionWithResult(result_: id); message 'resumeExecutionWithResult:';

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

{$endif}
{$endif}