os/textandloc/fontservices/textshaperplugin/IcuSource/layout/GlyphIterator.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
 *
sl@0
     3
 * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
sl@0
     4
 *
sl@0
     5
 */
sl@0
     6
sl@0
     7
#ifndef __GLYPHITERATOR_H
sl@0
     8
#define __GLYPHITERATOR_H
sl@0
     9
sl@0
    10
/**
sl@0
    11
 * \file
sl@0
    12
 * \internal
sl@0
    13
 */
sl@0
    14
sl@0
    15
#include "LETypes.h"
sl@0
    16
#include "OpenTypeTables.h"
sl@0
    17
#include "GlyphDefinitionTables.h"
sl@0
    18
sl@0
    19
U_NAMESPACE_BEGIN
sl@0
    20
sl@0
    21
class LEGlyphStorage;
sl@0
    22
class GlyphPositionAdjustments;
sl@0
    23
sl@0
    24
class GlyphIterator : public UMemory {
sl@0
    25
public:
sl@0
    26
    GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjustments *theGlyphPositionAdjustments, le_bool rightToLeft, le_uint16 theLookupFlags, LETag theFeatureTag,
sl@0
    27
        const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader);
sl@0
    28
sl@0
    29
    GlyphIterator(GlyphIterator &that);
sl@0
    30
sl@0
    31
    GlyphIterator(GlyphIterator &that, LETag newFeatureTag);
sl@0
    32
sl@0
    33
    GlyphIterator(GlyphIterator &that, le_uint16 newLookupFlags);
sl@0
    34
sl@0
    35
    virtual ~GlyphIterator();
sl@0
    36
sl@0
    37
    void reset(le_uint16 newLookupFlags, LETag newFeatureTag);
sl@0
    38
sl@0
    39
    le_bool next(le_uint32 delta = 1);
sl@0
    40
    le_bool prev(le_uint32 delta = 1);
sl@0
    41
    le_bool findFeatureTag();
sl@0
    42
sl@0
    43
    le_bool isRightToLeft() const;
sl@0
    44
    le_bool ignoresMarks() const;
sl@0
    45
sl@0
    46
    le_bool baselineIsLogicalEnd() const;
sl@0
    47
sl@0
    48
    LEGlyphID getCurrGlyphID() const;
sl@0
    49
    le_int32  getCurrStreamPosition() const;
sl@0
    50
sl@0
    51
    le_int32  getMarkComponent(le_int32 markPosition) const;
sl@0
    52
    le_bool   findMark2Glyph();
sl@0
    53
sl@0
    54
    void getCursiveEntryPoint(LEPoint &entryPoint) const;
sl@0
    55
    void getCursiveExitPoint(LEPoint &exitPoint) const;
sl@0
    56
sl@0
    57
    void setCurrGlyphID(TTGlyphID glyphID);
sl@0
    58
    void setCurrStreamPosition(le_int32 position);
sl@0
    59
    void setCurrGlyphBaseOffset(le_int32 baseOffset);
sl@0
    60
    void adjustCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust,
sl@0
    61
                                           float xAdvanceAdjust,   float yAdvanceAdjust);
sl@0
    62
sl@0
    63
    void setCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust,
sl@0
    64
                                        float xAdvanceAdjust,   float yAdvanceAdjust);
sl@0
    65
sl@0
    66
    void setCursiveEntryPoint(LEPoint &entryPoint);
sl@0
    67
    void setCursiveExitPoint(LEPoint &exitPoint);
sl@0
    68
    void setCursiveGlyph();
sl@0
    69
sl@0
    70
    LEGlyphID *insertGlyphs(le_int32 count, LEErrorCode& success);
sl@0
    71
    le_int32 applyInsertions();
sl@0
    72
sl@0
    73
private:
sl@0
    74
    le_bool filterGlyph(le_uint32 index) const;
sl@0
    75
    le_bool hasFeatureTag() const;
sl@0
    76
    le_bool nextInternal(le_uint32 delta = 1);
sl@0
    77
    le_bool prevInternal(le_uint32 delta = 1);
sl@0
    78
sl@0
    79
    le_int32  direction;
sl@0
    80
    le_int32  position;
sl@0
    81
    le_int32  nextLimit;
sl@0
    82
    le_int32  prevLimit;
sl@0
    83
sl@0
    84
    LEGlyphStorage &glyphStorage;
sl@0
    85
    GlyphPositionAdjustments *glyphPositionAdjustments;
sl@0
    86
    le_int32 srcIndex;
sl@0
    87
    le_int32 destIndex;
sl@0
    88
    le_uint16 lookupFlags;
sl@0
    89
    LETag    featureTag;
sl@0
    90
    const GlyphClassDefinitionTable *glyphClassDefinitionTable;
sl@0
    91
    const MarkAttachClassDefinitionTable *markAttachClassDefinitionTable;
sl@0
    92
sl@0
    93
    GlyphIterator &operator=(const GlyphIterator &other); // forbid copying of this class
sl@0
    94
};
sl@0
    95
sl@0
    96
U_NAMESPACE_END
sl@0
    97
#endif