Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

textarea.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                       textarea.h  -  Area object with text
00003                              -------------------
00004     begin                : Tue Jan 7 2003
00005     copyright            : (C) 2003 by Mattias Jansson
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, NeoWTK, textarea.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2002
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 #ifndef __NEOWTKTEXTAREA_H
00028 #define __NEOWTKTEXTAREA_H
00029 
00030 
00031 #include "base.h"
00032 #include "area.h"
00033 
00034 #include <neoengine/font.h>
00035 
00036 #ifdef HAVE_NEOCHUNKIO
00037 #  include <neochunkio/complex.h>
00038 #  include "chunktype.h"
00039 #endif
00040 
00041 
00048 namespace NeoWTK
00049 {
00050 
00051 
00057 class NEOWTK_API TextArea : public Area
00058 {
00059     protected:
00060 
00062         NeoEngine::FontPtr                            m_pkFont;
00063 
00065         Coord                                         m_kPadding;
00066 
00068         NeoEngine::Color                              m_kFontColor;
00069 
00070 
00071     public:
00072 
00074         std::string                                   m_strText;
00075 
00077         bool                                          m_bPassword;
00078 
00079 
00084                                                       TextArea( Object *pkParent, TextArea *pkObject = 0 );
00085 
00088         virtual                                      ~TextArea();
00089 
00094         virtual void                                  SetAttribute( const AttributeBase &rkAttribute );
00095 
00100         virtual void                                  SetText( const std::string &rstrText );
00101 
00105         virtual const std::string                    &GetText();
00106 
00111         virtual void                                  SetFont( NeoEngine::FontPtr pkFont );
00112 
00116         virtual NeoEngine::FontPtr                    GetFont();
00117 
00121         virtual void                                  SetFontColor( const NeoEngine::Color &rkColor );
00122 
00126         const NeoEngine::Color                       &GetFontColor();
00127 
00134         virtual bool                                  Render( NeoEngine::Frustum *pkFrustum = 0, bool bForce = false );
00135 
00140         virtual void                                  SetTextPadding( const Coord &rkPadding );
00141 
00146         virtual const Coord                          &GetTextPadding();
00147 
00154         virtual Object                               *Duplicate( Object *pkParent = 0, Object *pkObject = 0 );
00155 };
00156 
00157 
00158 #ifdef HAVE_NEOCHUNKIO
00159 
00160 
00166 class NEOWTK_API TextAreaChunk : public AreaChunk
00167 {
00168     public:
00169 
00176                                                       TextAreaChunk( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID = "" ) : AreaChunk( usType, rstrType, rstrID ) {}
00177 
00181         virtual                                      ~TextAreaChunk() {}
00182 
00189         virtual int                                   ParseData( unsigned int uiFlags, NeoEngine::FileManager *pkFileManager );
00190 
00198         static NeoChunkIO::Chunk                     *Allocator( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID ) { return new TextAreaChunk( usType, rstrType, rstrID ); }
00199 };
00200 
00201 
00202 #endif 
00205 }; 
00208 #endif

Generated on Wed Jan 21 14:21:20 2004 for NeoWTK by doxygen 1.3.5