LEGlyphStorage.h

Go to the documentation of this file.
00001 /*
00002  **********************************************************************
00003  *   Copyright (C) 1998-2009, International Business Machines
00004  *   Corporation and others.  All Rights Reserved.
00005  **********************************************************************
00006  */
00007 
00008 #ifndef __LEGLYPHSTORAGE_H
00009 #define __LEGLYPHSTORAGE_H
00010 
00011 #include "LETypes.h"
00012 #include "LEInsertionList.h"
00013 
00019 U_NAMESPACE_BEGIN
00020 
00034 class U_LAYOUT_API LEGlyphStorage : public UObject, protected LEInsertionCallback
00035 {
00036 private:
00042     le_int32   fGlyphCount;
00043 
00049     LEGlyphID *fGlyphs;
00050  
00056     le_int32  *fCharIndices;
00057 
00063     float     *fPositions;
00064 
00070     le_uint32 *fAuxData;
00071 
00072 
00078     LEInsertionList *fInsertionList;
00079 
00085     le_int32 fSrcIndex;
00086 
00092     le_int32 fDestIndex;
00093 
00094 protected:
00110     virtual le_bool applyInsertion(le_int32 atPosition, le_int32 count, LEGlyphID newGlyphs[]);
00111 
00112 public:
00113 
00121     LEGlyphStorage();
00122 
00128     ~LEGlyphStorage();
00129 
00137     inline le_int32 getGlyphCount() const;
00138 
00149     void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
00150 
00163     void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
00164 
00175     void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
00176 
00188     void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
00189 
00201     void getGlyphPositions(float positions[], LEErrorCode &success) const;
00202 
00217     void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
00218 
00231     void allocateGlyphArray(le_int32 initialGlyphCount, le_bool rightToLeft, LEErrorCode &success);
00232 
00243     le_int32 allocatePositions(LEErrorCode &success);
00244 
00254     le_int32 allocateAuxData(LEErrorCode &success);
00255 
00264     void getAuxData(le_uint32 auxData[], LEErrorCode &success) const;
00265 
00276     LEGlyphID getGlyphID(le_int32 glyphIndex, LEErrorCode &success) const;
00277 
00288     le_int32  getCharIndex(le_int32 glyphIndex, LEErrorCode &success) const;
00289 
00290 
00301     le_uint32 getAuxData(le_int32 glyphIndex, LEErrorCode &success) const;
00302 
00313     inline LEGlyphID &operator[](le_int32 glyphIndex) const;
00314 
00332     LEGlyphID *insertGlyphs(le_int32 atIndex, le_int32 insertCount, LEErrorCode& success);
00333 
00353     LEGlyphID *insertGlyphs(le_int32 atIndex, le_int32 insertCount);
00354 
00368     void moveGlyph(le_int32 fromPosition, le_int32 toPosition, le_uint32 marker);
00369 
00382     le_int32 applyInsertions();
00383 
00393     void setGlyphID(le_int32 glyphIndex, LEGlyphID glyphID, LEErrorCode &success);
00394 
00404     void setCharIndex(le_int32 glyphIndex, le_int32 charIndex, LEErrorCode &success);
00405 
00416     void setPosition(le_int32 glyphIndex, float x, float y, LEErrorCode &success);
00417 
00428     void adjustPosition(le_int32 glyphIndex, float xAdjust, float yAdjust, LEErrorCode &success);
00429 
00439     void setAuxData(le_int32 glyphIndex, le_uint32 auxData, LEErrorCode &success);
00440 
00451     void adoptGlyphArray(LEGlyphStorage &from);
00452 
00463     void adoptCharIndicesArray(LEGlyphStorage &from);
00464 
00475     void adoptPositionArray(LEGlyphStorage &from);
00476 
00487     void adoptAuxDataArray(LEGlyphStorage &from);
00488 
00498     void adoptGlyphCount(LEGlyphStorage &from);
00499 
00507     void adoptGlyphCount(le_int32 newGlyphCount);
00508 
00517     void reset();
00518 
00524     virtual UClassID getDynamicClassID() const;
00525 
00531     static UClassID getStaticClassID();
00532 };
00533 
00534 inline le_int32 LEGlyphStorage::getGlyphCount() const
00535 {
00536     return fGlyphCount;
00537 }
00538 
00539 inline LEGlyphID &LEGlyphStorage::operator[](le_int32 glyphIndex) const
00540 {
00541     return fGlyphs[glyphIndex];
00542 }
00543 
00544 
00545 U_NAMESPACE_END
00546 #endif
00547 

Generated on 21 Jul 2013 for ICU 4.2.1 by  doxygen 1.4.7