001package com.hfg.xml.msofficexml.docx.drawingml.theme;
002
003
004
005import com.hfg.xml.msofficexml.OfficeOpenXMLTag;
006import com.hfg.xml.msofficexml.docx.RelationshipXML;
007import com.hfg.xml.msofficexml.docx.drawingml.DmlXML;
008import com.hfg.xml.msofficexml.part.OfficeXMLPart;
009
010//------------------------------------------------------------------------------
011/**
012 Represents an Office Open XML drawingml theme (<a:theme>) tag.
013 <div>
014 @author J. Alex Taylor, hairyfatguy.com
015 </div>
016 */
017//------------------------------------------------------------------------------
018// com.hfg XML/HTML Coding Library
019//
020// This library is free software; you can redistribute it and/or
021// modify it under the terms of the GNU Lesser General Public
022// License as published by the Free Software Foundation; either
023// version 2.1 of the License, or (at your option) any later version.
024//
025// This library is distributed in the hope that it will be useful,
026// but WITHOUT ANY WARRANTY; without even the implied warranty of
027// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
028// Lesser General Public License for more details.
029//
030// You should have received a copy of the GNU Lesser General Public
031// License along with this library; if not, write to the Free Software
032// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
033//
034// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
035// jataylor@hairyfatguy.com
036//------------------------------------------------------------------------------
037
038public class DmlTheme extends OfficeOpenXMLTag
039{
040   private OfficeXMLPart mParentThemePart;
041   private DmlThemeElements mThemeElements;
042
043   //###########################################################################
044   // CONSTRUCTORS
045   //###########################################################################
046
047   //---------------------------------------------------------------------------
048   public DmlTheme(OfficeXMLPart inParentThemePart)
049   {
050      super(DmlXML.THEME, inParentThemePart.getParentDoc());
051
052      mParentThemePart = inParentThemePart;
053
054      addXMLNamespaceDeclaration(RelationshipXML.RELATIONSHIP_NAMESPACE);
055      addXMLNamespaceDeclaration(DmlXML.DRAWINGML_NAMESPACE);
056
057      mThemeElements = new DmlThemeElements(getParentDoc());
058      addSubtag(mThemeElements);
059   }
060
061   //###########################################################################
062   // PUBLIC METHODS
063   //###########################################################################
064
065   //---------------------------------------------------------------------------
066   public OfficeXMLPart getParentThemePart()
067   {
068      return mParentThemePart;
069   }
070
071   //---------------------------------------------------------------------------
072   /**
073    * Returns the theme elements tag.
074    * @return the theme elements tag for this theme tag
075    */
076   public DmlThemeElements getThemeElements()
077   {
078      return mThemeElements;
079   }
080
081   //---------------------------------------------------------------------------
082   public DmlTheme setName(String inValue)
083   {
084      setAttribute(DmlXML.NAME_ATT, inValue);
085      return this;
086   }
087}