00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef FL_BLOCKLAYOUT_H
00024 #define FL_BLOCKLAYOUT_H
00025
00026 #ifdef HAVE_CONFIG_H
00027 #include "config.h"
00028 #endif
00029
00030 #ifdef FMT_TEST
00031 #include <stdio.h>
00032 #endif
00033
00034 #include "ut_misc.h"
00035 #include "ut_types.h"
00036 #include "ut_vector.h"
00037 #include "ut_growbuf.h"
00038 #include "ut_xml.h"
00039 #include "pt_Types.h"
00040 #include "fl_Layout.h"
00041 #include "fl_DocLayout.h"
00042 #include "fg_Graphic.h"
00043 #include "fl_AutoLists.h"
00044 #include "pp_Property.h"
00045 #include "fl_ContainerLayout.h"
00046 #include "fl_SectionLayout.h"
00047 #include "fb_LineBreaker.h"
00048 #include "ut_string_class.h"
00049
00050
00051 #define fl_BLOCK_STRUX_OFFSET 1
00052
00053 class fl_Squiggles;
00054 class fl_SpellSquiggles;
00055 class fl_GrammarSquiggles;
00056 class FL_DocLayout;
00057 class fl_SectionLayout;
00058 class fl_ContainerLayout;
00059 class fb_LineBreaker;
00060 class fb_Alignment;
00061 class fp_Line;
00062 class fp_Run;
00063 class GR_Graphics;
00064 class PD_Document;
00065 class PP_Property;
00066 class PX_ChangeRecord_FmtMark;
00067 class PX_ChangeRecord_FmtMarkChange;
00068 class PX_ChangeRecord_Object;
00069 class PX_ChangeRecord_ObjectChange;
00070 class PX_ChangeRecord_Span;
00071 class PX_ChangeRecord_SpanChange;
00072 class PX_ChangeRecord_Strux;
00073 class PX_ChangeRecord_StruxChange;
00074 class fl_AutoNum;
00075 class fp_VerticalContainer;
00076
00077
00078 typedef enum {
00079 FL_TAB_NONE = 0,
00080 FL_TAB_LEFT,
00081 FL_TAB_CENTER,
00082 FL_TAB_RIGHT,
00083 FL_TAB_DECIMAL,
00084 FL_TAB_BAR,
00085 __FL_TAB_MAX
00086 } eTabType;
00087
00088 typedef enum {
00089 FL_LEADER_NONE = 0,
00090 FL_LEADER_DOT,
00091 FL_LEADER_HYPHEN,
00092 FL_LEADER_UNDERLINE,
00093 FL_LEADER_THICKLINE,
00094 FL_LEADER_EQUALSIGN,
00095 __FL_LEADER_MAX
00096 } eTabLeader;
00097
00098
00099
00100
00101
00102
00103
00104 class SpellChecker;
00105 class fl_TabStop;
00106 void buildTabStops(const char* pszTabStops, UT_GenericVector<fl_TabStop*> &m_vecTabs);
00107
00108 class ABI_EXPORT fl_BlockLayout : public fl_ContainerLayout
00109 {
00110 friend class fl_Squiggles;
00111 friend class fl_SpellSquiggles;
00112 friend class fl_GrammarSquiggles;
00113 friend class fl_DocListener;
00114 friend class fl_TOCLayout;
00115 friend class fb_LineBreaker;
00116
00117 #ifdef ENABLE_SPELL
00118
00119
00120 friend void FL_DocLayout::_toggleAutoSpell(bool bSpell);
00121 #endif
00122
00123 public:
00124 fl_BlockLayout(PL_StruxDocHandle sdh,
00125 fl_ContainerLayout* pPrev, fl_SectionLayout*,
00126 PT_AttrPropIndex indexAP, bool bIsHdrFtr = false);
00127 ~fl_BlockLayout();
00128
00129 typedef enum _eSpacingPolicy
00130 {
00131 spacing_MULTIPLE,
00132 spacing_EXACT,
00133 spacing_ATLEAST
00134 } eSpacingPolicy;
00135
00136 void formatAll(void);
00137 virtual void format(void);
00138 void formatWrappedFromHere(fp_Line * pLine,fp_Page * pPage);
00139 fp_Line * getNextWrappedLine(UT_sint32 iX,
00140 UT_sint32 iHeight,
00141 fp_Page * pPage);
00142 void getLeftRightForWrapping(UT_sint32 iX,
00143 UT_sint32 iHeight,
00144 UT_sint32 & iMinLeft,
00145 UT_sint32 & iMinRight,
00146 UT_sint32 & iMinWidth);
00147 virtual bool recalculateFields(UT_uint32 iUpdateCount);
00148
00149 virtual void redrawUpdate();
00150 virtual void updateLayout(bool ) {}
00151 virtual fp_Container * getNewContainer(fp_Container * pCon = NULL);
00152 FV_View * getView(void) const {
00153 UT_return_val_if_fail( m_pLayout, NULL );
00154 return m_pLayout->getView();
00155 }
00156
00157 const char* getProperty(const gchar * pszName, bool bExpandStyles = true) const;
00158 const PP_PropertyType * getPropertyType(const gchar * szName,
00159 tProperty_type Type, bool bExpandStyles = true) const;
00160 void setAlignment(UT_uint32 iAlignCmd);
00161 UT_sint32 getLength(void) const;
00162 bool isEmbeddedType(void) const;
00163 bool isNotTOCable(void) const;
00164 bool isLastRunInBlock(fp_Run * pRun) const;
00165 void updateOffsets(PT_DocPosition posEmbedded,
00166 UT_uint32 iEmebbedSize, UT_sint32 iSuggestedDiff);
00167 void updateEnclosingBlockIfNeeded(void);
00168 fl_BlockLayout * getEnclosingBlock(void) const;
00169 UT_sint32 getEmbeddedOffset(UT_sint32 startOffset, fl_ContainerLayout *& pEmbedCL) const;
00170 void shuffleEmbeddedIfNeeded(fl_BlockLayout * pBlock, UT_uint32 blockOffset);
00171
00172 bool getXYOffsetToLine(UT_sint32 & xoff, UT_sint32 & yoff, fp_Line * pLine) const;
00173 bool setFramesOnPage(fp_Line * pLastLine);
00174 UT_sint32 getMinWrapWidth(void) const;
00175 UT_sint32 getHeightOfBlock(void);
00176 fp_Line * findLineWithFootnotePID(UT_uint32 pid) const;
00177 UT_sint32 getMaxNonBreakableRun(void) const;
00178 fp_Line* findPrevLineInDocument(fp_Line*) const;
00179 fp_Line* findNextLineInDocument(fp_Line*) const;
00180 virtual void appendTextToBuf(UT_GrowBuf & buf) const;
00181 void appendUTF8String(UT_UTF8String & sText) const;
00182 virtual fp_Run* getFirstRun(void) const { return m_pFirstRun; }
00183 inline void setFirstRun(fp_Run* pRun) { m_pFirstRun = pRun; }
00184 void clearPrint(void) const;
00185 inline bool isListItem(void) const { return m_bListItem; }
00186 bool isFirstInList(void) const;
00187
00188 void getListAttributesVector(UT_GenericVector<const gchar*> * va) const;
00189 void getListPropertyVector(UT_GenericVector<const gchar*> * vp) const;
00190
00191 void refreshRunProperties(void) const;
00192 char * getFormatFromListType(FL_ListType iListType) const;
00193 void remItemFromList(void);
00194 virtual void listUpdate(void);
00195 void resumeList( fl_BlockLayout * prevList);
00196 void prependList( fl_BlockLayout * nextList);
00197 FL_ListType decodeListType(char * listformat) const;
00198 FL_ListType getListType(void) const;
00199 gchar* getListStyleString( FL_ListType iListType) const;
00200 FL_ListType getListTypeFromStyle( const gchar * style) const;
00201 fl_BlockLayout * getNextList(UT_uint32 id) const;
00202 bool isListLabelInBlock(void) const;
00203 void StartList( const gchar * style, PL_StruxDocHandle prevSDH = NULL);
00204
00205 void StartList( FL_ListType lType, UT_uint32 start,
00206 const gchar * lDelim, const gchar * lDecimal,
00207 const gchar * fFont, float Align, float indent,
00208 UT_uint32 iParentID = 0, UT_uint32 level=0 );
00209
00210 void StopListInBlock(void);
00211 void deleteListLabel(void);
00212 UT_UCSChar * getListLabel(void) const;
00213 void transferListFlags(void);
00214 UT_uint32 getLevel(void) const;
00215 void setStarting( bool bValue);
00216 void setStopping( bool bValue);
00217 fl_BlockLayout * getPreviousList(UT_uint32 id) const;
00218 fl_BlockLayout * getPreviousList(void) const;
00219 fl_BlockLayout * getPreviousListOfSameMargin(void) const;
00220 fl_BlockLayout * getParentItem(void) const;
00221
00222 #ifdef ENABLE_SPELL
00223 void findSpellSquigglesForRun(fp_Run* pRun) const;
00224 void drawGrammarSquiggles(void) const;
00225 void findGrammarSquigglesForRun(fp_Run* pRun) const;
00226 #endif
00227
00228 UT_uint32 canSlurp(fp_Line* pLine) const;
00229
00230 PT_DocPosition getPosition(bool bActualBlockPos=false) const;
00231 fp_Run* findPointCoords(PT_DocPosition position, bool bEOL,
00232 UT_sint32& x, UT_sint32& y, UT_sint32& x2,
00233 UT_sint32& y2, UT_sint32& height, bool& bDirection) const;
00234
00235 fp_Run* findRunAtOffset(UT_uint32 offset) const;
00236
00237 bool getBlockBuf(UT_GrowBuf * pgb) const;
00238
00239 void clearScreen(GR_Graphics*) const;
00240
00241
00242 void getStyle(UT_UTF8String & sStyle) const;
00243 UT_sint32 getTextIndent(void) const;
00244 inline UT_sint32 getLeftMargin(void) const { return m_iLeftMargin; }
00245 inline UT_sint32 getRightMargin(void) const { return m_iRightMargin; }
00246 inline UT_sint32 getTopMargin(void) const { return m_iTopMargin; }
00247 inline UT_sint32 getBottomMargin(void) const { return m_iBottomMargin; }
00248 inline fb_Alignment * getAlignment(void) const { return m_pAlignment; }
00249 virtual FL_DocLayout* getDocLayout(void) const { return m_pLayout; }
00250 virtual fl_SectionLayout* getSectionLayout(void) const { return m_pSectionLayout;}
00251 fl_DocSectionLayout * getDocSectionLayout(void) const;
00252
00253 void setSectionLayout(fl_SectionLayout* pSectionLayout);
00254
00255 void getLineSpacing(double& dSpacing,
00256 eSpacingPolicy& eSpacing) const;
00257
00258 inline UT_uint32 getProp_Orphans(void) const { return m_iOrphansProperty; }
00259 inline UT_uint32 getProp_Widows(void) const { return m_iWidowsProperty; }
00260 inline bool getProp_KeepTogether(void) const { return m_bKeepTogether; }
00261 inline bool getProp_KeepWithNext(void) const { return m_bKeepWithNext; }
00262
00263 inline UT_BidiCharType getDominantDirection(void) const { return m_iDomDirection; }
00264 void setDominantDirection(UT_BidiCharType iDirection);
00265
00266 #ifdef ENABLE_SPELL
00267 inline fl_SpellSquiggles* getSpellSquiggles(void) const { return m_pSpellSquiggles; }
00268 inline fl_GrammarSquiggles* getGrammarSquiggles(void) const { return m_pGrammarSquiggles; }
00269 #endif
00270
00271 bool isHdrFtr(void) const;
00272 void setHdrFtr(void) { m_bIsHdrFtr = true;}
00273 void clearHdrFtr(void) { m_bIsHdrFtr = false;}
00274
00275 #ifdef ENABLE_SPELL
00276 bool checkSpelling(void);
00277 #endif
00278 void debugFlashing(void);
00279 bool findNextTabStop(UT_sint32 iStartX, UT_sint32 iMaxX,
00280 UT_sint32& iPosition, eTabType& iType,
00281 eTabLeader &iLeader ) const;
00282 bool findPrevTabStop(UT_sint32 iStartX, UT_sint32 iMaxX,
00283 UT_sint32& iPosition, eTabType& iType,
00284 eTabLeader &iLeader ) const;
00285 bool hasUpdatableField(void) { return m_bHasUpdatableField;}
00286 void setUpdatableField(bool bValue) { m_bHasUpdatableField = bValue;}
00287 inline UT_sint32 getDefaultTabInterval(void) const { return m_iDefaultTabInterval; }
00288 inline UT_sint32 getTabsCount(void) const {
00289 return m_vecTabs.getItemCount();
00290 }
00291
00292 bool doclistener_populateSpan(const PX_ChangeRecord_Span * pcrs, PT_BlockOffset blockOffset, UT_uint32 len);
00293 bool doclistener_populateObject(PT_BlockOffset blockOffset, const PX_ChangeRecord_Object * pcro);
00294
00295 bool doclistener_insertSpan(const PX_ChangeRecord_Span * pcrs);
00296 bool doclistener_deleteSpan(const PX_ChangeRecord_Span * pcrs);
00297 bool doclistener_changeSpan(const PX_ChangeRecord_SpanChange * pcrsc);
00298 bool doclistener_deleteStrux(const PX_ChangeRecord_Strux * pcrx);
00299 bool doclistener_changeStrux(const PX_ChangeRecord_StruxChange * pcrxc);
00300 bool doclistener_insertFirstBlock(const PX_ChangeRecord_Strux * pcrx,
00301 PL_StruxDocHandle sdh,
00302 PL_ListenerId lid,
00303 void (* pfnBindHandles)(PL_StruxDocHandle sdhNew,
00304 PL_ListenerId lid,
00305 PL_StruxFmtHandle sfhNew));
00306 bool doclistener_insertBlock(const PX_ChangeRecord_Strux * pcrx,
00307 PL_StruxDocHandle sdh,
00308 PL_ListenerId lid,
00309 void (* pfnBindHandles)(PL_StruxDocHandle sdhNew,
00310 PL_ListenerId lid,
00311 PL_StruxFmtHandle sfhNew));
00312 bool doclistener_insertSection(const PX_ChangeRecord_Strux * pcrx,
00313 SectionType iType,
00314 PL_StruxDocHandle sdh,
00315 PL_ListenerId lid,
00316 void (* pfnBindHandles)(PL_StruxDocHandle sdhNew,
00317 PL_ListenerId lid,
00318 PL_StruxFmtHandle sfhNew));
00319
00320 fl_SectionLayout * doclistener_insertTable(const PX_ChangeRecord_Strux * pcrx,
00321 SectionType iType,
00322 PL_StruxDocHandle sdh,
00323 PL_ListenerId lid,
00324 void (* pfnBindHandles)(PL_StruxDocHandle sdhNew,
00325 PL_ListenerId lid,
00326 PL_StruxFmtHandle sfhNew));
00327 fl_SectionLayout * doclistener_insertFrame(const PX_ChangeRecord_Strux * pcrx,
00328 SectionType iType,
00329 PL_StruxDocHandle sdh,
00330 PL_ListenerId lid,
00331 void (* pfnBindHandles)(PL_StruxDocHandle sdhNew,
00332 PL_ListenerId lid,
00333 PL_StruxFmtHandle sfhNew));
00334
00335 bool doclistener_insertObject(const PX_ChangeRecord_Object * pcro);
00336 bool doclistener_deleteObject(const PX_ChangeRecord_Object * pcro);
00337 bool doclistener_changeObject(const PX_ChangeRecord_ObjectChange * pcroc);
00338
00339 bool doclistener_insertFmtMark(const PX_ChangeRecord_FmtMark * pcrfm);
00340 bool doclistener_deleteFmtMark(const PX_ChangeRecord_FmtMark * pcrfm);
00341 bool doclistener_changeFmtMark(const PX_ChangeRecord_FmtMarkChange * pcrfmc);
00342
00343 void purgeLayout(void);
00344 virtual void collapse(void);
00345 virtual bool isCollapsed(void) const
00346 {return m_bIsCollapsed;}
00347 void coalesceRuns(void) const;
00348 virtual void setNeedsReformat(fl_ContainerLayout * pCL, UT_uint32 offset = 0);
00349 inline bool needsReformat(void) const
00350 { return (m_iNeedsReformat >= 0); }
00351 virtual void setNeedsRedraw(void);
00352 virtual bool needsRedraw(void) const
00353 { return m_bNeedsRedraw; }
00354 virtual void markAllRunsDirty(void);
00355 UT_sint32 findLineInBlock(fp_Line * pLine) const;
00356
00357 bool isWordDelimiter(UT_UCS4Char c, UT_UCS4Char next, UT_UCS4Char prev, UT_uint32 iBlockPos) const;
00358 bool isSentenceSeparator(UT_UCS4Char c, UT_uint32 iBlockPos) const;
00359 #ifdef ENABLE_SPELL
00360 bool checkWord(fl_PartOfBlock* pPOB) const;
00361 void recheckIgnoredWords();
00362 #endif
00363 void setStyleInTOC(bool b)
00364 { m_bStyleInTOC = b;}
00365 void forceSectionBreak(void);
00366 bool isContainedByTOC(void) const
00367 { return m_bIsTOC;}
00368 FootnoteType getTOCNumType(void) const;
00369 eTabLeader getTOCTabLeader(UT_sint32 iOff) const;
00370 UT_sint32 getTOCTabPosition(UT_sint32 iOff) const;
00371 void setAccumHeight(UT_sint32 i)
00372 { m_iAccumulatedHeight =i;}
00373 UT_sint32 getAccumHeight(void) const
00374 { return m_iAccumulatedHeight;}
00375 static bool s_EnumTabStops(void * myThis, UT_uint32 k, fl_TabStop *pTabInfo);
00376
00377 inline void addBackgroundCheckReason(UT_uint32 reason) {m_uBackgroundCheckReasons |= reason;}
00378 inline void removeBackgroundCheckReason(UT_uint32 reason) {m_uBackgroundCheckReasons &= ~reason;}
00379 inline bool hasBackgroundCheckReason(UT_uint32 reason) const {return ((m_uBackgroundCheckReasons & reason) ? true : false);}
00380
00381
00382
00383 UT_uint32 m_uBackgroundCheckReasons;
00384 void setPrevListLabel(bool b)
00385 { m_bPrevListLabel = b;}
00386 bool getNextTableElement(UT_GrowBuf * buf,
00387 PT_DocPosition startPos,
00388 PT_DocPosition & begPos,
00389 PT_DocPosition & endPos,
00390 UT_UTF8String & sWord,
00391 bool bIgnoreSpace) const;
00392 bool itemizeSpan(PT_BlockOffset blockOffset, UT_uint32 len,GR_Itemization & I);
00393
00394 #ifdef ENABLE_SPELL
00395
00396 void enqueueToSpellCheckAfter(fl_BlockLayout *prev);
00398 void dequeueFromSpellCheck(void);
00400 void clearQueueing(void)
00401 {
00402 m_prevToSpell = m_nextToSpell = NULL;
00403 }
00404 fl_BlockLayout *nextToSpell(void) const
00405 {
00406 return m_nextToSpell;
00407 }
00409 bool isQueued(void) const
00410 {
00411 return (m_prevToSpell != NULL)
00412 || (m_pLayout->spellQueueHead() == this);
00413 }
00414 #endif
00415
00416 #ifdef FMT_TEST
00417 void __dump(FILE * fp) const;
00418 #endif
00419
00420 private:
00421 virtual bool _canContainPoint() const;
00422
00423 protected:
00424
00425 void _recalcPendingWord(UT_uint32 iOffset, UT_sint32 chg) const;
00426 bool _doCheckWord(fl_PartOfBlock* pPOB,
00427 const UT_UCSChar* pBlockText,
00428 UT_sint32 iLength,
00429 bool bAddSquiggle = true,
00430 bool bClearScreen = true) const;
00431
00432 #ifdef ENABLE_SPELL
00433 bool _spellCheckWord(const UT_UCSChar * word, UT_uint32 len, UT_uint32 blockPos) const;
00434 SpellChecker * _getSpellChecker (UT_uint32 blockPos) const;
00435 #endif
00436
00437 bool _truncateLayout(fp_Run* pTruncRun);
00438
00439 #ifndef NDEBUG
00440 void _assertRunListIntegrityImpl(void) const;
00441 #endif
00442 void _assertRunListIntegrity(void) const;
00443
00444 void _mergeRuns(fp_Run* pFirstRunToMerge, fp_Run* pLastRunToMerge) const;
00445
00446 bool _doInsertRun(fp_Run* pNewRun);
00447 bool _delete(PT_BlockOffset blockOffset, UT_uint32 len);
00448 bool _doInsertTextSpan(PT_BlockOffset blockOffset, UT_uint32 len);
00449 bool _doInsertForcedLineBreakRun(PT_BlockOffset blockOffset);
00450 bool _doInsertFieldStartRun(PT_BlockOffset blockOffset);
00451 bool _doInsertFieldEndRun(PT_BlockOffset blockOffset);
00452 bool _doInsertBookmarkRun(PT_BlockOffset blockOffset);
00453 bool _doInsertHyperlinkRun(PT_BlockOffset blockOffset);
00454 bool _doInsertAnnotationRun(PT_BlockOffset blockOffset);
00455 bool _doInsertMathRun(PT_BlockOffset blockOffset,PT_AttrPropIndex indexAP,PL_ObjectHandle oh);
00456 bool _doInsertEmbedRun(PT_BlockOffset blockOffset,PT_AttrPropIndex indexAP,PL_ObjectHandle oh);
00457
00458 bool _doInsertForcedColumnBreakRun(PT_BlockOffset blockOffset);
00459 bool _doInsertForcedPageBreakRun(PT_BlockOffset blockOffset);
00460 bool _doInsertTabRun(PT_BlockOffset blockOffset);
00461 bool _doInsertTOCTabRun(PT_BlockOffset blockOffset);
00462 bool _doInsertTOCListLabelRun(PT_BlockOffset blockOffset);
00463 bool _doInsertTOCHeadingRun(PT_BlockOffset blockOffset);
00464 bool _doInsertTOCListTabRun(PT_BlockOffset blockOffset);
00465 bool _doInsertImageRun(PT_BlockOffset blockOffset, FG_Graphic* pFG, PL_ObjectHandle oh);
00466 bool _doInsertFieldRun(PT_BlockOffset blockOffset, const PX_ChangeRecord_Object * pcro);
00467 bool _doInsertFieldTOCRun(PT_BlockOffset blockOffset);
00468 bool _doInsertDirectionMarkerRun(PT_BlockOffset blockOffset, UT_UCS4Char iM);
00469 bool _deleteFmtMark(PT_BlockOffset blockOffset);
00470
00471 virtual void _lookupProperties(const PP_AttrProp* pAP);
00472 virtual void _lookupMarginProperties(const PP_AttrProp* pAP);
00473 void _removeLine(fp_Line*, bool bRemoveFromContainer, bool bReCalc);
00474 void _purgeLine(fp_Line*);
00475 void _removeAllEmptyLines(void);
00476
00477 bool _checkMultiWord(UT_sint32 iStart,
00478 UT_sint32 eor,
00479 bool bToggleIP) const;
00480
00481 UT_uint32 _getLastChar();
00482 void _stuffAllRunsOnALine(void);
00483 void _insertEndOfParagraphRun(void);
00484 void _purgeEndOfParagraphRun(void);
00485 void _breakLineAfterRun(fp_Run* );
00486
00487 static void _prefsListener(XAP_Prefs *pPrefs, UT_StringPtrMap * , void * data);
00488
00489 void _createListLabel(void);
00490 void _deleteListLabel(void);
00491 inline void _addBlockToPrevList( fl_BlockLayout * prevBlockInList, UT_uint32 level);
00492 inline void _prependBlockToPrevList( fl_BlockLayout * nextBlockInList);
00493 UT_sint32 m_iNeedsReformat;
00494
00495
00496 bool m_bNeedsRedraw;
00497 bool m_bIsHdrFtr;
00498
00499 FL_DocLayout* m_pLayout;
00500 fb_LineBreaker m_Breaker;
00501
00502 fp_Run* m_pFirstRun;
00503 fl_SectionLayout* m_pSectionLayout;
00504
00505 UT_GenericVector<fl_TabStop*> m_vecTabs;
00506 UT_sint32 m_iDefaultTabInterval;
00507
00508 UT_uint32 m_iOrphansProperty;
00509 UT_uint32 m_iWidowsProperty;
00510 UT_sint32 m_iTopMargin;
00511 UT_sint32 m_iBottomMargin;
00512 UT_sint32 m_iLeftMargin;
00513 UT_sint32 m_iRightMargin;
00514 UT_sint32 m_iTextIndent;
00515 fb_Alignment * m_pAlignment;
00516 double m_dLineSpacing;
00517
00518 eSpacingPolicy m_eSpacingPolicy;
00519 bool m_bKeepTogether;
00520 bool m_bKeepWithNext;
00521
00522 bool m_bStartList;
00523 bool m_bStopList;
00524 bool m_bListLabelCreated;
00525 #ifdef ENABLE_SPELL
00526 fl_SpellSquiggles * m_pSpellSquiggles;
00527 fl_GrammarSquiggles * m_pGrammarSquiggles;
00528 fl_BlockLayout *m_nextToSpell;
00529 fl_BlockLayout *m_prevToSpell;
00530 #endif
00531 bool m_bListItem;
00532 const gchar * m_szStyle;
00533 bool m_bIsCollapsed;
00534 bool m_bHasUpdatableField;
00535
00536 UT_BidiCharType m_iDomDirection;
00537 UT_BidiCharType m_iDirOverride;
00538
00539 bool m_bIsTOC;
00540 bool m_bStyleInTOC;
00541 UT_sint32 m_iTOCLevel;
00542
00543 bool m_bSameYAsPrevious;
00544 UT_sint32 m_iAccumulatedHeight;
00545 fp_VerticalContainer * m_pVertContainer;
00546 UT_sint32 m_iLinePosInContainer;
00547 bool m_bForceSectionBreak;
00548 bool m_bPrevListLabel;
00549 UT_sint32 m_iAdditionalMarginAfter;
00550 };
00551
00552
00553
00554
00555
00556
00557 class ABI_EXPORT fl_PartOfBlock
00558 {
00559 public:
00560 fl_PartOfBlock();
00561 fl_PartOfBlock(UT_sint32 iOffset, UT_sint32 iPTLength,
00562 bool bIsIgnored = false);
00563
00564 bool doesTouch(UT_sint32 iOffset, UT_sint32 iLength) const;
00565 inline UT_sint32 getOffset(void) const { return m_iOffset; }
00566 inline UT_sint32 getPTLength(void)const{ return m_iPTLength; }
00567 inline bool getIsIgnored(void) const { return m_bIsIgnored; }
00568
00569 inline void setOffset(UT_sint32 iOffset) { m_iOffset = iOffset; }
00570 inline void setPTLength(UT_sint32 iLength) { m_iPTLength = iLength; }
00571 inline void setIsIgnored(bool bIsIgnored) { m_bIsIgnored = bIsIgnored; }
00572 void setInvisible(void)
00573 {m_bIsInvisible = true;}
00574 bool isInvisible(void)
00575 { return m_bIsInvisible;}
00576 void setGrammarMessage(UT_UTF8String & sMsg);
00577 void getGrammarMessage(UT_UTF8String & sMsg) const;
00578
00579 private:
00580 UT_sint32 m_iOffset;
00581 UT_sint32 m_iPTLength;
00582
00583 bool m_bIsIgnored;
00584 bool m_bIsInvisible;
00585 UT_UTF8String m_sGrammarMessage;
00586 };
00587
00588 class ABI_EXPORT fl_TabStop
00589 {
00590 public:
00591
00592 fl_TabStop();
00593
00594 UT_sint32 getPosition() const { return iPosition;}
00595 void setPosition(UT_sint32 value) { iPosition = value;}
00596 eTabType getType() { return iType;}
00597 void setType(eTabType type) { iType = type;}
00598 eTabLeader getLeader() { return iLeader;};
00599 void setLeader(eTabLeader leader) { iLeader = leader;}
00600 UT_uint32 getOffset() { return iOffset;}
00601 void setOffset(UT_uint32 value) { iOffset = value;}
00602
00603 fl_TabStop& operator = (const fl_TabStop &Other)
00604 {
00605 iPosition = Other.iPosition;
00606 iType = Other.iType;
00607 iLeader = Other.iLeader;
00608 iOffset = Other.iOffset;
00609 return *this;
00610 }
00611
00612 protected:
00613
00614 UT_sint32 iPosition;
00615 eTabType iType;
00616 eTabLeader iLeader;
00617 UT_uint32 iOffset;
00618 };
00619
00620 #ifdef ENABLE_SPELL
00621 class ABI_EXPORT fl_BlockSpellIterator
00622 {
00623 friend class fl_BlockLayout;
00624
00625 UT_GrowBuf* m_pgb;
00626
00627 const fl_BlockLayout* m_pBL;
00628
00629 UT_sint32 m_iWordOffset;
00630 UT_sint32 m_iWordLength;
00631
00632 UT_sint32 m_iStartIndex;
00633 UT_sint32 m_iPrevStartIndex;
00634 UT_UCSChar* m_pText;
00635 UT_sint32 m_iLength;
00636
00637 UT_UCSChar* m_pMutatedString;
00638
00639 UT_sint32 m_iSentenceStart;
00640 UT_sint32 m_iSentenceEnd;
00641
00642 bool _ignoreFirstWordCharacter(const UT_UCSChar c) const;
00643 bool _ignoreLastWordCharacter(const UT_UCSChar c) const;
00644
00645 public:
00646 fl_BlockSpellIterator(const fl_BlockLayout* pBL, UT_sint32 iPos = 0);
00647 ~fl_BlockSpellIterator();
00648
00649 bool nextWordForSpellChecking(const UT_UCSChar*& pWord,
00650 UT_sint32& iLength,
00651 UT_sint32& iBlockPos,
00652 UT_sint32& iPTLength);
00653 void updateBlock(void);
00654 void updateSentenceBoundaries(void);
00655
00656 UT_sint32 getBlockLength(void) const;
00657
00658 void revertToPreviousWord(void);
00659
00660 const UT_UCSChar* getCurrentWord(UT_sint32& iLength) const;
00661 const UT_UCSChar* getPreWord(UT_sint32& iLength) const;
00662 const UT_UCSChar* getPostWord(UT_sint32& iLength) const;
00663 };
00664 #endif
00665
00666 #endif