[692] | 1 | /************************************************************************
|
---|
| 2 | filename: CEGUIImageset_xmlHandler.h
|
---|
| 3 | created: 21/2/2004
|
---|
| 4 | author: Paul D Turner
|
---|
| 5 |
|
---|
| 6 | purpose: Defines the interface for the Imageset class
|
---|
| 7 | *************************************************************************/
|
---|
| 8 | /*************************************************************************
|
---|
| 9 | Crazy Eddie's GUI System (http://www.cegui.org.uk)
|
---|
| 10 | Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
|
---|
| 11 |
|
---|
| 12 | This library is free software; you can redistribute it and/or
|
---|
| 13 | modify it under the terms of the GNU Lesser General Public
|
---|
| 14 | License as published by the Free Software Foundation; either
|
---|
| 15 | version 2.1 of the License, or (at your option) any later version.
|
---|
| 16 |
|
---|
| 17 | This library is distributed in the hope that it will be useful,
|
---|
| 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 20 | Lesser General Public License for more details.
|
---|
| 21 |
|
---|
| 22 | You should have received a copy of the GNU Lesser General Public
|
---|
| 23 | License along with this library; if not, write to the Free Software
|
---|
| 24 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 25 | *************************************************************************/
|
---|
| 26 | #ifndef _CEGUIImageset_xmlHandler_h_
|
---|
| 27 | #define _CEGUIImageset_xmlHandler_h_
|
---|
| 28 |
|
---|
| 29 | #include "CEGUIImageset.h"
|
---|
| 30 | #include "CEGUIXMLHandler.h"
|
---|
| 31 |
|
---|
| 32 | // Start of CEGUI namespace section
|
---|
| 33 | namespace CEGUI
|
---|
| 34 | {
|
---|
| 35 |
|
---|
| 36 | /*************************************************************************
|
---|
| 37 | Implementation Classes
|
---|
| 38 | *************************************************************************/
|
---|
| 39 | /*!
|
---|
| 40 | \brief
|
---|
| 41 | Handler class used to parse the Imageset XML files using SAX2
|
---|
| 42 | */
|
---|
| 43 | class Imageset_xmlHandler : public XMLHandler
|
---|
| 44 | {
|
---|
| 45 | public:
|
---|
| 46 | /*************************************************************************
|
---|
| 47 | Construction & Destruction
|
---|
| 48 | *************************************************************************/
|
---|
| 49 | /*!
|
---|
| 50 | \brief
|
---|
| 51 | Constructor for Imageset::xmlHandler objects
|
---|
| 52 |
|
---|
| 53 | \param imageset
|
---|
| 54 | Pointer to the Imageset object creating this xmlHandler object
|
---|
| 55 | */
|
---|
| 56 | Imageset_xmlHandler(Imageset* imageset) : d_imageset(imageset) {}
|
---|
| 57 |
|
---|
| 58 | /*!
|
---|
| 59 | \brief
|
---|
| 60 | Destructor for Imageset::xmlHandler objects
|
---|
| 61 | */
|
---|
| 62 | virtual ~Imageset_xmlHandler(void) {}
|
---|
| 63 |
|
---|
| 64 | /*************************************************************************
|
---|
| 65 | SAX2 Handler overrides
|
---|
| 66 | *************************************************************************/
|
---|
| 67 | /*!
|
---|
| 68 | \brief
|
---|
| 69 | document processing (only care about elements, schema validates format)
|
---|
| 70 | */
|
---|
| 71 | virtual void elementStart(const String& element, const XMLAttributes& attributes);
|
---|
| 72 | virtual void elementEnd(const String& element);
|
---|
| 73 |
|
---|
| 74 | /*************************************************************************
|
---|
| 75 | Functions used by our implementation
|
---|
| 76 | *************************************************************************/
|
---|
| 77 | Imageset* getImageset(void) const {return d_imageset;}
|
---|
| 78 |
|
---|
| 79 | private:
|
---|
| 80 | /*************************************************************************
|
---|
| 81 | Implementation Constants
|
---|
| 82 | *************************************************************************/
|
---|
| 83 | static const String ImagesetElement; //!< Tag name for Imageset elements.
|
---|
| 84 | static const String ImageElement; //!< Tag name for Image elements.
|
---|
| 85 | static const char ImagesetNameAttribute[]; //!< Attribute name that stores the name of the Imageset
|
---|
| 86 | static const char ImagesetImageFileAttribute[]; //!< Attribute name that stores the filename for the image file.
|
---|
| 87 | static const char ImagesetResourceGroupAttribute[]; //!< Attribute name that stores the resource group identifier used when loading image file.
|
---|
| 88 | static const char ImagesetNativeHorzResAttribute[]; //!< Optional attribute that stores 'native' horizontal resolution for the Imageset.
|
---|
| 89 | static const char ImagesetNativeVertResAttribute[]; //!< Optional attribute that stores 'native' vertical resolution for the Imageset.
|
---|
| 90 | static const char ImagesetAutoScaledAttribute[]; //!< Optional attribute that specifies whether the Imageset should be auto-scaled.
|
---|
| 91 | static const char ImageNameAttribute[]; //!< Attribute name that stores the name of the new Image.
|
---|
| 92 | static const char ImageXPosAttribute[]; //!< Attribute name that stores the x position of the new Image.
|
---|
| 93 | static const char ImageYPosAttribute[]; //!< Attribute name that stores the y position of the new Image.
|
---|
| 94 | static const char ImageWidthAttribute[]; //!< Attribute name that stores the width of the new Image.
|
---|
| 95 | static const char ImageHeightAttribute[]; //!< Attribute name that stores the height of the new Image.
|
---|
| 96 | static const char ImageXOffsetAttribute[]; //!< Attribute name that stores the x rendering offset of the new Image.
|
---|
| 97 | static const char ImageYOffsetAttribute[]; //!< Attribute name that stores the y rendering offset of the new Image.
|
---|
| 98 |
|
---|
| 99 | /*************************************************************************
|
---|
| 100 | Implementation Data
|
---|
| 101 | *************************************************************************/
|
---|
| 102 | Imageset* d_imageset; //!< Holds a pointer to the Imageset that created the handler object
|
---|
| 103 | };
|
---|
| 104 |
|
---|
| 105 | } // End of CEGUI namespace section
|
---|
| 106 |
|
---|
| 107 | #endif // end of guard _CEGUIImageset_xmlHandler_h_
|
---|