001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.dto.html5;
014
015import java.net.*;
016import java.net.URI;
017
018import org.apache.juneau.*;
019import org.apache.juneau.annotation.*;
020
021/**
022 * DTO for an HTML {@doc ExtHTML5.embedded-content-0#the-iframe-element <iframe>}
023 * element.
024 *
025 * <ul class='seealso'>
026 *    <li class='link'>{@doc DtoHtml5}
027 * </ul>
028 */
029@Bean(typeName="iframe")
030public class Iframe extends HtmlElementMixed {
031
032   /**
033    * Creates an empty {@link Iframe} element.
034    */
035   public Iframe() {}
036
037   /**
038    * Creates an {@link Iframe} element with the specified child nodes.
039    *
040    * @param children The child nodes.
041    */
042   public Iframe(Object...children) {
043      children(children);
044   }
045
046   /**
047    * {@doc ExtHTML5.embedded-content-0#attr-dim-height height}
048    * attribute.
049    *
050    * <p>
051    * Vertical dimension.
052    *
053    * @param height
054    *    The new value for this attribute.
055    *    Typically a {@link Number} or {@link String}.
056    * @return This object (for method chaining).
057    */
058   public final Iframe height(Object height) {
059      attr("height", height);
060      return this;
061   }
062
063   /**
064    * {@doc ExtHTML5.embedded-content-0#attr-iframe-name name} attribute.
065    *
066    * <p>
067    * Name of nested browsing context.
068    *
069    * @param name The new value for this attribute.
070    * @return This object (for method chaining).
071    */
072   public final Iframe name(String name) {
073      attr("name", name);
074      return this;
075   }
076
077   /**
078    * {@doc ExtHTML5.embedded-content-0#attr-iframe-sandbox sandbox}
079    * attribute.
080    *
081    * <p>
082    * Security rules for nested content.
083    *
084    * @param sandbox The new value for this attribute.
085    * @return This object (for method chaining).
086    */
087   public final Iframe sandbox(String sandbox) {
088      attr("sandbox", sandbox);
089      return this;
090   }
091
092   /**
093    * {@doc ExtHTML5.embedded-content-0#attr-iframe-src src} attribute.
094    *
095    * <p>
096    * Address of the resource.
097    *
098    * <p>
099    * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
100    * Strings must be valid URIs.
101    *
102    * <p>
103    * URIs defined by {@link UriResolver} can be used for values.
104    *
105    * @param src
106    *    The new value for this attribute.
107    *    Typically a {@link URL} or {@link String}.
108    * @return This object (for method chaining).
109    */
110   public final Iframe src(Object src) {
111      attrUri("src", src);
112      return this;
113   }
114
115   /**
116    * {@doc ExtHTML5.embedded-content-0#attr-iframe-srcdoc srcdoc}
117    * attribute.
118    *
119    * <p>
120    * A document to render in the iframe.
121    *
122    * @param srcdoc The new value for this attribute.
123    * @return This object (for method chaining).
124    */
125   public final Iframe srcdoc(String srcdoc) {
126      attr("srcdoc", srcdoc);
127      return this;
128   }
129
130   /**
131    * {@doc ExtHTML5.embedded-content-0#attr-dim-width width} attribute.
132    *
133    * <p>
134    * Horizontal dimension.
135    *
136    * @param width
137    *    The new value for this attribute.
138    *    Typically a {@link Number} or {@link String}.
139    * @return This object (for method chaining).
140    */
141   public final Iframe width(Object width) {
142      attr("width", width);
143      return this;
144   }
145
146
147   //-----------------------------------------------------------------------------------------------------------------
148   // Overridden methods
149   //-----------------------------------------------------------------------------------------------------------------
150
151   @Override /* HtmlElement */
152   public final Iframe _class(String _class) {
153      super._class(_class);
154      return this;
155   }
156
157   @Override /* HtmlElement */
158   public final Iframe id(String id) {
159      super.id(id);
160      return this;
161   }
162
163   @Override /* HtmlElement */
164   public final Iframe style(String style) {
165      super.style(style);
166      return this;
167   }
168
169   @Override /* HtmlElementMixed */
170   public Iframe children(Object...children) {
171      super.children(children);
172      return this;
173   }
174
175   @Override /* HtmlElementMixed */
176   public Iframe child(Object child) {
177      super.child(child);
178      return this;
179   }
180}