]> err.no Git - sope/blob - skyrix-sope/NGScripting/NGScriptLanguage.h
added svn:keywords and svn:ignore where appropriate. removed CVS artifacts.
[sope] / skyrix-sope / NGScripting / NGScriptLanguage.h
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
6   OGo 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   OGo 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 OGo; 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 // $Id$
22
23 #ifndef __NGScriptLanguage_H__
24 #define __NGScriptLanguage_H__
25
26 #import <Foundation/NSObject.h>
27
28 @class NGObjectMappingContext;
29
30 @interface NGScriptLanguage : NSObject < NSCoding >
31
32 + (id)languageWithName:(NSString *)_language;
33 - (id)initWithLanguage:(NSString *)_language;
34
35 /* evaluation */
36
37 - (id)evaluateScript:(NSString *)_script onObject:(id)_object
38   source:(NSString *)_source line:(unsigned)_line;
39
40 /* function calls */
41
42 - (id)callFunction:(NSString *)_func onObject:(id)_object;
43 - (id)callFunction:(NSString *)_func withArgument:(id)_arg0 onObject:(id)_o; 
44 - (id)callFunction:(NSString *)_func
45   withArgument:(id)_arg0
46   withArgument:(id)_arg1
47   onObject:(id)_object;
48
49 /* reflection */
50
51 - (BOOL)object:(id)_object hasFunctionNamed:(NSString *)_name;
52
53 /* shadow objects */
54
55 - (id)createShadowForMaster:(id)_master; /* returns a retained object */
56
57 /* object mapping */
58
59 - (NGObjectMappingContext *)activeMappingContext;
60 - (NGObjectMappingContext *)createMappingContext; // result is retained!
61
62 @end
63
64 /*
65   Shadow objects are always tied to a specific language ...
66 */
67
68 @protocol NGScriptShadow
69
70 - (void)invalidateShadow;
71
72 - (id)evaluateScript:(NSString *)_script;
73 - (id)callScriptFunction:(NSString *)_func;
74 - (BOOL)hasFunctionNamed:(NSString *)_func;
75
76 @end
77
78 #endif /* __NGScriptLanguage_H__ */