<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="XMLSchema"
    targetNamespace="http://dzonny.cz/google/HPgadget"
    elementFormDefault="qualified"
    xmlns="http://dzonny.cz/google/HPgadget"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Module">
        <xs:annotation>
            <xs:documentation>Google homepage module&#xD;&#xA;See http://www.google.com/apis/gadgets/reference.html for more.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="ModulePrefs" minOccurs="0" maxOccurs="1">
                    <xs:annotation>
                        <xs:documentation>
                            The &lt;ModulePrefs> section in the XML file specifies characteristics of the gadget, such as title, author, preferred sizing, and so on.</xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                            <xs:element name="Require">
                                <xs:annotation>
                                    <xs:documentation>To use certain gadget API features, such as dynamic height or storing state, you need to load the appropriate JavaScript library using the &lt;Require> tag (inside &lt;ModulePrefs>). The &lt;Require> tag has one required attribute, feature, whose value specifies the feature library.</xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:attribute name="feature" use="required">
                                        <xs:annotation>
                                            <xs:documentation>specified feature library.</xs:documentation>
                                        </xs:annotation>
                                        <xs:simpleType>
                                            <xs:restriction base="xs:string">
                                                <xs:enumeration value="setprefs">
                                                    <xs:annotation>
                                                        <xs:documentation>The setprefs library includes the following function: set(userpref, value) </xs:documentation>
                                                    </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration value="dynamic-height">
                                                    <xs:annotation>
                                                        <xs:documentation>The dynamic-height library includes one function, which tells the gadget to resize itself: _IG_AdjustIFrameHeight()</xs:documentation>
                                                    </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration value="settitle">
                                                    <xs:annotation>
                                                        <xs:documentation>For a detailed discussion of using the settitle library and examples, see Setting a Gadget's Title (http://www.google.com/apis/gadgets/ui.html#Settitle).</xs:documentation>
                                                    </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration value="tabs">
                                                    <xs:annotation>
                                                        <xs:documentation>For a detailed discussion of using the tabs library and examples, see Tabs (http://www.google.com/apis/gadgets/ui.html#Tabs).</xs:documentation>
                                                    </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration value="drag">
                                                    <xs:annotation>
                                                        <xs:documentation>For a detailed discussion of using the drag library and examples, see Drag (http://www.google.com/apis/gadgets/ui.html#Drag).</xs:documentation>
                                                    </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration value="grid">
                                                    <xs:annotation>
                                                        <xs:documentation>For a detailed discussion of using the grid library and examples, see Grid (http://www.google.com/apis/gadgets/ui.html#Grid).</xs:documentation>
                                                    </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration value="minimessage">
                                                    <xs:annotation>
                                                        <xs:documentation>For a detailed discussion of using the MiniMessage library and examples, see MiniMessages (http://www.google.com/apis/gadgets/ui.html#Mini).</xs:documentation>
                                                    </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration value="analytics">
                                                    <xs:annotation>
                                                        <xs:documentation>You can use Google Analytics to collect statistics about your gadgets. Typically, you use analytics to track pageviews (that is, every time a gadget renders) or events (for example, every time a user clicks a button in your gadget).</xs:documentation>
                                                    </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration value="flash">
                                                    <xs:annotation>
                                                        <xs:documentation>For a detailed discussion of using the flash library and examples, see Flash (http://www.google.com/apis/gadgets/ui.html#Flash).</xs:documentation>
                                                    </xs:annotation>
                                                </xs:enumeration>
                                            </xs:restriction>
                                        </xs:simpleType>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="title" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Optional string that provides the title of the gadget. This title is displayed in the gadget title bar on iGoogle. If this string contains user preference substitution variables and you are planning to submit your gadget to the content directory, you should also provide a directory_title for directory display.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="directory_title" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>  	Optional string that provides the title that should be displayed for your gadget in the content directory. Should contain only the literal text to be displayed, not user preference substitution variables. This is because the content directory displays a static view of your gadget, and therefore can't perform the necessary substitution to produce a reasonable title. For example, if your gadget's title is "Friends for __UP_name__", the directory is not able to perform the substitution to provide a reasonable value for " __UP_name__". So you might set your directory_title to be simply "Friends".</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="title_url" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Optional string that provides a URL that the gadget title links to. For example, you could link the title to a webpage related to the gadget.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="description" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Optional string that describes the gadget.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="author" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Optional string that lists the author of the gadget.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="author_email" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>
                                    Optional string that provides the gadget author's email address. You can use any email system, but you should not use a personal email address because of spam. One approach is to use an email address of the form helensmith.feedback+coolgadget@gmail.com in your gadget spec.&#xD;&#xA;
                                    Gmail drops everything after the plus sign (+), so this email address is interpreted as helensmith.feedback@gmail.com.&#xD;&#xA;
                                    You can create a Gmail account at http://mail.google.com/mail/signup.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="author_affiliation" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Optional string such as "Google" that indicates the author's affiliation. This attribute is required for gadgets that are included in the content directory.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="author_location" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>The author's geographical location, such as "Mountain View , CA, USA ".</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="screenshot" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Optional string that gives the URL of a gadget screenshot. This must be an image on a public web site that is not blocked by robots.txt. PNG is the preferred format, though GIF and JPG are also acceptable. Gadget screenshots should be 280 pixels wide. The height of the screenshot should be the "natural" height of the gadget when it's in use. For more discussion of screenshot guidelines, see Publishing to the Content Directory (http://www.google.com/apis/gadgets/publish.html#Submitting).</xs:documentation>
                            </xs:annotation>    
                        </xs:attribute>
                        <xs:attribute name="thumbnail" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Optional string that gives the URL of a gadget thumbnail. This must be an image on a public web site that is not blocked by robots.txt. PNG is the preferred format, though GIF and JPG are also acceptable. Gadget thumbnails should be 120x60 pixels. For more discussion of thumbnail guidelines, see Publishing to the Content Directory (http://www.google.com/apis/gadgets/publish.html#Submitting).</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="height" use="optional" type="xs:positiveInteger" default="200">
                            <xs:annotation>
                                <xs:documentation>Optional positive integer that specifies the height of the area in which the gadget runs. The default height is 200.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="width" use="optional"  type="xs:positiveInteger" default="320">
                            <xs:annotation>
                                <xs:documentation>Optional positive integer that specifies the width of the area in which the gadget runs. This setting only applies to syndicated gadgets. The default width is 320.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="scaling" use="optional" type="xs:boolean" default="true">
                            <xs:annotation>
                                <xs:documentation>Optional boolean that specifies whether the aspect ratio (height-to-width ratio) of the gadget is maintained when the browser is resized. Gadgets that can automatically scale vertically should set this to true, but gadgets which have a fixed height should set this to false. The default is true.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="scrolling" use="optional" type="xs:boolean" default="false">
                            <xs:annotation>
                                <xs:documentation>Optional boolean that provides vertical and/or horizontal scrollbars if the content exceeds the space provided. If false, then the content is clipped to the height and width provided (not that width is not configurable). The default is false.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="singleton" use="optional" type="xs:boolean" default="true">
                            <xs:annotation>
                                <xs:documentation>
                                    Optional boolean that specifies whether users can add a gadget multiple times from a directory. The default is true, meaning that by default, gadgets can only be added once. Directories can handle this attribute however they choose. For example, the content directory handles singleton="true" by graying out and displaying the text "Added" for gadgets that have already been added. Note that changes to this attribute may not be picked up by directories right away.&#xD;&#xA;
                                    This attribute doesn't prevent users from adding gadgets multiple times through the developer gadget or Add by URL. Consequently, you still need to write your gadget to support multiple instances.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="author_photo" type="xs:string" use="optional">
                            <xs:annotation>
                                <xs:documentation>	For the authors page, a URL to a photo (70x100 PNG format preferred, but JPG/GIF are also supported).</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="author_aboutme" type="xs:string" use="optional">
                            <xs:annotation>
                                <xs:documentation>For the authors page, a statement about yourself (try to keep to ~500 characters).</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="author_link" type="xs:string" use="optional">
                            <xs:annotation>
                                <xs:documentation>For the authors page, a link to your website, blog, etc.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="author_quote" type="xs:string" use="optional">
                            <xs:annotation>
                                <xs:documentation>For the authors page, a quote you'd like to include (try to keep to ~300 characters).</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="render_inline" use="optional"  default="optional">
                            <xs:annotation>
                                <xs:documentation>Inline behavior of gadget. This property is no longer listed in oficial list at http://www.google.com/apis/gadgets/reference.html#Moduleprefs_Ref</xs:documentation>
                            </xs:annotation>
                            <xs:simpleType>
                                <xs:restriction base="xs:string">
                                    <xs:enumeration value="optional">
                                        <xs:annotation>
                                            <xs:documentation>Default. Module is rendered inline (without iframe) only if it is trusted by Google.</xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                    <xs:enumeration value="required">
                                        <xs:annotation>
                                            <xs:documentation>Module is always rendered inline (directly into page, no ifranme). If it is not trusted by Google warning is displayed instead of module itself - user can change this behavior by using My Gadgets module (http://www.google.com/ig/modules/developer.xml)</xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
                <xs:element name="UserPref" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence minOccurs="0" maxOccurs="1">
                            <xs:element name="EnumValue" minOccurs="1" maxOccurs="unbounded">
                                <xs:annotation>
                                    <xs:documentation><![CDATA[You specify the contents of the menu using <EnumValue>.]]></xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:attribute name="value" type="xs:string" use="required">
                                        <xs:annotation>
                                            <xs:documentation>Required string that provides a unique value. This value is displayed in the menu in the user preferences edit box unless a display_value is provided.</xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="display_value" type="xs:string" use="optional">
                                        <xs:annotation>
                                            <xs:documentation>Optional string that is displayed in the menu in the user preferences edit box. If you do not specify a display_value, the value is displayed in the user interface.</xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="name" use="required">
                            <xs:annotation>
                                <xs:documentation>Required "symbolic" name of the user preference; displayed to the user during editing if no display_name is defined. Must contain only letters, number and underscores, i.e. the regular expression ^[a-zA-Z0-9_]+$. Must be unique.</xs:documentation>
                            </xs:annotation>
                            <xs:simpleType>
                                <xs:restriction base="xs:string">
                                    <xs:pattern value="^[a-zA-Z0-9_]+$"/>
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="display_name" use="optional"  type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Optional string to display alongside the user preferences in the edit window. Must be unique.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="urlparam" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Optional string to pass as the parameter name for content type="url".</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="datatype" use="optional" default="string">
                            <xs:annotation>
                                <xs:documentation>Optional string that indicates the data type of this attribute.</xs:documentation>
                            </xs:annotation>
                            <xs:simpleType>
                                <xs:restriction base="xs:string">
                                    <xs:enumeration value="string"/>
                                    <xs:enumeration value="bool"/>
                                    <xs:enumeration value="enum">
                                        <xs:annotation>
                                            <xs:documentation><![CDATA[One of the values you can specify for the <UserPref> datatype attribute is enum. The enum data type is presented in the user interface as a menu of choices. You specify the contents of the menu using <EnumValue>.]]></xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                    <xs:enumeration value="hidden">
                                        <xs:annotation>
                                            <xs:documentation>a string that is not visible or user editable</xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                    <xs:enumeration value="list">
                                        <xs:annotation>
                                            <xs:documentation>
                                                A user preference with the list data type is an array of values that are dynamically supplied by users at run time. As users type values into the user preferences edit box, these values are added to the list. The list can be programmatically accessed by the gadget at run-time, just like any other userpref. You can use the list data type any time you want to allow users to dynamically supply an arbitrary list of values. For example, a weather gadget might allow users to enter a list of postal codes.&#xD;&#xA;
                                                See http://www.google.com/apis/gadgets/fundamentals.html#list for more.
                                            </xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                    <xs:enumeration value="location">
                                        <xs:annotation>
                                            <xs:documentation>
                                                Gadgets based on Google Maps can use the location data type. The following example gadget illustrates how to use the location data type. For gadgets, the value supplied for a location data type must be a major city or postal code in the United States, Canada, or the United Kingdom. You might find that using postal codes yields a better result.&#xD;&#xA;
                                                See http://www.google.com/apis/gadgets/fundamentals.html#location fro more.
                                            </xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="required" use="optional" type="xs:boolean" default="false">
                            <xs:annotation>
                                <xs:documentation>	Optional boolean argument (true or false) indicating whether this user preference is required. The default is false.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="default_value" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation>Optional string that indicates a user preference's default value.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
                <xs:element name="Content" minOccurs="1" maxOccurs="1">
                    <xs:annotation>
                        <xs:documentation><![CDATA[The <Content> section defines the type of content, and either holds the content itself or has a reference to external content. The <Content> section is where the gadget attributes and user preferences are combined with programming logic and formatting information to become a running gadget. For more discussion on content types, see Choosing a Content Type (http://www.google.com/apis/gadgets/fundamentals.html#Content_Type).]]></xs:documentation>
                    </xs:annotation>
                    <xs:complexType mixed="true">
                        <xs:attribute name="type" use="optional" default="html">
                            <xs:annotation>
                                <xs:documentation>Optional string that gives the type of the content. The default is html.</xs:documentation>
                            </xs:annotation>
                            <xs:simpleType>
                                <xs:restriction base="xs:string">
                                    <xs:enumeration value="html">
                                        <xs:annotation>
                                            <xs:documentation>With an html content type, all of the content typically resides in the gadget spec. A type="html" gadget contains HTML, possibly with embedded JavaScript, Flash, ActiveX, or other browser objects. This is the default type.</xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                    <xs:enumeration value="html-inline">
                                        <xs:annotation>
                                            <xs:documentation>With an  html-inline content type, the gadget HTML is rendered as part of the parent page rather than in an iframe. This gives your gadget the ability to modify the parent page, for example, to change the font color.</xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                    <xs:enumeration value="url">
                                        <xs:annotation>
                                            <xs:documentation>With a url content type, the gadget content lives on a remote web page referenced by a URL in the gadget spec. The remote web page is where all of the HTML markup and JavaScript resides. You can NOT put any HTML markup or JavaScript code in the gadget spec itself.</xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="href" type="xs:string" use="optional">
                            <xs:annotation>
                                <xs:documentation>String that provides a destination URL. Required for type="url", and not allowed for other content types.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="cdata" type="xs:string" use="optional">
                            <xs:annotation>
                                <xs:documentation>Optional string. For HTML, contains the raw HTML to render in the iframe.</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
        <xs:unique name="unqUserPrefName">
            <xs:selector xpath="./UserPreef"/>
            <xs:field xpath="@name"/>
        </xs:unique>
        <xs:unique name="unqUserPrefDispName">
            <xs:selector xpath="./UserPreef"/>
            <xs:field xpath="@display_name"/>
        </xs:unique>
    </xs:element>
</xs:schema>

