source: OGRE/trunk/ogre_dependencies/Dependencies/include/CEGUI/falagard/CEGUIFalImageryComponent.h @ 692

Revision 692, 5.9 KB checked in by mattausch, 19 years ago (diff)

adding ogre 1.2 and dependencies

Line 
1/************************************************************************
2    filename:   CEGUIFalImageryComponent.h
3    created:    Mon Jun 13 2005
4    author:     Paul D Turner <paul@cegui.org.uk>
5*************************************************************************/
6/*************************************************************************
7    Crazy Eddie's GUI System (http://www.cegui.org.uk)
8    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
9 
10    This library is free software; you can redistribute it and/or
11    modify it under the terms of the GNU Lesser General Public
12    License as published by the Free Software Foundation; either
13    version 2.1 of the License, or (at your option) any later version.
14 
15    This library is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    Lesser General Public License for more details.
19 
20    You should have received a copy of the GNU Lesser General Public
21    License along with this library; if not, write to the Free Software
22    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23*************************************************************************/
24#ifndef _CEGUIFalImageryComponent_h_
25#define _CEGUIFalImageryComponent_h_
26
27#include "falagard/CEGUIFalComponentBase.h"
28
29// Start of CEGUI namespace section
30namespace CEGUI
31{
32    /*!
33    \brief
34        Class that encapsulates information for a single image component.
35    */
36    class CEGUIEXPORT ImageryComponent : public FalagardComponentBase
37    {
38    public:
39        /*!
40        \brief
41            Constructor
42        */
43        ImageryComponent();
44
45        /*!
46        \brief
47            Return the Image object that will be drawn by this ImageryComponent.
48
49        \return
50            Image object.
51        */
52        const Image* getImage() const;
53
54        /*!
55        \brief
56            Set the Image that will be drawn by this ImageryComponent.
57
58        \param
59            Pointer to the Image object to be drawn by this ImageryComponent.
60
61        \return
62            Nothing.
63        */
64        void setImage(const Image* image);
65
66        /*!
67        \brief
68            Set the Image that will be drawn by this ImageryComponent.
69
70        \param imageset
71            String holding the name of the Imagset that contains the Image to be rendered.
72
73        \param image
74            String holding the name of the Image to be rendered.
75
76        \return
77            Nothing.
78        */
79        void setImage(const String& imageset, const String& image);
80
81        /*!
82        \brief
83            Return the current vertical formatting setting for this ImageryComponent.
84
85        \return
86            One of the VerticalFormatting enumerated values.
87        */
88        VerticalFormatting getVerticalFormatting() const;
89
90        /*!
91        \brief
92            Set the vertical formatting setting for this ImageryComponent.
93
94        \param fmt
95            One of the VerticalFormatting enumerated values.
96
97        \return
98            Nothing.
99        */
100        void setVerticalFormatting(VerticalFormatting fmt);
101
102        /*!
103        \brief
104            Return the current horizontal formatting setting for this ImageryComponent.
105
106        \return
107            One of the HorizontalFormatting enumerated values.
108        */
109        HorizontalFormatting getHorizontalFormatting() const;
110
111        /*!
112        \brief
113            Set the horizontal formatting setting for this ImageryComponent.
114
115        \param fmt
116            One of the HorizontalFormatting enumerated values.
117
118        \return
119            Nothing.
120        */
121        void setHorizontalFormatting(HorizontalFormatting fmt);
122
123        /*!
124        \brief
125            Writes an xml representation of this ImageryComponent to \a out_stream.
126
127        \param out_stream
128            Stream where xml data should be output.
129
130        \return
131            Nothing.
132        */
133        void writeXMLToStream(OutStream& out_stream) const;
134
135        /*!
136        \brief
137            Return whether this ImageryComponent fetches it's image via a property on the target window.
138
139        \return
140            - true if the image comes via a Propery.
141            - false if the image is defined explicitly.
142        */
143        bool isImageFetchedFromProperty() const;
144
145        /*!
146        \brief
147            Return the name of the property that will be used to determine the image for this ImageryComponent.
148
149        \return
150            String object holding the name of a Propery.
151        */
152        const String& getImagePropertySource() const;
153
154        /*!
155        \brief
156            Set the name of the property that will be used to determine the image for this ImageryComponent.
157
158        \param property
159            String object holding the name of a Propery.  The property should access a imageset & image specification.
160
161        \return
162            Nothing.
163        */
164        void setImagePropertySource(const String& property);
165
166    protected:
167        // implemets abstract from base
168        void render_impl(Window& srcWindow, Rect& destRect, float base_z, const CEGUI::ColourRect* modColours, const Rect* clipper, bool clipToDisplay) const;
169
170        const Image*         d_image;           //!< CEGUI::Image to be drawn by this image component.
171        VerticalFormatting   d_vertFormatting;  //!< Vertical formatting to be applied when rendering the image component.
172        HorizontalFormatting d_horzFormatting;  //!< Horizontal formatting to be applied when rendering the image component.
173        String  d_imagePropertyName;            //!< Name of the property to access to obtain the image to be used.
174    };
175
176} // End of  CEGUI namespace section
177
178
179#endif  // end of guard _CEGUIFalImageryComponent_h_
Note: See TracBrowser for help on using the repository browser.