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#HTMLBaseFontElement} class.</p>
028  * <p>This class represents a base font element 
029  * in an HTML page, or a {@link JsHTMLElement} object created with the HTML 
030  * <tt>&lt;basefont&gt;</tt> tag which is deprecated by HTML 4.01 and should be handled by 
031  * style sheets.</p> 
032  *
033  * @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>
034  *
035  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
036  * generated into the target codes. Re-compilers must exit with error on the operations of
037  * accessing that kind of class objects.
038  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
039  * and <tt>instanceof</tt> to it always <tt>true</tt>.
040  */
041 public class JsHTMLBaseFontElement extends JsClient.HTMLBaseFontElement.Prototype
042 {
043     /**
044      * <p>An <b>internal</b> class containing membership data for its enclosing
045      * opaque class.</p>
046      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
047      * class members.</p>
048      *
049      * @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>
050      * 
051      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
052      */
053     protected static abstract class Members extends JsClient.HTMLBaseFontElement.Prototype.Members
054     {
055         /**
056          * <p>An <b>internal</b> static field defining a member ID of the field name and
057          * used internally to define a member of the same name.</p>
058          * @since 1.0
059          * @see JsHTMLBaseFontElement#color
060          * @see JsHTMLBaseFontElement.Member#color
061          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
062          */
063         public final static Mid color = id("color");
064         /**
065          * <p>An <b>internal</b> static field defining a member ID of the field name and
066          * used internally to define a member of the same name.</p>
067          * @since 1.0
068          * @see JsHTMLBaseFontElement#face
069          * @see JsHTMLBaseFontElement.Member#face
070          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
071          */
072         public final static Mid face  = id("face" );
073         /**
074          * <p>An <b>internal</b> static field defining a member ID of the field name and
075          * used internally to define a member of the same name.</p>
076          * @since 1.0
077          * @see JsHTMLBaseFontElement#size
078          * @see JsHTMLBaseFontElement.Member#size
079          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
080          */
081         public final static Mid size  = id("size" );
082     }
083     /**
084      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
085      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
086      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
087      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
088      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
089      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
090      * either circumstance, the field names must be exactly same as the member names, as 
091      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
092      * based on the field names.</p>
093      *
094      * @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>
095      * 
096      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
097      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
098      * of class objects.
099      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
100      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
101      * <pre>q.m</pre>
102      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
103      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
104      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
105      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
106      * <pre>m</pre>
107      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
108      * error on the access to <b>opaque</b> fields declared by this class under any other 
109      * circumstances.
110      */
111     public static class Member extends JsClient.HTMLBaseFontElement.Prototype.Member
112     {
113         /**
114          * <p>Internally constructs a member based on a qualifying member.</p>
115          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
116          * or <b>internal</b> classes or class members.</p>
117          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
118          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
119          * declared in the declaring class of this constructor itself or its subclasses. 
120          * Under this circumstance, the field names must be exactly same as the member 
121          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
122          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
123          * to their names appending to the name resolved from the specified qualifying 
124          * member with a dot in between.</p>
125          * @param q A qualifying member
126          * @param mid The ID of the member to construct
127          * @since 1.0
128          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
129          */
130         public Member(JsObject.Member q, Mid mid) {
131             super(q, mid);
132         }
133         /**
134          * <p>Internally constructs a member without a qualifying member.</p>
135          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
136          * or <b>internal</b> classes or class members.</p>
137          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
138          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
139          * declared in <b>opaque</b> types other than the declaring class of this constructor 
140          * itself and its subclasses. Under this circumstance, the field names must be
141          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
142          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
143          * @param mid The ID of the member to construct
144          * @since 1.0
145          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
146          */
147         public Member(Mid mid) {
148             super(mid);
149         }
150         @Override
151         /**
152          * <p>Evaluates the property, represented by the current member instance, of the
153          * argument object.</p>
154          * @param o The argument object
155          * @return The value of the current member based on the object argument.
156          * @since 1.0
157          * @javascript Re-compilers must convert the instance invocation of this method into
158          * the JavaScript expression: 
159          * <pre>o.m</pre>
160          * where <tt>m</tt> is the identifier name resolved from the current member
161          * instance of the invocation.
162          */
163         public JsHTMLBaseFontElement with(ObjectLike o) {
164             return new JsHTMLBaseFontElement(super.with(o));
165         }
166 
167         /**
168          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
169          * name of this field, qualified by the current member instance of the field, and 
170          * to access the property of the name on an object.</p>
171          * <p>The property, identified by this member, of a {@link JsHTMLBaseFontElement} 
172          * object refers to a string specifying the font color.</p>
173          * <p>This attribute is deprecated by HTML 4.01 along with the <tt>&lt;basefont&gt;</tt> tag.</p> 
174          * @since 1.0
175          * @javascript Re-compilers must resolve the member of this instance field to the
176          * identifier of the field name appending to the identifier resolved from its 
177          * qualifying member with a dot in between.
178          */
179         public final Value.String.Member color = new Value.String.Member(this, Members.color);
180         /**
181          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
182          * name of this field, qualified by the current member instance of the field, and 
183          * to access the property of the name on an object.</p>
184          * <p>The property, identified by this member, of a {@link JsHTMLBaseFontElement} 
185          * object refers to a string specifying a comma-separated list of font identifiers 
186          * the web browser should search for in order of preference.</p>
187          * <p>This attribute is deprecated by HTML 4.01 along with the <tt>&lt;basefont&gt;</tt> tag.</p> 
188          * @since 1.0
189          * @javascript Re-compilers must resolve the member of this instance field to the
190          * identifier of the field name appending to the identifier resolved from its 
191          * qualifying member with a dot in between.
192          */
193         public final Value.String.Member face  = new Value.String.Member(this, Members.face );
194         /**
195          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
196          * name of this field, qualified by the current member instance of the field, and 
197          * to access the property of the name on an object.</p>
198          * <p>The property, identified by this member, of a {@link JsHTMLBaseFontElement} 
199          * object refers to a string specifying the font size.</p>
200          * <p>This attribute is deprecated by HTML 4.01 along with the <tt>&lt;basefont&gt;</tt> tag.</p> 
201          * @since 1.0
202          * @javascript Re-compilers must resolve the member of this instance field to the
203          * identifier of the field name appending to the identifier resolved from its 
204          * qualifying member with a dot in between.
205          */
206         public final Value.String.Member size  = new Value.String.Member(this, Members.size );
207     }
208 
209     /**
210      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
211      * with the wrapping constructor.</p>
212      * @param var The argument of an <b>opaque</b> object.
213      * @since 1.0
214      * @javascript Re-compilers must ignore the construction operation of this constructor,
215      * that is, replacing it with its only argument.
216      */
217     public JsHTMLBaseFontElement(JsObject var) {
218         super(var);
219     }
220 
221     /**
222      * <p>An <b>opaque</b> static field defining a member that is named by the field name
223      * without a qualifying member and to access the property of the name on an object.</p>
224      * <p>The property, identified by this member, of a {@link JsHTMLBaseFontElement} 
225      * object refers to a string specifying the font color.</p>
226      * <p>This attribute is deprecated by HTML 4.01 along with the <tt>&lt;basefont&gt;</tt> tag.</p> 
227      * @since 1.0
228      * @javascript Re-compilers must resolve the member of this static field to the
229      * identifier of the field name.
230      */
231     public static final Value.String.Member color = new Value.String.Member(Members.color);
232     /**
233      * <p>An <b>opaque</b> static field defining a member that is named by the field name
234      * without a qualifying member and to access the property of the name on an object.</p>
235      * <p>The property, identified by this member, of a {@link JsHTMLBaseFontElement} 
236      * object refers to a string specifying a comma-separated list of font identifiers 
237      * the web browser should search for in order of preference.</p>
238      * <p>This attribute is deprecated by HTML 4.01 along with the <tt>&lt;basefont&gt;</tt> tag.</p> 
239      * @since 1.0
240      * @javascript Re-compilers must resolve the member of this static field to the
241      * identifier of the field name.
242      */
243     public static final Value.String.Member face  = new Value.String.Member(Members.face );
244     /**
245      * <p>An <b>opaque</b> static field defining a member that is named by the field name
246      * without a qualifying member and to access the property of the name on an object.</p>
247      * <p>The property, identified by this member, of a {@link JsHTMLBaseFontElement} 
248      * object refers to a string specifying the font size.</p>
249      * <p>This attribute is deprecated by HTML 4.01 along with the <tt>&lt;basefont&gt;</tt> tag.</p> 
250      * @since 1.0
251      * @javascript Re-compilers must resolve the member of this static field to the
252      * identifier of the field name.
253      */
254     public static final Value.String.Member size  = new Value.String.Member(Members.size );
255 
256     @Override
257     /**
258      * <p>Returns the primitive value associated with the current instance, if there is one.
259      * This invocation simply returns the instance itself for the current instance is an 
260      * object and there is no primitive value for it.</p>
261      * @return The current object itself.
262      * @since 1.0
263      * @javascript Re-compilers must convert the instance invocation of this method directly
264      * into a JavaScript invocation on its current object instance without changing the 
265      * method name, but expanding variable arguments, if any, into comma-separated values. 
266      */
267     public final JsHTMLBaseFontElement valueOf() {
268         return new JsHTMLBaseFontElement((JsObject)var().valueOf());
269     }
270 }