<?xml version="1.0" encoding="utf-8"?>
<!--

    BleachBit
    Copyright (C) 2009 Andrew Ziem
    http://bleachbit.sourceforge.net

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:element name="cleaner">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="label">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="translate" type="xs:boolean" default="false"/>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
        <xs:element name="running" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="type" use="required">
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="exe"/>
                      <xs:enumeration value="pathname"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="option" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="label">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="translate" type="xs:boolean" default="false"/>
                      <xs:attribute name="translators" type="xs:string"/>
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="description">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="translators" type="xs:string"/>
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="warning" type="xs:string" minOccurs="0" maxOccurs="1"/>
              <xs:element name="action" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="address" type="xs:string"/>
                      <xs:attribute name="cache" type="xs:string"/>
                      <xs:attribute name="command" use="required">
                        <xs:simpleType>
                          <xs:restriction base="xs:string">
                            <xs:enumeration value="apt.autoclean"/>
                            <xs:enumeration value="apt.autoremove"/>
                            <xs:enumeration value="chrome.autofill"/>
                            <xs:enumeration value="chrome.databases_db"/>
                            <xs:enumeration value="chrome.favicons"/>
                            <xs:enumeration value="chrome.history"/>
                            <xs:enumeration value="chrome.keywords"/>
                            <xs:enumeration value="delete"/>
                            <xs:enumeration value="ini"/>
                            <xs:enumeration value="json"/>
                            <xs:enumeration value="mozilla_url_history"/>
                            <xs:enumeration value="office_registrymodifications"/>
                            <xs:enumeration value="sqlite.vacuum"/>
                            <xs:enumeration value="truncate"/>
                            <xs:enumeration value="winreg"/>
                            <xs:enumeration value="yum.clean_all"/>
                          </xs:restriction>
                        </xs:simpleType>
                      </xs:attribute>
                      <xs:attribute name="name" type="xs:string"/>
                      <xs:attribute name="parameter" type="xs:string"/>
                      <xs:attribute name="path" type="xs:string"/>
                      <xs:attribute name="regex" type="xs:string"/>
                      <xs:attribute name="search">
                        <xs:simpleType>
                          <xs:restriction base="xs:string">
                            <xs:enumeration value="deep"/>
                            <xs:enumeration value="file"/>
                            <xs:enumeration value="glob"/>
                            <xs:enumeration value="walk.all"/>
                            <xs:enumeration value="walk.files"/>
                          </xs:restriction>
                        </xs:simpleType>
                      </xs:attribute>
                      <xs:attribute name="section" type="xs:string"/>
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="id" type="xs:string" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="id" type="xs:string" use="required"/>
      <xs:attribute name="os" use="optional">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="linux"/>
            <xs:enumeration value="windows"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>
