1 /**
2 The Editor's popup dialog for creating new $(D Script) files.
3 
4 Copyright:
5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur.  
6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)  
7 Copyright (c) 2017-2018 Godot-D contributors  
8 
9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License)
10 
11 
12 */
13 module godot.scriptcreatedialog;
14 import std.meta : AliasSeq, staticIndexOf;
15 import std.traits : Unqual;
16 import godot.d.meta;
17 import godot.core;
18 import godot.c;
19 import godot.d.bind;
20 import godot.d.reference;
21 import godot.object;
22 import godot.classdb;
23 import godot.confirmationdialog;
24 import godot.acceptdialog;
25 import godot.windowdialog;
26 import godot.popup;
27 import godot.control;
28 import godot.canvasitem;
29 import godot.node;
30 /**
31 The Editor's popup dialog for creating new $(D Script) files.
32 
33 The ScriptCreateDialog creates script files according to a given template for a given scripting language. The standard use is to configure its fields prior to calling a $(D popup)() method.
34 
35 
36 func _ready():
37 	dialog.config("Node", "res://new_node.gd") # for in-engine types
38 	dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # for script types
39 	dialog.popup_centered()
40 
41 
42 */
43 @GodotBaseClass struct ScriptCreateDialog
44 {
45 	enum string _GODOT_internal_name = "ScriptCreateDialog";
46 public:
47 @nogc nothrow:
48 	union { godot_object _godot_object; ConfirmationDialog _GODOT_base; }
49 	alias _GODOT_base this;
50 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
51 	package(godot) __gshared bool _classBindingInitialized = false;
52 	package(godot) static struct _classBinding
53 	{
54 		__gshared:
55 		@GodotName("_class_name_changed") GodotMethod!(void, String) _classNameChanged;
56 		@GodotName("_parent_name_changed") GodotMethod!(void, String) _parentNameChanged;
57 		@GodotName("_lang_changed") GodotMethod!(void, long) _langChanged;
58 		@GodotName("_built_in_pressed") GodotMethod!(void) _builtInPressed;
59 		@GodotName("_browse_path") GodotMethod!(void, bool, bool) _browsePath;
60 		@GodotName("_file_selected") GodotMethod!(void, String) _fileSelected;
61 		@GodotName("_path_changed") GodotMethod!(void, String) _pathChanged;
62 		@GodotName("_path_entered") GodotMethod!(void, String) _pathEntered;
63 		@GodotName("_template_changed") GodotMethod!(void, long) _templateChanged;
64 		@GodotName("config") GodotMethod!(void, String, String, bool) config;
65 	}
66 	bool opEquals(in ScriptCreateDialog other) const { return _godot_object.ptr is other._godot_object.ptr; }
67 	ScriptCreateDialog opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
68 	bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
69 	mixin baseCasts;
70 	static ScriptCreateDialog _new()
71 	{
72 		static godot_class_constructor constructor;
73 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("ScriptCreateDialog");
74 		if(constructor is null) return typeof(this).init;
75 		return cast(ScriptCreateDialog)(constructor());
76 	}
77 	@disable new(size_t s);
78 	/**
79 	
80 	*/
81 	void _classNameChanged(StringArg0)(in StringArg0 arg0)
82 	{
83 		Array _GODOT_args = Array.empty_array;
84 		_GODOT_args.append(arg0);
85 		String _GODOT_method_name = String("_class_name_changed");
86 		this.callv(_GODOT_method_name, _GODOT_args);
87 	}
88 	/**
89 	
90 	*/
91 	void _parentNameChanged(StringArg0)(in StringArg0 arg0)
92 	{
93 		Array _GODOT_args = Array.empty_array;
94 		_GODOT_args.append(arg0);
95 		String _GODOT_method_name = String("_parent_name_changed");
96 		this.callv(_GODOT_method_name, _GODOT_args);
97 	}
98 	/**
99 	
100 	*/
101 	void _langChanged(in long arg0)
102 	{
103 		Array _GODOT_args = Array.empty_array;
104 		_GODOT_args.append(arg0);
105 		String _GODOT_method_name = String("_lang_changed");
106 		this.callv(_GODOT_method_name, _GODOT_args);
107 	}
108 	/**
109 	
110 	*/
111 	void _builtInPressed()
112 	{
113 		Array _GODOT_args = Array.empty_array;
114 		String _GODOT_method_name = String("_built_in_pressed");
115 		this.callv(_GODOT_method_name, _GODOT_args);
116 	}
117 	/**
118 	
119 	*/
120 	void _browsePath(in bool arg0, in bool arg1)
121 	{
122 		Array _GODOT_args = Array.empty_array;
123 		_GODOT_args.append(arg0);
124 		_GODOT_args.append(arg1);
125 		String _GODOT_method_name = String("_browse_path");
126 		this.callv(_GODOT_method_name, _GODOT_args);
127 	}
128 	/**
129 	
130 	*/
131 	void _fileSelected(StringArg0)(in StringArg0 arg0)
132 	{
133 		Array _GODOT_args = Array.empty_array;
134 		_GODOT_args.append(arg0);
135 		String _GODOT_method_name = String("_file_selected");
136 		this.callv(_GODOT_method_name, _GODOT_args);
137 	}
138 	/**
139 	
140 	*/
141 	void _pathChanged(StringArg0)(in StringArg0 arg0)
142 	{
143 		Array _GODOT_args = Array.empty_array;
144 		_GODOT_args.append(arg0);
145 		String _GODOT_method_name = String("_path_changed");
146 		this.callv(_GODOT_method_name, _GODOT_args);
147 	}
148 	/**
149 	
150 	*/
151 	void _pathEntered(StringArg0)(in StringArg0 arg0)
152 	{
153 		Array _GODOT_args = Array.empty_array;
154 		_GODOT_args.append(arg0);
155 		String _GODOT_method_name = String("_path_entered");
156 		this.callv(_GODOT_method_name, _GODOT_args);
157 	}
158 	/**
159 	
160 	*/
161 	void _templateChanged(in long arg0)
162 	{
163 		Array _GODOT_args = Array.empty_array;
164 		_GODOT_args.append(arg0);
165 		String _GODOT_method_name = String("_template_changed");
166 		this.callv(_GODOT_method_name, _GODOT_args);
167 	}
168 	/**
169 	Prefills required fields to configure the ScriptCreateDialog for use.
170 	*/
171 	void config(StringArg0, StringArg1)(in StringArg0 inherits, in StringArg1 path, in bool built_in_enabled = true)
172 	{
173 		checkClassBinding!(typeof(this))();
174 		ptrcall!(void)(_classBinding.config, _godot_object, inherits, path, built_in_enabled);
175 	}
176 }