#ifndef _h_Text_
#define _h_Text_
#include "FMWrapper/FMXClient.h"
extern "C++"
{
namespace fmx
{
class CharacterStyle;
class Text
{
public:
enum Encoding
{
kEncoding_Native, kEncoding_UTF8,
kEncoding_ASCII_DOS, kEncoding_ASCII_Windows, kEncoding_ASCII_Mac, kEncoding_ISO_8859_1, kEncoding_ShiftJIS_Mac, kEncoding_ShiftJIS_Win, kEncoding_Korean_Mac, kEncoding_Korean_Win, kEncoding_Korean_Johab, kEncoding_ChineseTrad_Mac, kEncoding_ChineseTrad_Win, kEncoding_ChineseSimp_Mac, kEncoding_ChineseSimp_Win, kEncoding_Cyrillic_Mac, kEncoding_Cyrillic_Win, kEncoding_ISO_8859_5, kEncoding_CentralEurope_Mac, kEncoding_EasternEurope_Win, kEncoding_ISO_8859_2, kEncoding_Turkish_Mac, kEncoding_Turkish_Win, kEncoding_ISO_8859_3, kEncoding_ISO_8859_9, kEncoding_Baltic_Win, kEncoding_ISO_8859_4, kEncoding_Arabic_Mac, kEncoding_Arabic_Win, kEncoding_ISO_8859_6, kEncoding_Greek_Mac, kEncoding_Greek_Win, kEncoding_ISO_8859_7, kEncoding_Hebrew_Mac, kEncoding_Hebrew_Win, kEncoding_ISO_8859_8, kEncoding_ISO_8859_15 };
enum
{
kSize_Invalid = 0xFFFFFFFF,
kSize_End = 0xFFFFFFFF
};
inline uint32 GetSize () const;
inline void Assign ( const char *s, Encoding encoding = kEncoding_Native );
inline void AssignWide ( const wchar_t *s );
inline void AssignUnicode ( const uint16 *s );
inline void AssignWithLength ( const char *s, uint32 strlength, Encoding encoding = kEncoding_Native );
inline void AssignWideWithLength ( const wchar_t *s, uint32 strlength );
inline void AssignUnicodeWithLength ( const uint16 *s, uint32 strlength );
inline void GetBytes ( char *charbuffer, uint32 buffersize, uint32 position = 0, uint32 size = kSize_End, Encoding encoding = kEncoding_Native ) const;
inline void GetUnicode ( uint16 *unicodebuffer, uint32 position, uint32 size ) const;
inline void SetText ( const Text &other, uint32 position = 0, uint32 size = kSize_End );
inline void AppendText ( const Text &other, uint32 position = 0, uint32 size = kSize_End );
inline void InsertText ( const Text &other, uint32 position );
inline void DeleteText ( uint32 positionToDelete, uint32 sizeToDelete = kSize_End );
inline uint32 Find ( const Text &other, uint32 position ) const;
inline uint32 FindPrev ( const Text &other, uint32 position ) const;
inline uint32 FindIgnoringCase ( const Text &other, uint32 position ) const;
inline uint32 FindPrevIgnoringCase ( const Text &other, uint32 position ) const;
inline void Uppercase ();
inline void Lowercase ();
inline void GetStyle ( CharacterStyle& style, uint32 position ) const;
inline void GetDefaultStyle ( CharacterStyle& style ) const;
inline void SetStyle ( const CharacterStyle& style, uint32 position = 0, uint32 size = kSize_End );
inline void RemoveStyle ( const CharacterStyle& style );
inline void ResetAllStyleBuffers ();
inline bool operator == ( const Text &that ) const;
inline bool operator != ( const Text &that ) const;
inline bool operator < ( const Text &that ) const;
inline bool operator <= ( const Text &that ) const;
inline bool operator > ( const Text &that ) const;
inline bool operator >= ( const Text &that ) const;
inline void operator delete ( void *obj );
inline uint32 GetBytesEx ( char *charbuffer, uint32 buffersize, uint32 position = 0, uint32 size = kSize_End, Encoding encoding = kEncoding_UTF8 ) const;
private:
Text ();
Text ( const Text &source);
};
#if FMX_USE_AUTO_PTR
class DEPRECATED TextAutoPtr : public std::auto_ptr<Text>
{
typedef TextAutoPtr UpCaster;
public:
inline TextAutoPtr ();
};
#endif
#if FMX_USE_UNIQUE_PTR
class TextUniquePtr : public std::unique_ptr<Text>
{
typedef TextUniquePtr UpCaster;
public:
inline TextUniquePtr ();
};
#endif
}
}
extern "C"
{
fmx::Text FMX_API *FM_Text_Constructor1 ( fmx::_fmxcpt &_x ) throw ();
fmx::uint32 FMX_API FM_Text_GetSize ( const void *_self, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_Assign ( void *_self, const char *s, fmx::int32 encoding, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_GetBytes ( const void *_self, char *buffer, fmx::uint32 buffersize, fmx::uint32 position, fmx::uint32 size, fmx::int32 encoding, fmx::_fmxcpt &_x ) throw ();
fmx::uint32 FMX_API FM_Text_GetBytesEx ( const void *_self, char *buffer, fmx::uint32 buffersize, fmx::uint32 position, fmx::uint32 size, fmx::int32 encoding, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_AssignWide ( void *_self, const wchar_t *s, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_AssignUnicode ( void *_self, const fmx::uint16 *s, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_AssignWithLength ( void *_self, const char *s, fmx::uint32 strlength, fmx::int32 encoding, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_AssignWideWithLength ( void *_self, const wchar_t *s, fmx::uint32 strlength, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_AssignUnicodeWithLength ( void *_self, const fmx::uint16 *s, fmx::uint32 strlength, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_GetUnicode ( const void *_self, fmx::uint16 *s, fmx::uint32 position, fmx::uint32 size, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_SetText ( void *_self, const fmx::Text &other, fmx::uint32 position, fmx::uint32 size, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_AppendText ( void *_self, const fmx::Text &other, fmx::uint32 position, fmx::uint32 size, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_InsertText ( void *_self, const fmx::Text &other, fmx::uint32 position, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_DeleteText ( void *_self, fmx::uint32 positionToDelete, fmx::uint32 sizeToDelete, fmx::_fmxcpt &_x ) throw ();
fmx::uint32 FMX_API FM_Text_Find ( const void *_self, const fmx::Text &other, fmx::uint32 position, fmx::_fmxcpt &_x ) throw ();
fmx::uint32 FMX_API FM_Text_FindPrev ( const void *_self, const fmx::Text &other, fmx::uint32 position, fmx::_fmxcpt &_x ) throw ();
fmx::uint32 FMX_API FM_Text_FindIgnoringCase ( const void *_self, const fmx::Text &other, fmx::uint32 position, fmx::_fmxcpt &_x ) throw ();
fmx::uint32 FMX_API FM_Text_FindPrevIgnoringCase ( const void *_self, const fmx::Text &other, fmx::uint32 position, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_Uppercase ( const void *_self, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_Lowercase ( const void *_self, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_GetStyle( const void *_self, fmx::CharacterStyle& style, fmx::uint32 position, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_GetDefaultStyle( const void *_self, fmx::CharacterStyle& style, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_SetStyle( void *_self, const fmx::CharacterStyle& style, fmx::uint32 position, fmx::uint32 size, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_RemoveStyle( void *_self, const fmx::CharacterStyle& style, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_ResetAllStyleBuffers( void *_self, fmx::_fmxcpt &_x ) throw ();
bool FMX_API FM_Text_operatorEQ ( const void *_self, const fmx::Text &that, fmx::_fmxcpt &_x ) throw ();
bool FMX_API FM_Text_operatorNE ( const void *_self, const fmx::Text &that, fmx::_fmxcpt &_x ) throw ();
bool FMX_API FM_Text_operatorLT ( const void *_self, const fmx::Text &that, fmx::_fmxcpt &_x ) throw ();
bool FMX_API FM_Text_operatorLE ( const void *_self, const fmx::Text &that, fmx::_fmxcpt &_x ) throw ();
bool FMX_API FM_Text_operatorGT ( const void *_self, const fmx::Text &that, fmx::_fmxcpt &_x ) throw ();
bool FMX_API FM_Text_operatorGE ( const void *_self, const fmx::Text &that, fmx::_fmxcpt &_x ) throw ();
void FMX_API FM_Text_Delete ( void *_self, fmx::_fmxcpt &_x ) throw ();
}
extern "C++"
{
namespace fmx
{
inline uint32 Text::GetSize () const
{
_fmxcpt _x;
uint32 _rtn = FM_Text_GetSize ( this, _x );
_x.Check ();
return _rtn;
}
inline void Text::Assign ( const char *s, Encoding encoding )
{
_fmxcpt _x;
FM_Text_Assign ( this, s, encoding, _x );
_x.Check ();
}
inline void Text::GetBytes ( char *buffer, uint32 buffersize, uint32 position, uint32 size, Encoding encoding ) const
{
_fmxcpt _x;
FM_Text_GetBytes ( this, buffer, buffersize, position, size, encoding, _x );
_x.Check ();
}
inline uint32 Text::GetBytesEx ( char *buffer, uint32 buffersize, uint32 position, uint32 size, Encoding encoding ) const
{
_fmxcpt _x;
uint32 _rtn = FM_Text_GetBytesEx ( this, buffer, buffersize, position, size, encoding, _x );
_x.Check ();
return _rtn;
}
inline void Text::AssignWide ( const wchar_t *s )
{
_fmxcpt _x;
FM_Text_AssignWide ( this, s, _x );
_x.Check ();
}
inline void Text::AssignUnicode ( const uint16 *s )
{
_fmxcpt _x;
FM_Text_AssignUnicode ( this, s, _x );
_x.Check ();
}
inline void Text::AssignWithLength ( const char *s, uint32 strlength, Encoding encoding )
{
_fmxcpt _x;
FM_Text_AssignWithLength ( this, s, strlength, encoding, _x );
_x.Check ();
}
inline void Text::AssignWideWithLength ( const wchar_t *s, uint32 strlength )
{
_fmxcpt _x;
FM_Text_AssignWideWithLength ( this, s, strlength, _x );
_x.Check ();
}
inline void Text::AssignUnicodeWithLength ( const uint16 *s, uint32 strlength )
{
_fmxcpt _x;
FM_Text_AssignUnicodeWithLength ( this, s, strlength, _x );
_x.Check ();
}
inline void Text::GetUnicode ( uint16 *s, uint32 position, uint32 size ) const
{
_fmxcpt _x;
FM_Text_GetUnicode ( this, s, position, size, _x );
_x.Check ();
}
inline void Text::SetText ( const Text &other, uint32 position, uint32 size )
{
_fmxcpt _x;
FM_Text_SetText ( this, other, position, size, _x );
_x.Check ();
}
inline void Text::AppendText ( const Text &other, uint32 position, uint32 size )
{
_fmxcpt _x;
FM_Text_AppendText ( this, other, position, size, _x );
_x.Check ();
}
inline void Text::InsertText ( const Text &other, uint32 position )
{
_fmxcpt _x;
FM_Text_InsertText ( this, other, position, _x );
_x.Check ();
}
inline void Text::DeleteText ( uint32 positionToDelete, uint32 sizeToDelete )
{
_fmxcpt _x;
FM_Text_DeleteText ( this, positionToDelete, sizeToDelete, _x );
_x.Check ();
}
inline uint32 Text::Find ( const Text &other, uint32 position ) const
{
_fmxcpt _x;
uint32 _rtn = FM_Text_Find ( this, other, position, _x );
_x.Check ();
return _rtn;
}
inline uint32 Text::FindPrev ( const Text &other, uint32 position ) const
{
_fmxcpt _x;
uint32 _rtn = FM_Text_FindPrev ( this, other, position, _x );
_x.Check ();
return _rtn;
}
inline uint32 Text::FindIgnoringCase ( const Text &other, uint32 position ) const
{
_fmxcpt _x;
uint32 _rtn = FM_Text_FindIgnoringCase ( this, other, position, _x );
_x.Check ();
return _rtn;
}
inline uint32 Text::FindPrevIgnoringCase ( const Text &other, uint32 position ) const
{
_fmxcpt _x;
uint32 _rtn = FM_Text_FindPrevIgnoringCase ( this, other, position, _x );
_x.Check ();
return _rtn;
}
inline void Text::Uppercase ()
{
_fmxcpt _x;
FM_Text_Uppercase ( this, _x );
_x.Check ();
}
inline void Text::Lowercase ()
{
_fmxcpt _x;
FM_Text_Lowercase ( this, _x );
_x.Check ();
}
inline void Text::GetStyle( CharacterStyle& style, uint32 position ) const
{
_fmxcpt _x;
FM_Text_GetStyle ( this, style, position, _x );
_x.Check ();
}
inline void Text::GetDefaultStyle( CharacterStyle& style ) const
{
_fmxcpt _x;
FM_Text_GetDefaultStyle ( this, style, _x );
_x.Check ();
}
inline void Text::SetStyle( const CharacterStyle& style, uint32 position, uint32 size )
{
_fmxcpt _x;
FM_Text_SetStyle ( this, style, position, size, _x );
_x.Check ();
}
inline void Text::RemoveStyle( const CharacterStyle& style )
{
_fmxcpt _x;
FM_Text_RemoveStyle ( this, style, _x );
_x.Check ();
}
inline void Text::ResetAllStyleBuffers()
{
_fmxcpt _x;
FM_Text_ResetAllStyleBuffers ( this, _x );
_x.Check ();
}
inline bool Text::operator == ( const Text &that ) const
{
_fmxcpt _x;
bool _rtn = FM_Text_operatorEQ ( this, that, _x );
_x.Check ();
return _rtn;
}
inline bool Text::operator != ( const Text &that ) const
{
_fmxcpt _x;
bool _rtn = FM_Text_operatorNE ( this, that, _x );
_x.Check ();
return _rtn;
}
inline bool Text::operator < ( const Text &that ) const
{
_fmxcpt _x;
bool _rtn = FM_Text_operatorLT ( this, that, _x );
_x.Check ();
return _rtn;
}
inline bool Text::operator <= ( const Text &that ) const
{
_fmxcpt _x;
bool _rtn = FM_Text_operatorLE ( this, that, _x );
_x.Check ();
return _rtn;
}
inline bool Text::operator > ( const Text &that ) const
{
_fmxcpt _x;
bool _rtn = FM_Text_operatorGT ( this, that, _x );
_x.Check ();
return _rtn;
}
inline bool Text::operator >= ( const Text &that ) const
{
_fmxcpt _x;
bool _rtn = FM_Text_operatorGE ( this, that, _x );
_x.Check ();
return _rtn;
}
inline void Text::operator delete ( void *obj )
{
_fmxcpt _x;
FM_Text_Delete ( obj, _x );
_x.Check ();
}
#if FMX_USE_AUTO_PTR
inline TextAutoPtr::TextAutoPtr ()
{
_fmxcpt _x;
reset ( FM_Text_Constructor1 ( _x ) );
_x.Check ();
}
#endif
#if FMX_USE_UNIQUE_PTR
inline TextUniquePtr::TextUniquePtr ()
{
_fmxcpt _x;
reset ( FM_Text_Constructor1 ( _x ) );
_x.Check ();
}
#endif
}
}
#endif