xref: /aoo41x/main/vcl/inc/sallayout.hxx (revision 248a599f)
1ebfcd9afSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3ebfcd9afSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4ebfcd9afSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5ebfcd9afSAndrew Rist  * distributed with this work for additional information
6ebfcd9afSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7ebfcd9afSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8ebfcd9afSAndrew Rist  * "License"); you may not use this file except in compliance
9ebfcd9afSAndrew Rist  * with the License.  You may obtain a copy of the License at
10ebfcd9afSAndrew Rist  *
11ebfcd9afSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12ebfcd9afSAndrew Rist  *
13ebfcd9afSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14ebfcd9afSAndrew Rist  * software distributed under the License is distributed on an
15ebfcd9afSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16ebfcd9afSAndrew Rist  * KIND, either express or implied.  See the License for the
17ebfcd9afSAndrew Rist  * specific language governing permissions and limitations
18ebfcd9afSAndrew Rist  * under the License.
19ebfcd9afSAndrew Rist  *
20ebfcd9afSAndrew Rist  *************************************************************/
21ebfcd9afSAndrew Rist 
22ebfcd9afSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_SALLAYOUT_HXX
25cdf0e10cSrcweir #define _SV_SALLAYOUT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/gen.hxx>
28cdf0e10cSrcweir #include <vector>
29ddde725dSArmin Le Grand #include <basegfx/polygon/b2dpolypolygon.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #ifndef _TOOLS_LANG_HXX
32cdf0e10cSrcweir typedef unsigned short LanguageType;
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include <vector>
36cdf0e10cSrcweir #include <list>
37cdf0e10cSrcweir #include <vcl/dllapi.h>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir // for typedef sal_UCS4
40cdf0e10cSrcweir #include <vcl/vclenum.hxx>
41*248a599fSHerbert Dürr #include "salglyphid.hxx"
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class SalGraphics;
44cdf0e10cSrcweir class ImplFontData;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #define MAX_FALLBACK 16
47cdf0e10cSrcweir 
48cdf0e10cSrcweir // ----------------
49cdf0e10cSrcweir // - LayoutOption -
50cdf0e10cSrcweir // ----------------
51cdf0e10cSrcweir 
52cdf0e10cSrcweir #define SAL_LAYOUT_BIDI_RTL                 0x0001
53cdf0e10cSrcweir #define SAL_LAYOUT_BIDI_STRONG              0x0002
54cdf0e10cSrcweir #define SAL_LAYOUT_RIGHT_ALIGN              0x0004
55cdf0e10cSrcweir #define SAL_LAYOUT_KERNING_PAIRS            0x0010
56cdf0e10cSrcweir #define SAL_LAYOUT_KERNING_ASIAN            0x0020
57cdf0e10cSrcweir #define SAL_LAYOUT_VERTICAL                 0x0040
58cdf0e10cSrcweir #define SAL_LAYOUT_COMPLEX_DISABLED         0x0100
59cdf0e10cSrcweir #define SAL_LAYOUT_ENABLE_LIGATURES         0x0200
60cdf0e10cSrcweir #define SAL_LAYOUT_SUBSTITUTE_DIGITS        0x0400
61cdf0e10cSrcweir #define SAL_LAYOUT_KASHIDA_JUSTIFICATON     0x0800
62cdf0e10cSrcweir #define SAL_LAYOUT_DISABLE_GLYPH_PROCESSING 0x1000
63cdf0e10cSrcweir #define SAL_LAYOUT_FOR_FALLBACK             0x2000
64cdf0e10cSrcweir 
65cdf0e10cSrcweir // -----------------
66cdf0e10cSrcweir 
67cdf0e10cSrcweir // used for managing runs e.g. for BiDi, glyph and script fallback
68cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC ImplLayoutRuns
69cdf0e10cSrcweir {
70cdf0e10cSrcweir private:
71cdf0e10cSrcweir     int                 mnRunIndex;
72cdf0e10cSrcweir     std::vector<int>    maRuns;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir public:
ImplLayoutRuns()75cdf0e10cSrcweir             ImplLayoutRuns() { mnRunIndex = 0; maRuns.reserve(8); }
76cdf0e10cSrcweir 
Clear()77cdf0e10cSrcweir     void    Clear()             { maRuns.clear(); }
78cdf0e10cSrcweir     bool    AddPos( int nCharPos, bool bRTL );
79cdf0e10cSrcweir     bool    AddRun( int nMinRunPos, int nEndRunPos, bool bRTL );
80cdf0e10cSrcweir 
IsEmpty() const81cdf0e10cSrcweir     bool    IsEmpty() const     { return maRuns.empty(); }
ResetPos()82cdf0e10cSrcweir     void    ResetPos()          { mnRunIndex = 0; }
NextRun()83cdf0e10cSrcweir     void    NextRun()           { mnRunIndex += 2; }
84cdf0e10cSrcweir     bool    GetRun( int* nMinRunPos, int* nEndRunPos, bool* bRTL ) const;
85cdf0e10cSrcweir     bool    GetNextPos( int* nCharPos, bool* bRTL );
86cdf0e10cSrcweir     bool    PosIsInRun( int nCharPos ) const;
87cdf0e10cSrcweir     bool    PosIsInAnyRun( int nCharPos ) const;
88cdf0e10cSrcweir };
89cdf0e10cSrcweir 
90cdf0e10cSrcweir // -----------------
91cdf0e10cSrcweir 
92cdf0e10cSrcweir class ImplLayoutArgs
93cdf0e10cSrcweir {
94cdf0e10cSrcweir public:
95cdf0e10cSrcweir     // string related inputs
96cdf0e10cSrcweir     int                 mnFlags;
97cdf0e10cSrcweir     int                 mnLength;
98cdf0e10cSrcweir     int                 mnMinCharPos;
99cdf0e10cSrcweir     int                 mnEndCharPos;
100cdf0e10cSrcweir     const xub_Unicode*  mpStr;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     // positioning related inputs
103cdf0e10cSrcweir     const sal_Int32*    mpDXArray;          // in pixel units
104cdf0e10cSrcweir     long                mnLayoutWidth;      // in pixel units
105cdf0e10cSrcweir     int                 mnOrientation;      // in 0-3600 system
106cdf0e10cSrcweir 
107cdf0e10cSrcweir     // data for bidi and glyph+script fallback
108cdf0e10cSrcweir     ImplLayoutRuns      maRuns;
109cdf0e10cSrcweir     ImplLayoutRuns      maReruns;
110cdf0e10cSrcweir 
111cdf0e10cSrcweir public:
112cdf0e10cSrcweir                 ImplLayoutArgs( const xub_Unicode* pStr, int nLength,
113cdf0e10cSrcweir                     int nMinCharPos, int nEndCharPos, int nFlags );
114cdf0e10cSrcweir 
SetLayoutWidth(long nWidth)115cdf0e10cSrcweir     void        SetLayoutWidth( long nWidth )       { mnLayoutWidth = nWidth; }
SetDXArray(const sal_Int32 * pDXArray)116cdf0e10cSrcweir     void        SetDXArray( const sal_Int32* pDXArray )  { mpDXArray = pDXArray; }
SetOrientation(int nOrientation)117cdf0e10cSrcweir     void        SetOrientation( int nOrientation )  { mnOrientation = nOrientation; }
118cdf0e10cSrcweir 
ResetPos()119cdf0e10cSrcweir     void        ResetPos()
120cdf0e10cSrcweir                     { maRuns.ResetPos(); }
GetNextPos(int * nCharPos,bool * bRTL)121cdf0e10cSrcweir     bool        GetNextPos( int* nCharPos, bool* bRTL )
122cdf0e10cSrcweir                     { return maRuns.GetNextPos( nCharPos, bRTL ); }
123cdf0e10cSrcweir     bool        GetNextRun( int* nMinRunPos, int* nEndRunPos, bool* bRTL );
NeedFallback(int nCharPos,bool bRTL)124cdf0e10cSrcweir     bool        NeedFallback( int nCharPos, bool bRTL )
125cdf0e10cSrcweir                     { return maReruns.AddPos( nCharPos, bRTL ); }
NeedFallback(int nMinRunPos,int nEndRunPos,bool bRTL)126cdf0e10cSrcweir     bool        NeedFallback( int nMinRunPos, int nEndRunPos, bool bRTL )
127cdf0e10cSrcweir                     { return maReruns.AddRun( nMinRunPos, nEndRunPos, bRTL ); }
128cdf0e10cSrcweir     // methods used by BiDi and glyph fallback
NeedFallback() const129cdf0e10cSrcweir     bool        NeedFallback() const
130cdf0e10cSrcweir                     { return !maReruns.IsEmpty(); }
131cdf0e10cSrcweir     bool        PrepareFallback();
132cdf0e10cSrcweir 
133cdf0e10cSrcweir protected:
134cdf0e10cSrcweir     void        AddRun( int nMinCharPos, int nEndCharPos, bool bRTL );
135cdf0e10cSrcweir };
136cdf0e10cSrcweir 
137cdf0e10cSrcweir // helper functions often used with ImplLayoutArgs
138cdf0e10cSrcweir bool IsDiacritic( sal_UCS4 );
139cdf0e10cSrcweir int GetVerticalFlags( sal_UCS4 );
140cdf0e10cSrcweir sal_UCS4 GetVerticalChar( sal_UCS4 );
141cdf0e10cSrcweir // #i80090# GetMirroredChar also needed outside vcl, moved to svapp.hxx
142cdf0e10cSrcweir // VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 );
143cdf0e10cSrcweir sal_UCS4 GetLocalizedChar( sal_UCS4, LanguageType );
144cdf0e10cSrcweir VCL_PLUGIN_PUBLIC const char* GetAutofallback( sal_UCS4 ) ;
145cdf0e10cSrcweir 
146cdf0e10cSrcweir // -------------
147cdf0e10cSrcweir // - SalLayout -
148cdf0e10cSrcweir // -------------
149cdf0e10cSrcweir 
150cdf0e10cSrcweir // all positions/widths are in font units
151cdf0e10cSrcweir // one exception: drawposition is in pixel units
152cdf0e10cSrcweir 
153cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC SalLayout
154cdf0e10cSrcweir {
155cdf0e10cSrcweir public:
156cdf0e10cSrcweir     // used by upper layers
DrawBase()157cdf0e10cSrcweir     Point&          DrawBase()                              { return maDrawBase; }
DrawBase() const158cdf0e10cSrcweir     const Point&    DrawBase() const                        { return maDrawBase; }
DrawOffset()159cdf0e10cSrcweir     Point&          DrawOffset()                            { return maDrawOffset; }
DrawOffset() const160cdf0e10cSrcweir     const Point&    DrawOffset() const                      { return maDrawOffset; }
161cdf0e10cSrcweir     Point           GetDrawPosition( const Point& rRelative = Point(0,0) ) const;
162cdf0e10cSrcweir 
163cdf0e10cSrcweir     virtual bool    LayoutText( ImplLayoutArgs& ) = 0;  // first step of layouting
164cdf0e10cSrcweir     virtual void    AdjustLayout( ImplLayoutArgs& );    // adjusting after fallback etc.
InitFont() const165cdf0e10cSrcweir     virtual void    InitFont() const {}
166cdf0e10cSrcweir     virtual void    DrawText( SalGraphics& ) const = 0;
167cdf0e10cSrcweir 
GetUnitsPerPixel() const168cdf0e10cSrcweir     int             GetUnitsPerPixel() const                { return mnUnitsPerPixel; }
GetOrientation() const169cdf0e10cSrcweir     int             GetOrientation() const                  { return mnOrientation; }
170cdf0e10cSrcweir 
171cdf0e10cSrcweir     virtual const ImplFontData* GetFallbackFontData( sal_GlyphId ) const;
172cdf0e10cSrcweir 
173cdf0e10cSrcweir     // methods using string indexing
174cdf0e10cSrcweir     virtual int     GetTextBreak( long nMaxWidth, long nCharExtra=0, int nFactor=1 ) const = 0;
175cdf0e10cSrcweir     virtual long    FillDXArray( sal_Int32* pDXArray ) const = 0;
GetTextWidth() const176cdf0e10cSrcweir     virtual long    GetTextWidth() const { return FillDXArray( NULL ); }
177cdf0e10cSrcweir     virtual void    GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const = 0;
IsKashidaPosValid(int) const178cdf0e10cSrcweir     virtual bool    IsKashidaPosValid ( int /*nCharPos*/ ) const { return true; } // i60594
179cdf0e10cSrcweir 
180cdf0e10cSrcweir     // methods using glyph indexing
181cdf0e10cSrcweir     virtual int     GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdAry, Point& rPos, int&,
182cdf0e10cSrcweir                         sal_Int32* pGlyphAdvAry = NULL, int* pCharPosAry = NULL ) const = 0;
183cdf0e10cSrcweir     virtual bool    GetOutline( SalGraphics&, ::basegfx::B2DPolyPolygonVector& ) const;
184cdf0e10cSrcweir     virtual bool    GetBoundRect( SalGraphics&, Rectangle& ) const;
185cdf0e10cSrcweir 
186cdf0e10cSrcweir     virtual bool    IsSpacingGlyph( sal_GlyphId ) const;
187cdf0e10cSrcweir 
188cdf0e10cSrcweir     // reference counting
189cdf0e10cSrcweir     void            Reference() const;
190cdf0e10cSrcweir     void            Release() const;
191cdf0e10cSrcweir 
192cdf0e10cSrcweir     // used by glyph+font+script fallback
193cdf0e10cSrcweir     virtual void    MoveGlyph( int nStart, long nNewXPos ) = 0;
194cdf0e10cSrcweir     virtual void    DropGlyph( int nStart ) = 0;
195cdf0e10cSrcweir     virtual void    Simplify( bool bIsBase ) = 0;
DisableGlyphInjection(bool)196cdf0e10cSrcweir     virtual void    DisableGlyphInjection( bool /*bDisable*/ ) {}
197cdf0e10cSrcweir 
198cdf0e10cSrcweir protected:
199cdf0e10cSrcweir     // used by layout engines
200cdf0e10cSrcweir                     SalLayout();
201cdf0e10cSrcweir     virtual         ~SalLayout();
202cdf0e10cSrcweir 
203cdf0e10cSrcweir     // used by layout layers
SetUnitsPerPixel(int n)204cdf0e10cSrcweir     void            SetUnitsPerPixel( int n )               { mnUnitsPerPixel = n; }
SetOrientation(int nOrientation)205cdf0e10cSrcweir     void            SetOrientation( int nOrientation )      // in 0-3600 system
206cdf0e10cSrcweir                     { mnOrientation = nOrientation; }
207cdf0e10cSrcweir 
208cdf0e10cSrcweir     static int      CalcAsianKerning( sal_UCS4, bool bLeft, bool bVertical );
209cdf0e10cSrcweir 
210cdf0e10cSrcweir private:
211cdf0e10cSrcweir     // enforce proper copy semantic
212cdf0e10cSrcweir     SAL_DLLPRIVATE  SalLayout( const SalLayout& );
213cdf0e10cSrcweir     SAL_DLLPRIVATE  SalLayout& operator=( const SalLayout& );
214cdf0e10cSrcweir 
215cdf0e10cSrcweir protected:
216cdf0e10cSrcweir     int             mnMinCharPos;
217cdf0e10cSrcweir     int             mnEndCharPos;
218cdf0e10cSrcweir     int             mnLayoutFlags;
219cdf0e10cSrcweir 
220cdf0e10cSrcweir     int             mnUnitsPerPixel;
221cdf0e10cSrcweir     int             mnOrientation;
222cdf0e10cSrcweir 
223cdf0e10cSrcweir     mutable int     mnRefCount;
224cdf0e10cSrcweir     mutable Point   maDrawOffset;
225cdf0e10cSrcweir     Point           maDrawBase;
226cdf0e10cSrcweir };
227cdf0e10cSrcweir 
228cdf0e10cSrcweir // ------------------
229cdf0e10cSrcweir // - MultiSalLayout -
230cdf0e10cSrcweir // ------------------
231cdf0e10cSrcweir 
232cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC MultiSalLayout : public SalLayout
233cdf0e10cSrcweir {
234cdf0e10cSrcweir public:
235cdf0e10cSrcweir     virtual void    DrawText( SalGraphics& ) const;
236cdf0e10cSrcweir     virtual int     GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const;
237cdf0e10cSrcweir     virtual long    FillDXArray( sal_Int32* pDXArray ) const;
238cdf0e10cSrcweir     virtual void    GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const;
239cdf0e10cSrcweir     virtual int     GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdxAry, Point& rPos,
240cdf0e10cSrcweir                         int&, sal_Int32* pGlyphAdvAry, int* pCharPosAry ) const;
241cdf0e10cSrcweir     virtual bool    GetOutline( SalGraphics&, ::basegfx::B2DPolyPolygonVector& ) const;
242cdf0e10cSrcweir     virtual bool    GetBoundRect( SalGraphics&, Rectangle& ) const;
243cdf0e10cSrcweir 
244cdf0e10cSrcweir     // used only by OutputDevice::ImplLayout, TODO: make friend
245cdf0e10cSrcweir     explicit        MultiSalLayout( SalLayout& rBaseLayout,
246cdf0e10cSrcweir                          const ImplFontData* pBaseFont = NULL );
247cdf0e10cSrcweir     virtual bool    AddFallback( SalLayout& rFallbackLayout,
248cdf0e10cSrcweir                          ImplLayoutRuns&, const ImplFontData* pFallbackFont );
249cdf0e10cSrcweir     virtual bool    LayoutText( ImplLayoutArgs& );
250cdf0e10cSrcweir     virtual void    AdjustLayout( ImplLayoutArgs& );
251cdf0e10cSrcweir     virtual void    InitFont() const;
252cdf0e10cSrcweir 
253cdf0e10cSrcweir     virtual const ImplFontData* GetFallbackFontData( sal_GlyphId ) const;
254cdf0e10cSrcweir 
255cdf0e10cSrcweir     void SetInComplete(bool bInComplete = true);
256cdf0e10cSrcweir 
257cdf0e10cSrcweir protected:
258cdf0e10cSrcweir     virtual         ~MultiSalLayout();
259cdf0e10cSrcweir 
260cdf0e10cSrcweir private:
261cdf0e10cSrcweir     // dummy implementations
MoveGlyph(int,long)262cdf0e10cSrcweir     virtual void    MoveGlyph( int, long ) {}
DropGlyph(int)263cdf0e10cSrcweir     virtual void    DropGlyph( int ) {}
Simplify(bool)264cdf0e10cSrcweir     virtual void    Simplify( bool ) {}
265cdf0e10cSrcweir 
266cdf0e10cSrcweir     // enforce proper copy semantic
267cdf0e10cSrcweir     SAL_DLLPRIVATE  MultiSalLayout( const MultiSalLayout& );
268cdf0e10cSrcweir     SAL_DLLPRIVATE  MultiSalLayout& operator=( const MultiSalLayout& );
269cdf0e10cSrcweir 
270cdf0e10cSrcweir private:
271cdf0e10cSrcweir     SalLayout*      mpLayouts[ MAX_FALLBACK ];
272cdf0e10cSrcweir     const ImplFontData* mpFallbackFonts[ MAX_FALLBACK ];
273cdf0e10cSrcweir     ImplLayoutRuns  maFallbackRuns[ MAX_FALLBACK ];
274cdf0e10cSrcweir     int             mnLevel;
275cdf0e10cSrcweir     bool            mbInComplete;
276cdf0e10cSrcweir };
277cdf0e10cSrcweir 
278cdf0e10cSrcweir // --------------------
279cdf0e10cSrcweir // - GenericSalLayout -
280cdf0e10cSrcweir // --------------------
281cdf0e10cSrcweir 
282cdf0e10cSrcweir struct GlyphItem
283cdf0e10cSrcweir {
284cdf0e10cSrcweir     int     mnFlags;
285cdf0e10cSrcweir     int     mnCharPos;      // index in string
286cdf0e10cSrcweir     int     mnOrigWidth;    // original glyph width
287cdf0e10cSrcweir     int     mnNewWidth;     // width after adjustments
288*248a599fSHerbert Dürr     sal_GlyphId maGlyphId;
289cdf0e10cSrcweir     Point   maLinearPos;    // absolute position of non rotated string
290cdf0e10cSrcweir 
291cdf0e10cSrcweir public:
GlyphItemGlyphItem292cdf0e10cSrcweir             GlyphItem() {}
293cdf0e10cSrcweir 
GlyphItemGlyphItem294*248a599fSHerbert Dürr             GlyphItem( int nCharPos, sal_GlyphId aGlyphId, const Point& rLinearPos,
295cdf0e10cSrcweir                 long nFlags, int nOrigWidth )
296cdf0e10cSrcweir             :   mnFlags(nFlags), mnCharPos(nCharPos),
297cdf0e10cSrcweir                 mnOrigWidth(nOrigWidth), mnNewWidth(nOrigWidth),
298*248a599fSHerbert Dürr                 maGlyphId(aGlyphId), maLinearPos(rLinearPos)
299cdf0e10cSrcweir             {}
300cdf0e10cSrcweir 
301cdf0e10cSrcweir     enum{ FALLBACK_MASK=0xFF, IS_IN_CLUSTER=0x100, IS_RTL_GLYPH=0x200, IS_DIACRITIC=0x400 };
302cdf0e10cSrcweir 
IsClusterStartGlyphItem303cdf0e10cSrcweir     bool    IsClusterStart() const	{ return ((mnFlags & IS_IN_CLUSTER) == 0); }
IsRTLGlyphGlyphItem304cdf0e10cSrcweir     bool    IsRTLGlyph() const		{ return ((mnFlags & IS_RTL_GLYPH) != 0); }
IsDiacriticGlyphItem305cdf0e10cSrcweir     bool    IsDiacritic() const		{ return ((mnFlags & IS_DIACRITIC) != 0); }
306cdf0e10cSrcweir };
307cdf0e10cSrcweir 
308cdf0e10cSrcweir // ---------------
309cdf0e10cSrcweir 
310cdf0e10cSrcweir typedef std::list<GlyphItem> GlyphList;
311cdf0e10cSrcweir typedef std::vector<GlyphItem> GlyphVector;
312cdf0e10cSrcweir 
313cdf0e10cSrcweir // ---------------
314cdf0e10cSrcweir 
315cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC GenericSalLayout : public SalLayout
316cdf0e10cSrcweir {
317cdf0e10cSrcweir public:
318cdf0e10cSrcweir     // used by layout engines
319cdf0e10cSrcweir     void            AppendGlyph( const GlyphItem& );
320cdf0e10cSrcweir     virtual void    AdjustLayout( ImplLayoutArgs& );
321cdf0e10cSrcweir     virtual void    ApplyDXArray( ImplLayoutArgs& );
322cdf0e10cSrcweir     virtual void    Justify( long nNewWidth );
323cdf0e10cSrcweir     void            KashidaJustify( long nIndex, int nWidth );
324cdf0e10cSrcweir     void            ApplyAsianKerning( const sal_Unicode*, int nLength );
325cdf0e10cSrcweir     void            SortGlyphItems();
326cdf0e10cSrcweir 
327cdf0e10cSrcweir     // used by upper layers
328cdf0e10cSrcweir     virtual long    GetTextWidth() const;
329cdf0e10cSrcweir     virtual long    FillDXArray( sal_Int32* pDXArray ) const;
330cdf0e10cSrcweir     virtual int     GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const;
331cdf0e10cSrcweir     virtual void    GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const;
332cdf0e10cSrcweir 
333cdf0e10cSrcweir     // used by display layers
334cdf0e10cSrcweir     virtual int     GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdxAry, Point& rPos, int&,
335cdf0e10cSrcweir                         sal_Int32* pGlyphAdvAry = NULL, int* pCharPosAry = NULL ) const;
336cdf0e10cSrcweir 
337cdf0e10cSrcweir protected:
338cdf0e10cSrcweir                     GenericSalLayout();
339cdf0e10cSrcweir     virtual         ~GenericSalLayout();
340cdf0e10cSrcweir 
341cdf0e10cSrcweir     // for glyph+font+script fallback
342cdf0e10cSrcweir     virtual void    MoveGlyph( int nStart, long nNewXPos );
343cdf0e10cSrcweir     virtual void    DropGlyph( int nStart );
344cdf0e10cSrcweir     virtual void    Simplify( bool bIsBase );
345cdf0e10cSrcweir 
346cdf0e10cSrcweir     bool            GetCharWidths( sal_Int32* pCharWidths ) const;
347cdf0e10cSrcweir 
348cdf0e10cSrcweir private:
349cdf0e10cSrcweir     GlyphItem*      mpGlyphItems;   // TODO: change to GlyphList
350cdf0e10cSrcweir     int             mnGlyphCount;
351cdf0e10cSrcweir     int             mnGlyphCapacity;
352cdf0e10cSrcweir     mutable Point   maBasePoint;
353cdf0e10cSrcweir 
354cdf0e10cSrcweir     // enforce proper copy semantic
355cdf0e10cSrcweir     SAL_DLLPRIVATE  GenericSalLayout( const GenericSalLayout& );
356cdf0e10cSrcweir     SAL_DLLPRIVATE  GenericSalLayout& operator=( const GenericSalLayout& );
357cdf0e10cSrcweir };
358cdf0e10cSrcweir 
359cdf0e10cSrcweir #undef SalGraphics
360cdf0e10cSrcweir 
361cdf0e10cSrcweir #endif // _SV_SALLAYOUT_HXX
362