001 
002 /*
003  *  JScripter Standard 1.0 - To Script In Java
004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
005  *  
006  *  This program is free software: you can redistribute it and/or modify
007  *  it under the terms of the GNU Affero General Public License as published by
008  *  the Free Software Foundation, either version 3 of the License, or
009  *  (at your option) any later version.
010  *  
011  *  This program is distributed in the hope that it will be useful,
012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014  *  GNU Affero General Public License for more details.
015  *  
016  *  You should have received a copy of the GNU Affero General Public License
017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
018  */
019 
020 package js.user;
021 
022 import js.*;
023 import js.core.*;
024 
025 /**
026  * <p>An <b>opaque</b> class representing JavaScript client-side objects of the global 
027  * {@link JsClient#HTMLFrameElement} class.</p>
028  * <p>This class represents a frame 
029  * in an HTML page, or a {@link JsHTMLElement} object created with the HTML 
030  * <tt>&lt;frame&gt;</tt> tag.</p> 
031  *
032  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
033  *
034  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
035  * generated into the target codes. Re-compilers must exit with error on the operations of
036  * accessing that kind of class objects.
037  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
038  * and <tt>instanceof</tt> to it always <tt>true</tt>.
039  */
040 public class JsHTMLFrameElement extends JsClient.HTMLFrameElement.Prototype
041 {
042     /**
043      * <p>An <b>internal</b> class containing membership data for its enclosing
044      * opaque class.</p>
045      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
046      * class members.</p>
047      *
048      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
049      * 
050      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
051      */
052     protected static abstract class Members extends JsClient.HTMLFrameElement.Prototype.Members
053     {
054         /**
055          * <p>An <b>internal</b> static field defining a member ID of the field name and
056          * used internally to define a member of the same name.</p>
057          * @since 1.0
058          * @see JsHTMLFrameElement#contentDocument
059          * @see JsHTMLFrameElement.Member#contentDocument
060          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
061          */
062         public final static Mid contentDocument = id("contentDocument");
063         /**
064          * <p>An <b>internal</b> static field defining a member ID of the field name and
065          * used internally to define a member of the same name.</p>
066          * @since 1.0
067          * @see JsHTMLFrameElement#src
068          * @see JsHTMLFrameElement.Member#src
069          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
070          */
071         public final static Mid src             = id("src"            );
072         /**
073          * <p>An <b>internal</b> static field defining a member ID of the field name and
074          * used internally to define a member of the same name.</p>
075          * @since 1.0
076          * @see JsHTMLFrameElement#frameBorder
077          * @see JsHTMLFrameElement.Member#frameBorder
078          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
079          */
080         public final static Mid frameBorder     = id("frameBorder"    );
081         /**
082          * <p>An <b>internal</b> static field defining a member ID of the field name and
083          * used internally to define a member of the same name.</p>
084          * @since 1.0
085          * @see JsHTMLFrameElement#longDesc
086          * @see JsHTMLFrameElement.Member#longDesc
087          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
088          */
089         public final static Mid longDesc        = id("longDesc"       );
090         /**
091          * <p>An <b>internal</b> static field defining a member ID of the field name and
092          * used internally to define a member of the same name.</p>
093          * @since 1.0
094          * @see JsHTMLFrameElement#marginHeight
095          * @see JsHTMLFrameElement.Member#marginHeight
096          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
097          */
098         public final static Mid marginHeight    = id("marginHeight"   );
099         /**
100          * <p>An <b>internal</b> static field defining a member ID of the field name and
101          * used internally to define a member of the same name.</p>
102          * @since 1.0
103          * @see JsHTMLFrameElement#marginWidth
104          * @see JsHTMLFrameElement.Member#marginWidth
105          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
106          */
107         public final static Mid marginWidth     = id("marginWidth"    );
108         /**
109          * <p>An <b>internal</b> static field defining a member ID of the field name and
110          * used internally to define a member of the same name.</p>
111          * @since 1.0
112          * @see JsHTMLFrameElement#name
113          * @see JsHTMLFrameElement.Member#name
114          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
115          */
116         public final static Mid name            = id("name"           );
117         /**
118          * <p>An <b>internal</b> static field defining a member ID of the field name and
119          * used internally to define a member of the same name.</p>
120          * @since 1.0
121          * @see JsHTMLFrameElement#noResize
122          * @see JsHTMLFrameElement.Member#noResize
123          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
124          */
125         public final static Mid noResize        = id("noResize"       );
126         /**
127          * <p>An <b>internal</b> static field defining a member ID of the field name and
128          * used internally to define a member of the same name.</p>
129          * @since 1.0
130          * @see JsHTMLFrameElement#scrolling
131          * @see JsHTMLFrameElement.Member#scrolling
132          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
133          */
134         public final static Mid scrolling       = id("scrolling"      );
135     }
136     /**
137      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
138      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
139      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
140      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
141      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
142      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
143      * either circumstance, the field names must be exactly same as the member names, as 
144      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
145      * based on the field names.</p>
146      *
147      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
148      * 
149      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
150      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
151      * of class objects.
152      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
153      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
154      * <pre>q.m</pre>
155      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
156      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
157      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
158      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
159      * <pre>m</pre>
160      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
161      * error on the access to <b>opaque</b> fields declared by this class under any other 
162      * circumstances.
163      */
164     public static class Member extends JsClient.HTMLFrameElement.Prototype.Member
165     {
166         /**
167          * <p>Internally constructs a member based on a qualifying member.</p>
168          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
169          * or <b>internal</b> classes or class members.</p>
170          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
171          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
172          * declared in the declaring class of this constructor itself or its subclasses. 
173          * Under this circumstance, the field names must be exactly same as the member 
174          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
175          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
176          * to their names appending to the name resolved from the specified qualifying 
177          * member with a dot in between.</p>
178          * @param q A qualifying member
179          * @param mid The ID of the member to construct
180          * @since 1.0
181          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
182          */
183         public Member(JsObject.Member q, Mid mid) {
184             super(q, mid);
185         }
186         /**
187          * <p>Internally constructs a member without a qualifying member.</p>
188          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
189          * or <b>internal</b> classes or class members.</p>
190          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
191          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
192          * declared in <b>opaque</b> types other than the declaring class of this constructor 
193          * itself and its subclasses. Under this circumstance, the field names must be
194          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
195          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
196          * @param mid The ID of the member to construct
197          * @since 1.0
198          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
199          */
200         public Member(Mid mid) {
201             super(mid);
202         }
203         @Override
204         /**
205          * <p>Evaluates the property, represented by the current member instance, of the
206          * argument object.</p>
207          * @param o The argument object
208          * @return The value of the current member based on the object argument.
209          * @since 1.0
210          * @javascript Re-compilers must convert the instance invocation of this method into
211          * the JavaScript expression: 
212          * <pre>o.m</pre>
213          * where <tt>m</tt> is the identifier name resolved from the current member
214          * instance of the invocation.
215          */
216         public JsHTMLFrameElement with(ObjectLike o) {
217             return new JsHTMLFrameElement(super.with(o));
218         }
219 
220         /**
221          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
222          * name of this field, qualified by the current member instance of the field, and 
223          * to access the property of the name on an object.</p>
224          * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
225          * object is a read-only reference to the document this frame contains, if there 
226          * is any and it is available, or <tt>null</tt> otherwise.</p> 
227          * @since 1.0
228          * @javascript Re-compilers must resolve the member of this instance field to the
229          * identifier of the field name appending to the identifier resolved from its 
230          * qualifying member with a dot in between.
231          */
232         public final JsHTMLDocument.Member contentDocument = new JsHTMLDocument.Member(this, Members.contentDocument);
233         /**
234          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
235          * name of this field, qualified by the current member instance of the field, and 
236          * to access the property of the name on an object.</p>
237          * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
238          * object refers to a boolean value specifying whether to forbid user from 
239          * resizing this frame.</p> 
240          * @since 1.0
241          * @javascript Re-compilers must resolve the member of this instance field to the
242          * identifier of the field name appending to the identifier resolved from its 
243          * qualifying member with a dot in between.
244          */
245         public final Value.Boolean.Member noResize = new Value.Boolean.Member(this, Members.noResize);
246         /**
247          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
248          * name of this field, qualified by the current member instance of the field, and 
249          * to access the property of the name on an object.</p>
250          * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
251          * object refers to a string designating the URL from which the initial content 
252          * was loaded. Setting this property causes the frame to load a new document. 
253          * The property simply mirrors the <tt>src</tt> attribute of the HTML <tt>&lt;frame&gt;</tt> 
254          * tag and it is not a {@link JsLocation} object like {@link JsWindow#location}.</p> 
255          * @since 1.0
256          * @javascript Re-compilers must resolve the member of this instance field to the
257          * identifier of the field name appending to the identifier resolved from its 
258          * qualifying member with a dot in between.
259          */
260         public final Value.String.Member src          = new Value.String.Member(this, Members.src         );
261         /**
262          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
263          * name of this field, qualified by the current member instance of the field, and 
264          * to access the property of the name on an object.</p>
265          * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
266          * object refers to a string specifying the requested frame borders. 
267          * Set the property to "0" for a frame without borders.</p>
268          * @since 1.0
269          * @javascript Re-compilers must resolve the member of this instance field to the
270          * identifier of the field name appending to the identifier resolved from its 
271          * qualifying member with a dot in between.
272          */
273         public final Value.String.Member frameBorder  = new Value.String.Member(this, Members.frameBorder );
274         /**
275          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
276          * name of this field, qualified by the current member instance of the field, and 
277          * to access the property of the name on an object.</p>
278          * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
279          * object refers to a string designating a long description of this frame. The 
280          * description should supplement the short description provided by the {@link JsHTMLElement#title} 
281          * attribute, and may be particularly useful for non-visual web browsers.</p>
282          * @since 1.0
283          * @javascript Re-compilers must resolve the member of this instance field to the
284          * identifier of the field name appending to the identifier resolved from its 
285          * qualifying member with a dot in between.
286          */
287         public final Value.String.Member longDesc     = new Value.String.Member(this, Members.longDesc    );
288         /**
289          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
290          * name of this field, qualified by the current member instance of the field, and 
291          * to access the property of the name on an object.</p>
292          * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
293          * object refers to a string designating the amount of space to be left between 
294          * the frame's contents in its left and right margins. The value must be greater 
295          * than zero in pixels. The default value depends on the web browser.</p>
296          * @since 1.0
297          * @javascript Re-compilers must resolve the member of this instance field to the
298          * identifier of the field name appending to the identifier resolved from its 
299          * qualifying member with a dot in between.
300          */
301         public final Value.String.Member marginHeight = new Value.String.Member(this, Members.marginHeight);
302         /**
303          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
304          * name of this field, qualified by the current member instance of the field, and 
305          * to access the property of the name on an object.</p>
306          * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
307          * object refers to a string designating the amount of space to be left between 
308          * the frame's contents in its top and bottom margins. The value must be greater 
309          * than zero in pixels. The default value depends on the web browser.</p>
310          * @since 1.0
311          * @javascript Re-compilers must resolve the member of this instance field to the
312          * identifier of the field name appending to the identifier resolved from its 
313          * qualifying member with a dot in between.
314          */
315         public final Value.String.Member marginWidth  = new Value.String.Member(this, Members.marginWidth );
316         /**
317          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
318          * name of this field, qualified by the current member instance of the field, and 
319          * to access the property of the name on an object.</p>
320          * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
321          * object refers to a string assigning a name to the current frame. The name 
322          * may be used as the target of subsequent links.</p> 
323          * @since 1.0
324          * @javascript Re-compilers must resolve the member of this instance field to the
325          * identifier of the field name appending to the identifier resolved from its 
326          * qualifying member with a dot in between.
327          */
328         public final Value.String.Member name         = new Value.String.Member(this, Members.name        );
329         /**
330          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
331          * name of this field, qualified by the current member instance of the field, and 
332          * to access the property of the name on an object.</p>
333          * to access the property of the name on an object.</p>
334          * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
335          * object refers to a string specifying whether or not the frame should have 
336          * scrollbars. Possible values: 
337          * <ul>
338          * <li><tt>"auto"</tt>: Tells the browser to provide scrollbars for the frame 
339          * window when necessary. This is the default value.</li>
340          * <li><tt>"yes"</tt>: Tells the browser to always provide scrollbars for the 
341          * frame window.</li>
342          * <li><tt>"no"</tt>: Tells the browser not to provide scrollbars for the frame 
343          * window.</li>
344          * </ul></p>
345          * @since 1.0
346          * @javascript Re-compilers must resolve the member of this instance field to the
347          * identifier of the field name appending to the identifier resolved from its 
348          * qualifying member with a dot in between.
349          */
350         public final Value.String.Member scrolling    = new Value.String.Member(this, Members.scrolling   );
351     }
352 
353     /**
354      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
355      * with the wrapping constructor.</p>
356      * @param var The argument of an <b>opaque</b> object.
357      * @since 1.0
358      * @javascript Re-compilers must ignore the construction operation of this constructor,
359      * that is, replacing it with its only argument.
360      */
361     public JsHTMLFrameElement(JsObject var) {
362         super(var);
363     }
364 
365     /**
366      * <p>An <b>opaque</b> static field defining a member that is named by the field name
367      * without a qualifying member and to access the property of the name on an object.</p>
368      * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
369      * object is a read-only reference to the document this frame contains, if there 
370      * is any and it is available, or <tt>null</tt> otherwise.</p> 
371      * @since 1.0
372      * @javascript Re-compilers must resolve the member of this static field to the
373      * identifier of the field name.
374      */
375     public static final JsHTMLDocument.Member contentDocument = new JsHTMLDocument.Member(Members.contentDocument);
376     /**
377      * <p>An <b>opaque</b> static field defining a member that is named by the field name
378      * without a qualifying member and to access the property of the name on an object.</p>
379      * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
380      * object refers to a boolean value specifying whether to forbid user from 
381      * resizing this frame.</p> 
382      * @since 1.0
383      * @javascript Re-compilers must resolve the member of this static field to the
384      * identifier of the field name.
385      */
386     public static final Value.Boolean.Member noResize = new Value.Boolean.Member(Members.noResize);
387     /**
388      * <p>An <b>opaque</b> static field defining a member that is named by the field name
389      * without a qualifying member and to access the property of the name on an object.</p>
390      * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
391      * object refers to a string designating the URL from which the initial content 
392      * was loaded. Setting this property causes the frame to load a new document. 
393      * The property simply mirrors the <tt>src</tt> attribute of the HTML <tt>&lt;frame&gt;</tt> 
394      * tag and it is not a {@link JsLocation} object like {@link JsWindow#location}.</p> 
395      * @since 1.0
396      * @javascript Re-compilers must resolve the member of this static field to the
397      * identifier of the field name.
398      */
399     public static final Value.String.Member src          = new Value.String.Member(Members.src         );
400     /**
401      * <p>An <b>opaque</b> static field defining a member that is named by the field name
402      * without a qualifying member and to access the property of the name on an object.</p>
403      * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
404      * object refers to a string specifying the requested frame borders. 
405      * Set the property to "0" for a frame without borders.</p>
406      * @since 1.0
407      * @javascript Re-compilers must resolve the member of this static field to the
408      * identifier of the field name.
409      */
410     public static final Value.String.Member frameBorder  = new Value.String.Member(Members.frameBorder );
411     /**
412      * <p>An <b>opaque</b> static field defining a member that is named by the field name
413      * without a qualifying member and to access the property of the name on an object.</p>
414      * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
415      * object refers to a string designating a long description of this frame. The 
416      * description should supplement the short description provided by the {@link JsHTMLElement#title} 
417      * attribute, and may be particularly useful for non-visual web browsers.</p>
418      * @since 1.0
419      * @javascript Re-compilers must resolve the member of this static field to the
420      * identifier of the field name.
421      */
422     public static final Value.String.Member longDesc     = new Value.String.Member(Members.longDesc    );
423     /**
424      * <p>An <b>opaque</b> static field defining a member that is named by the field name
425      * without a qualifying member and to access the property of the name on an object.</p>
426      * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
427      * object refers to a string designating the amount of space to be left between 
428      * the frame's contents in its left and right margins. The value must be greater 
429      * than zero in pixels. The default value depends on the web browser.</p>
430      * @since 1.0
431      * @javascript Re-compilers must resolve the member of this static field to the
432      * identifier of the field name.
433      */
434     public static final Value.String.Member marginHeight = new Value.String.Member(Members.marginHeight);
435     /**
436      * <p>An <b>opaque</b> static field defining a member that is named by the field name
437      * without a qualifying member and to access the property of the name on an object.</p>
438      * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
439      * object refers to a string designating the amount of space to be left between 
440      * the frame's contents in its top and bottom margins. The value must be greater 
441      * than zero in pixels. The default value depends on the web browser.</p>
442      * @since 1.0
443      * @javascript Re-compilers must resolve the member of this static field to the
444      * identifier of the field name.
445      */
446     public static final Value.String.Member marginWidth  = new Value.String.Member(Members.marginWidth );
447     /**
448      * <p>An <b>opaque</b> static field defining a member that is named by the field name
449      * without a qualifying member and to access the property of the name on an object.</p>
450      * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
451      * object refers to a string assigning a name to the current frame. The name 
452      * may be used as the target of subsequent links.</p> 
453      * @since 1.0
454      * @javascript Re-compilers must resolve the member of this static field to the
455      * identifier of the field name.
456      */
457     public static final Value.String.Member name         = new Value.String.Member(Members.name        );
458     /**
459      * <p>An <b>opaque</b> static field defining a member that is named by the field name
460      * without a qualifying member and to access the property of the name on an object.</p>
461      * <p>The property, identified by this member, of a {@link JsHTMLFrameElement} 
462      * object refers to a string specifying whether or not the frame should have 
463      * scrollbars. Possible values: 
464      * <ul>
465      * <li><tt>"auto"</tt>: Tells the browser to provide scrollbars for the frame 
466      * window when necessary. This is the default value.</li>
467      * <li><tt>"yes"</tt>: Tells the browser to always provide scrollbars for the 
468      * frame window.</li>
469      * <li><tt>"no"</tt>: Tells the browser not to provide scrollbars for the frame 
470      * window.</li>
471      * </ul></p>
472      * @since 1.0
473      * @javascript Re-compilers must resolve the member of this static field to the
474      * identifier of the field name.
475      */
476     public static final Value.String.Member scrolling    = new Value.String.Member(Members.scrolling   );
477 
478     @Override
479     /**
480      * <p>Returns the primitive value associated with the current instance, if there is one.
481      * This invocation simply returns the instance itself for the current instance is an 
482      * object and there is no primitive value for it.</p>
483      * @return The current object itself.
484      * @since 1.0
485      * @javascript Re-compilers must convert the instance invocation of this method directly
486      * into a JavaScript invocation on its current object instance without changing the 
487      * method name, but expanding variable arguments, if any, into comma-separated values. 
488      */
489     public final JsHTMLFrameElement valueOf() {
490         return new JsHTMLFrameElement((JsObject)var().valueOf());
491     }
492 }