1*b1cdbd2cSJim Jagielski/************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_rendering_XTextLayout_idl__ 24*b1cdbd2cSJim Jagielski#define __com_sun_star_rendering_XTextLayout_idl__ 25*b1cdbd2cSJim Jagielski 26*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_uno_XInterface_idl__ 27*b1cdbd2cSJim Jagielski#include <com/sun/star/uno/XInterface.idl> 28*b1cdbd2cSJim Jagielski#endif 29*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 30*b1cdbd2cSJim Jagielski#include <com/sun/star/lang/IllegalArgumentException.idl> 31*b1cdbd2cSJim Jagielski#endif 32*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__ 33*b1cdbd2cSJim Jagielski#include <com/sun/star/lang/IndexOutOfBoundsException.idl> 34*b1cdbd2cSJim Jagielski#endif 35*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_geometry_RealPoint2D_idl__ 36*b1cdbd2cSJim Jagielski#include <com/sun/star/geometry/RealPoint2D.idl> 37*b1cdbd2cSJim Jagielski#endif 38*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_geometry_RealBezierSegment2D_idl__ 39*b1cdbd2cSJim Jagielski#include <com/sun/star/geometry/RealBezierSegment2D.idl> 40*b1cdbd2cSJim Jagielski#endif 41*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_geometry_RealRectangle2D_idl__ 42*b1cdbd2cSJim Jagielski#include <com/sun/star/geometry/RealRectangle2D.idl> 43*b1cdbd2cSJim Jagielski#endif 44*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_rendering_ViewState_idl__ 45*b1cdbd2cSJim Jagielski#include <com/sun/star/rendering/ViewState.idl> 46*b1cdbd2cSJim Jagielski#endif 47*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_rendering_RenderState_idl__ 48*b1cdbd2cSJim Jagielski#include <com/sun/star/rendering/RenderState.idl> 49*b1cdbd2cSJim Jagielski#endif 50*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_rendering_StringContext_idl__ 51*b1cdbd2cSJim Jagielski#include <com/sun/star/rendering/StringContext.idl> 52*b1cdbd2cSJim Jagielski#endif 53*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_rendering_TextHit_idl__ 54*b1cdbd2cSJim Jagielski#include <com/sun/star/rendering/TextHit.idl> 55*b1cdbd2cSJim Jagielski#endif 56*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_rendering_Caret_idl__ 57*b1cdbd2cSJim Jagielski#include <com/sun/star/rendering/Caret.idl> 58*b1cdbd2cSJim Jagielski#endif 59*b1cdbd2cSJim Jagielski 60*b1cdbd2cSJim Jagielski 61*b1cdbd2cSJim Jagielskimodule com { module sun { module star { module rendering { 62*b1cdbd2cSJim Jagielski 63*b1cdbd2cSJim Jagielskipublished interface XCanvas; 64*b1cdbd2cSJim Jagielskipublished interface XCanvasFont; 65*b1cdbd2cSJim Jagielskipublished interface XPolyPolygon2D; 66*b1cdbd2cSJim Jagielski 67*b1cdbd2cSJim Jagielski/** This is the central interface for text layouting.<p> 68*b1cdbd2cSJim Jagielski 69*b1cdbd2cSJim Jagielski This is the central interface for text-related tasks more 70*b1cdbd2cSJim Jagielski complicated than simple string rendering. Note that all query 71*b1cdbd2cSJim Jagielski methods are subject to the current layout state of this 72*b1cdbd2cSJim Jagielski object. That is, calls to <member>XTextLayout::justify()</member> 73*b1cdbd2cSJim Jagielski or <member>XTextLayout::applyLogicalAdvancements()</member> are 74*b1cdbd2cSJim Jagielski likely to change subsequent output of those query methods.<p> 75*b1cdbd2cSJim Jagielski 76*b1cdbd2cSJim Jagielski Similar to <type>XCanvasFont</type>, all measurements and 77*b1cdbd2cSJim Jagielski coordinates accepted and returned by this interface are relative 78*b1cdbd2cSJim Jagielski to the font's local coordinate system (which only equals device 79*b1cdbd2cSJim Jagielski coordinate space, if the combined render transformation used 80*b1cdbd2cSJim Jagielski during text output is the identity transformation). Conversely, if 81*b1cdbd2cSJim Jagielski the combined transformation used during text output is 82*b1cdbd2cSJim Jagielski <em>not</em> the identity transformation, all measurements 83*b1cdbd2cSJim Jagielski returned by this interface should be subjected to that 84*b1cdbd2cSJim Jagielski transformation, to yield values in device coordinate space. 85*b1cdbd2cSJim Jagielski Depending on the underlying font technology, actual device output 86*b1cdbd2cSJim Jagielski might be off by up to one device pixel from the transformed 87*b1cdbd2cSJim Jagielski metrics.<p> 88*b1cdbd2cSJim Jagielski 89*b1cdbd2cSJim Jagielski @since OpenOffice 2.0 90*b1cdbd2cSJim Jagielski */ 91*b1cdbd2cSJim Jagielskipublished interface XTextLayout : ::com::sun::star::uno::XInterface 92*b1cdbd2cSJim Jagielski{ 93*b1cdbd2cSJim Jagielski /** Extract the polygonal shapes of the layouted text.<p> 94*b1cdbd2cSJim Jagielski 95*b1cdbd2cSJim Jagielski Each glyph is represented by a separate 96*b1cdbd2cSJim Jagielski <type>XPolyPolygon2D</type> in the returned sequence.<p> 97*b1cdbd2cSJim Jagielski 98*b1cdbd2cSJim Jagielski @returns a sequence of <type>XPolyPolygon2D</type> in font 99*b1cdbd2cSJim Jagielski coordinate space, one for every glyph. 100*b1cdbd2cSJim Jagielski */ 101*b1cdbd2cSJim Jagielski sequence<XPolyPolygon2D> queryTextShapes(); 102*b1cdbd2cSJim Jagielski 103*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 104*b1cdbd2cSJim Jagielski 105*b1cdbd2cSJim Jagielski /** Query the ink bounding boxes for every glyph in the layouted 106*b1cdbd2cSJim Jagielski text.<p> 107*b1cdbd2cSJim Jagielski 108*b1cdbd2cSJim Jagielski Ink, or tight bounding boxes in this case means that for 109*b1cdbd2cSJim Jagielski e.g. an 'a', the bounding box for the 110*b1cdbd2cSJim Jagielski <type>XPolyPolygon2D</type> describing the glyph 'a' is 111*b1cdbd2cSJim Jagielski returned, not the logical dimensions of the character in the 112*b1cdbd2cSJim Jagielski font.<p> 113*b1cdbd2cSJim Jagielski 114*b1cdbd2cSJim Jagielski @returns a sequence of rectangles in font coordinate space, 115*b1cdbd2cSJim Jagielski specifying the bounds, one for every glyph. 116*b1cdbd2cSJim Jagielski 117*b1cdbd2cSJim Jagielski @see <member>XTextLayout::queryMeasures()</member> 118*b1cdbd2cSJim Jagielski */ 119*b1cdbd2cSJim Jagielski sequence<::com::sun::star::geometry::RealRectangle2D > queryInkMeasures(); 120*b1cdbd2cSJim Jagielski 121*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 122*b1cdbd2cSJim Jagielski 123*b1cdbd2cSJim Jagielski /** Query the logical bounding boxes of every character in the 124*b1cdbd2cSJim Jagielski given text string.<p> 125*b1cdbd2cSJim Jagielski 126*b1cdbd2cSJim Jagielski Logical bounding boxes means the space that the font allocates 127*b1cdbd2cSJim Jagielski for the given character, which, e.g. for a '.', might be 128*b1cdbd2cSJim Jagielski significantly broader than the bounds returned via 129*b1cdbd2cSJim Jagielski <member>XTextLayout::queryInkMeasures()</member>. 130*b1cdbd2cSJim Jagielski 131*b1cdbd2cSJim Jagielski @returns a sequence of rectangles specifying the bounds in 132*b1cdbd2cSJim Jagielski font coordinate space, one for every glyph. 133*b1cdbd2cSJim Jagielski 134*b1cdbd2cSJim Jagielski @see <member>XTextLayout::queryInkMeasures()</member> 135*b1cdbd2cSJim Jagielski */ 136*b1cdbd2cSJim Jagielski sequence<::com::sun::star::geometry::RealRectangle2D> queryMeasures(); 137*b1cdbd2cSJim Jagielski 138*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 139*b1cdbd2cSJim Jagielski 140*b1cdbd2cSJim Jagielski /** Query the advancements for every character in the input string.<p> 141*b1cdbd2cSJim Jagielski 142*b1cdbd2cSJim Jagielski This method returns a sequence of advancements, one for each 143*b1cdbd2cSJim Jagielski character in the input string (<em>not</em> for every 144*b1cdbd2cSJim Jagielski glyph. There might be multiple glyphs per input character, or 145*b1cdbd2cSJim Jagielski multiple input characters per glyph). Adding up all 146*b1cdbd2cSJim Jagielski advancements yields the total advancement of this layout. To 147*b1cdbd2cSJim Jagielski manipulate the layout of a string on the level of characters, 148*b1cdbd2cSJim Jagielski this method can be used to query for the layout's default 149*b1cdbd2cSJim Jagielski advancements, which can subsequently be changed and applied to 150*b1cdbd2cSJim Jagielski the layout via 151*b1cdbd2cSJim Jagielski <member>XTextLayout::applyLogicalAdvancements()</member>.<p> 152*b1cdbd2cSJim Jagielski 153*b1cdbd2cSJim Jagielski @returns a sequence of <type>double</type> specifying the 154*b1cdbd2cSJim Jagielski advancements per character in font coordinate space. 155*b1cdbd2cSJim Jagielski 156*b1cdbd2cSJim Jagielski @see <member>XTextLayout::applyLogicalAdvancements()</member> 157*b1cdbd2cSJim Jagielski */ 158*b1cdbd2cSJim Jagielski sequence<double> queryLogicalAdvancements(); 159*b1cdbd2cSJim Jagielski 160*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 161*b1cdbd2cSJim Jagielski 162*b1cdbd2cSJim Jagielski /** Apply explicit advancements for every character in the layout 163*b1cdbd2cSJim Jagielski string.<p> 164*b1cdbd2cSJim Jagielski 165*b1cdbd2cSJim Jagielski This method applies the specified advancements to every 166*b1cdbd2cSJim Jagielski logical character in the input string (<em>not</em> for every 167*b1cdbd2cSJim Jagielski glyph. There might be multiple glyphs per input character, or 168*b1cdbd2cSJim Jagielski multiple input characters per glyph). This is useful to 169*b1cdbd2cSJim Jagielski explicitely manipulate the exact output positions of 170*b1cdbd2cSJim Jagielski characters, e.g. relative to a reference output device.<p> 171*b1cdbd2cSJim Jagielski 172*b1cdbd2cSJim Jagielski @param aAdvancements 173*b1cdbd2cSJim Jagielski A sequence of character advancements, in font coordinate 174*b1cdbd2cSJim Jagielski space. 175*b1cdbd2cSJim Jagielski 176*b1cdbd2cSJim Jagielski @see <member>XTextLayout::queryLogicalAdvancements()</member> 177*b1cdbd2cSJim Jagielski 178*b1cdbd2cSJim Jagielski @throws <type>com::sun::star::lang::IllegalArgumentException</type> 179*b1cdbd2cSJim Jagielski if the size of aAdvancements does not match the number of 180*b1cdbd2cSJim Jagielski characters in the text. 181*b1cdbd2cSJim Jagielski */ 182*b1cdbd2cSJim Jagielski void applyLogicalAdvancements( [in] sequence< double > aAdvancements ) 183*b1cdbd2cSJim Jagielski raises (com::sun::star::lang::IllegalArgumentException); 184*b1cdbd2cSJim Jagielski 185*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 186*b1cdbd2cSJim Jagielski 187*b1cdbd2cSJim Jagielski /** Query the overall bounding box of the text.<p> 188*b1cdbd2cSJim Jagielski 189*b1cdbd2cSJim Jagielski This method is similar to 190*b1cdbd2cSJim Jagielski <member>XTextLayout::queryTextMeasures</member>, only that the 191*b1cdbd2cSJim Jagielski overall bounds are returned by this method.<p> 192*b1cdbd2cSJim Jagielski 193*b1cdbd2cSJim Jagielski @return the overall bounding box for the given layout, in font 194*b1cdbd2cSJim Jagielski coordinate space. 195*b1cdbd2cSJim Jagielski */ 196*b1cdbd2cSJim Jagielski ::com::sun::star::geometry::RealRectangle2D queryTextBounds(); 197*b1cdbd2cSJim Jagielski 198*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 199*b1cdbd2cSJim Jagielski 200*b1cdbd2cSJim Jagielski /** Justify the text to the given size.<p> 201*b1cdbd2cSJim Jagielski 202*b1cdbd2cSJim Jagielski This method is the core of the <type>XTextLayout</type> 203*b1cdbd2cSJim Jagielski interface, because it layouts the text in a typographically 204*b1cdbd2cSJim Jagielski correct way into the available space.<p> 205*b1cdbd2cSJim Jagielski 206*b1cdbd2cSJim Jagielski @param nSize 207*b1cdbd2cSJim Jagielski The requested size of the text after justification (either 208*b1cdbd2cSJim Jagielski width or height, depending on the writing mode). This 209*b1cdbd2cSJim Jagielski parameter is interpreted in font coordinate space. 210*b1cdbd2cSJim Jagielski 211*b1cdbd2cSJim Jagielski @return the actual size of the text after the justification in 212*b1cdbd2cSJim Jagielski the font coordinate space. Depending on the font and the 213*b1cdbd2cSJim Jagielski script type, this might be somewhat different from the size 214*b1cdbd2cSJim Jagielski requested. If the requested size was smaller than the 215*b1cdbd2cSJim Jagielski justification algorithm could compress the text, this value 216*b1cdbd2cSJim Jagielski might even be significantly larger than nSize. 217*b1cdbd2cSJim Jagielski 218*b1cdbd2cSJim Jagielski @throws <type>com::sun::star::lang::IllegalArgumentException</type> 219*b1cdbd2cSJim Jagielski if nSize is 0 or negative. 220*b1cdbd2cSJim Jagielski */ 221*b1cdbd2cSJim Jagielski double justify( [in] double nSize ) 222*b1cdbd2cSJim Jagielski raises (com::sun::star::lang::IllegalArgumentException); 223*b1cdbd2cSJim Jagielski 224*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 225*b1cdbd2cSJim Jagielski 226*b1cdbd2cSJim Jagielski /** Justify a number of text layouts to the given size.<p> 227*b1cdbd2cSJim Jagielski 228*b1cdbd2cSJim Jagielski This method can be used to combine the layout of a text line 229*b1cdbd2cSJim Jagielski into a single justification run. This is e.g. useful if the 230*b1cdbd2cSJim Jagielski line consists of several text portions (e.g. because of 231*b1cdbd2cSJim Jagielski different fonts or colors), but it is desirable to spread the 232*b1cdbd2cSJim Jagielski available space more globally across the different layout 233*b1cdbd2cSJim Jagielski objects. If, for example, one layout object contains 234*b1cdbd2cSJim Jagielski significantly more whitespace or Kashidas than the rest, this 235*b1cdbd2cSJim Jagielski method can assign proportionally more space to this layout 236*b1cdbd2cSJim Jagielski object.<p> 237*b1cdbd2cSJim Jagielski 238*b1cdbd2cSJim Jagielski @param aNextLayouts 239*b1cdbd2cSJim Jagielski A sequence of layouts following this one in logical text 240*b1cdbd2cSJim Jagielski order. 241*b1cdbd2cSJim Jagielski 242*b1cdbd2cSJim Jagielski @param nSize 243*b1cdbd2cSJim Jagielski The requested size of the text for <em>all</em> 244*b1cdbd2cSJim Jagielski <type>XTextLayout</type>s after justification in font 245*b1cdbd2cSJim Jagielski coordinate space (either width or height, depending on the 246*b1cdbd2cSJim Jagielski writing mode). 247*b1cdbd2cSJim Jagielski 248*b1cdbd2cSJim Jagielski @return the actual size of the text after the justification, 249*b1cdbd2cSJim Jagielski in font coordinate space. Depending on the font and the 250*b1cdbd2cSJim Jagielski script type, this might be somewhat different from the size 251*b1cdbd2cSJim Jagielski requested. If the requested size was smaller than the 252*b1cdbd2cSJim Jagielski justification algorithm could compress the text, this value 253*b1cdbd2cSJim Jagielski might even be significantly larger than nSize. 254*b1cdbd2cSJim Jagielski 255*b1cdbd2cSJim Jagielski @throws <type>com::sun::star::lang::IllegalArgumentException</type> 256*b1cdbd2cSJim Jagielski if one of the parameters are not in the valid range. 257*b1cdbd2cSJim Jagielski */ 258*b1cdbd2cSJim Jagielski double combinedJustify( [in] sequence< XTextLayout > aNextLayouts, [in] double nSize ) 259*b1cdbd2cSJim Jagielski raises (com::sun::star::lang::IllegalArgumentException); 260*b1cdbd2cSJim Jagielski 261*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 262*b1cdbd2cSJim Jagielski 263*b1cdbd2cSJim Jagielski /** This method determines the hit position in the text.<p> 264*b1cdbd2cSJim Jagielski 265*b1cdbd2cSJim Jagielski This method determines the index of the character hit at the 266*b1cdbd2cSJim Jagielski specified position (in font coordinate space).<p> 267*b1cdbd2cSJim Jagielski 268*b1cdbd2cSJim Jagielski @param aHitPoint 269*b1cdbd2cSJim Jagielski The position in font coordinate space to determine the 270*b1cdbd2cSJim Jagielski underlying character index for. 271*b1cdbd2cSJim Jagielski 272*b1cdbd2cSJim Jagielski */ 273*b1cdbd2cSJim Jagielski TextHit getTextHit( [in] ::com::sun::star::geometry::RealPoint2D aHitPoint ); 274*b1cdbd2cSJim Jagielski 275*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 276*b1cdbd2cSJim Jagielski 277*b1cdbd2cSJim Jagielski /** This method converts an insertion index to a caret.<p> 278*b1cdbd2cSJim Jagielski 279*b1cdbd2cSJim Jagielski This method generates caret information for a given insertion 280*b1cdbd2cSJim Jagielski point in the layout text.<p> 281*b1cdbd2cSJim Jagielski 282*b1cdbd2cSJim Jagielski @param nInsertionIndex 283*b1cdbd2cSJim Jagielski The insertion index, as e.g. returned by 284*b1cdbd2cSJim Jagielski <member>XTextLayout::getTextHit()</member>. This value must be 285*b1cdbd2cSJim Jagielski in the range 0 up to the number of characters in the string. 286*b1cdbd2cSJim Jagielski 287*b1cdbd2cSJim Jagielski @param bExcludeLigatures 288*b1cdbd2cSJim Jagielski Set this to <TRUE/>, to skip the positions inside ligatures as 289*b1cdbd2cSJim Jagielski valid caret placements. That means, on cannot e.g. set the 290*b1cdbd2cSJim Jagielski caret between the 'f' and the 'i' in a 'fi' ligature. 291*b1cdbd2cSJim Jagielski 292*b1cdbd2cSJim Jagielski @returns the generated Caret structure. 293*b1cdbd2cSJim Jagielski 294*b1cdbd2cSJim Jagielski @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 295*b1cdbd2cSJim Jagielski if nInsertionIndex is outside the permissible range. 296*b1cdbd2cSJim Jagielski */ 297*b1cdbd2cSJim Jagielski Caret getCaret( [in] long nInsertionIndex, 298*b1cdbd2cSJim Jagielski [in] boolean bExcludeLigatures ) 299*b1cdbd2cSJim Jagielski raises (com::sun::star::lang::IndexOutOfBoundsException); 300*b1cdbd2cSJim Jagielski 301*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 302*b1cdbd2cSJim Jagielski 303*b1cdbd2cSJim Jagielski /** This method calculates a new insertion index.<p> 304*b1cdbd2cSJim Jagielski 305*b1cdbd2cSJim Jagielski This method calculates a new insertion index, given a start 306*b1cdbd2cSJim Jagielski index and the number of characters to skip. This is most 307*b1cdbd2cSJim Jagielski useful for caret traveling.<p> 308*b1cdbd2cSJim Jagielski 309*b1cdbd2cSJim Jagielski @param nStartIndex 310*b1cdbd2cSJim Jagielski The insertion index to start from. 311*b1cdbd2cSJim Jagielski 312*b1cdbd2cSJim Jagielski @param nCaretAdvancement 313*b1cdbd2cSJim Jagielski For values greater than 0, the caret is visually moved to the 314*b1cdbd2cSJim Jagielski right. For values smaller than 0, the caret is visually moved 315*b1cdbd2cSJim Jagielski to the left. 316*b1cdbd2cSJim Jagielski 317*b1cdbd2cSJim Jagielski @returns the new insertion index. 318*b1cdbd2cSJim Jagielski 319*b1cdbd2cSJim Jagielski @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 320*b1cdbd2cSJim Jagielski if nStartIndex or nCaretAdvancement is outside the permissible 321*b1cdbd2cSJim Jagielski range. 322*b1cdbd2cSJim Jagielski */ 323*b1cdbd2cSJim Jagielski long getNextInsertionIndex( [in] long nStartIndex, 324*b1cdbd2cSJim Jagielski [in] long nCaretAdvancement, 325*b1cdbd2cSJim Jagielski [in] boolean bExcludeLigatures ) 326*b1cdbd2cSJim Jagielski raises (com::sun::star::lang::IndexOutOfBoundsException); 327*b1cdbd2cSJim Jagielski 328*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 329*b1cdbd2cSJim Jagielski 330*b1cdbd2cSJim Jagielski /** This method generates a highlight polygon.<p> 331*b1cdbd2cSJim Jagielski 332*b1cdbd2cSJim Jagielski This method generates a highlighting polygon from two 333*b1cdbd2cSJim Jagielski insertion indices. This polygon will be visually continuous, 334*b1cdbd2cSJim Jagielski i.e. will not have non-highlighted text in between.<p> 335*b1cdbd2cSJim Jagielski 336*b1cdbd2cSJim Jagielski @param nStartIndex 337*b1cdbd2cSJim Jagielski Start of the selection range. 338*b1cdbd2cSJim Jagielski 339*b1cdbd2cSJim Jagielski @param nEndIndex 340*b1cdbd2cSJim Jagielski End of the selection range. 341*b1cdbd2cSJim Jagielski 342*b1cdbd2cSJim Jagielski @return the highlight polygon in the font coordinate space. 343*b1cdbd2cSJim Jagielski 344*b1cdbd2cSJim Jagielski @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 345*b1cdbd2cSJim Jagielski if nStartIndex or nEndIndex are outside the permissible 346*b1cdbd2cSJim Jagielski range. 347*b1cdbd2cSJim Jagielski */ 348*b1cdbd2cSJim Jagielski XPolyPolygon2D queryVisualHighlighting( [in] long nStartIndex, 349*b1cdbd2cSJim Jagielski [in] long nEndIndex ) 350*b1cdbd2cSJim Jagielski raises (com::sun::star::lang::IndexOutOfBoundsException); 351*b1cdbd2cSJim Jagielski 352*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 353*b1cdbd2cSJim Jagielski 354*b1cdbd2cSJim Jagielski /** This method generates a highlight polygon.<p> 355*b1cdbd2cSJim Jagielski 356*b1cdbd2cSJim Jagielski This method generates a highlighting polygon from two 357*b1cdbd2cSJim Jagielski insertion indices. This polygon will not always be visually 358*b1cdbd2cSJim Jagielski continuous, if e.g. the text direction changes in the middle 359*b1cdbd2cSJim Jagielski of the selection, the might be parts visually between start 360*b1cdbd2cSJim Jagielski and end position that are not selected.<p> 361*b1cdbd2cSJim Jagielski 362*b1cdbd2cSJim Jagielski @param nStartIndex 363*b1cdbd2cSJim Jagielski Start of the selection range. 364*b1cdbd2cSJim Jagielski 365*b1cdbd2cSJim Jagielski @param nEndIndex 366*b1cdbd2cSJim Jagielski End of the selection range. 367*b1cdbd2cSJim Jagielski 368*b1cdbd2cSJim Jagielski @return the highlight polygon in the font coordinate space. 369*b1cdbd2cSJim Jagielski 370*b1cdbd2cSJim Jagielski @throws <type>com::sun::star::lang::IndexOutOfBoundsException</type> 371*b1cdbd2cSJim Jagielski if nStartIndex or nEndIndex are outside the permissible 372*b1cdbd2cSJim Jagielski range. 373*b1cdbd2cSJim Jagielski */ 374*b1cdbd2cSJim Jagielski XPolyPolygon2D queryLogicalHighlighting( [in] long nStartIndex, 375*b1cdbd2cSJim Jagielski [in] long nEndIndex ) 376*b1cdbd2cSJim Jagielski raises (com::sun::star::lang::IndexOutOfBoundsException); 377*b1cdbd2cSJim Jagielski 378*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 379*b1cdbd2cSJim Jagielski 380*b1cdbd2cSJim Jagielski /** This method yields the baseline offset.<p> 381*b1cdbd2cSJim Jagielski 382*b1cdbd2cSJim Jagielski This method returns the baseline offset for this layout 383*b1cdbd2cSJim Jagielski object, either measured from the top or the left edge, 384*b1cdbd2cSJim Jagielski depending on the writing direction (horizontally or 385*b1cdbd2cSJim Jagielski vertically). Since rendering this layout via 386*b1cdbd2cSJim Jagielski <member>XCanvas::drawTextLayout()</member> outputs relative to 387*b1cdbd2cSJim Jagielski the layout object's baseline, this method can be used to 388*b1cdbd2cSJim Jagielski e.g. output relative to the left, top edge.<p> 389*b1cdbd2cSJim Jagielski 390*b1cdbd2cSJim Jagielski @returns the distance of the main baseline from the top or the 391*b1cdbd2cSJim Jagielski left edge of this object, depending on the writing direction. 392*b1cdbd2cSJim Jagielski */ 393*b1cdbd2cSJim Jagielski double getBaselineOffset(); 394*b1cdbd2cSJim Jagielski 395*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 396*b1cdbd2cSJim Jagielski 397*b1cdbd2cSJim Jagielski /** This method returns the main writing direction.<p> 398*b1cdbd2cSJim Jagielski 399*b1cdbd2cSJim Jagielski This method returns the main writing direction of this layout, 400*b1cdbd2cSJim Jagielski i.e. either LEFT_TO_RIGHT or RIGHT_TO_LEFT.<p> 401*b1cdbd2cSJim Jagielski 402*b1cdbd2cSJim Jagielski @returns the main text direction of this layout. 403*b1cdbd2cSJim Jagielski */ 404*b1cdbd2cSJim Jagielski byte getMainTextDirection(); 405*b1cdbd2cSJim Jagielski 406*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 407*b1cdbd2cSJim Jagielski 408*b1cdbd2cSJim Jagielski /** Request the associated font for this layout.. 409*b1cdbd2cSJim Jagielski 410*b1cdbd2cSJim Jagielski @returns the associated font for this layout. 411*b1cdbd2cSJim Jagielski */ 412*b1cdbd2cSJim Jagielski XCanvasFont getFont(); 413*b1cdbd2cSJim Jagielski 414*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 415*b1cdbd2cSJim Jagielski 416*b1cdbd2cSJim Jagielski /** Request the text this layout contains. 417*b1cdbd2cSJim Jagielski 418*b1cdbd2cSJim Jagielski @returns the text this layout contains. 419*b1cdbd2cSJim Jagielski */ 420*b1cdbd2cSJim Jagielski StringContext getText(); 421*b1cdbd2cSJim Jagielski 422*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 423*b1cdbd2cSJim Jagielski 424*b1cdbd2cSJim Jagielski}; 425*b1cdbd2cSJim Jagielski 426*b1cdbd2cSJim Jagielski}; }; }; }; 427*b1cdbd2cSJim Jagielski 428*b1cdbd2cSJim Jagielski#endif 429