InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITextParcelListData.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: dwaterfa
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __ITextParcelListData__
25 #define __ITextParcelListData__
26 
27 #include "IPMUnknown.h"
28 #include "ICompositionStyle.h"
29 
30 #include "PMRect.h"
31 #include "PMMatrix.h"
32 #include "TextID.h"
33 #include "UIDList.h"
34 #include "CTextEnum.h"
35 #include "ParcelKey.h"
36 #include "TextWrapRef.h"
37 
38 class ITextStoryThread;
39 class ISpread;
40 
41 
46 {
47  public:
48  enum { kDefaultIID = IID_ITEXTPARCELLISTDATA };
49 
50  //
51  // Composed state of the Text Parcel List
52  //
53  virtual IDataBase * GetDataBase() const = 0;
54  virtual UID GetTextModelUID() const = 0;
55  virtual UID GetFrameListUID() const = 0;
56 
57  virtual ITextStoryThread * QueryStoryThread() const = 0;
58 
62  virtual bool16 GetParcelIsDamaged(ParcelKey key) const = 0;
63  virtual void SetParcelDamaged(ParcelKey key) = 0;
64  virtual void ClearParcelDamage(ParcelKey key) = 0;
65 
72  virtual bool16 GetParcelNeedsWrapCheck(ParcelKey key) const = 0;
73 
93  virtual void SetParcelNeedsWrapCheck(ParcelKey key) = 0;
94 
103  virtual void ClearParcelNeedsWrapCheck(ParcelKey key) = 0;
104 
105  virtual TextIndex GetParcelTextStart(ParcelKey key) const = 0;
106  virtual int32 GetParcelTextSpan(ParcelKey key) const = 0;
107  virtual void SetParcelTextSpan(ParcelKey key, TextIndex span) = 0;
108  // NOT lean left, we want where it really is
109  virtual ParcelKey GetParcelContaining(TextIndex at) const = 0;
110 
111  //
112  // The Content bounds of the Parcel is measured from the top of the
113  // TOFLineHeight() of the first WaxLine to the GetContentBottom() of
114  // the last WaxLine in the Content coordinates.
115  //
116  // Clients which do not cache this information may return a height of
117  // 0.0 and TextParcelList::GetContentBounds() will compute it.
118  //
119  virtual void GetParcelVContentBounds(ParcelKey key, PMReal* pTop,
120  PMReal* pBottom) const = 0;
121  virtual void SetParcelVContentBounds(ParcelKey key, PMReal top,
122  PMReal bottom) = 0;
123 
129  virtual bool16 GetParcelHasPositionDependentContent(ParcelKey key) const = 0;
130  virtual void SetParcelHasPositionDependentContent(ParcelKey key, bool16 v) = 0;
131 
135  virtual bool16 GetParcelHasKeepsOn(ParcelKey key) const = 0;
136  virtual void SetParcelHasKeepsOn(ParcelKey key, bool16 v) = 0;
137 
138  //
139  // Indicates if the Parcel has valid post-processing of VJ using the
140  // pre-4.0 style of VJ which did not have a separate Composition
141  // YPosition. This will be cleared by the TextParcelList::Recompose()
142  // when composition in the Parcel begins.
143  //
144  virtual bool16 GetParcelHasBeenVJed(ParcelKey key) const = 0;
145  virtual void SetParcelHasBeenVJed(ParcelKey key, bool16 vj) = 0;
146 
147  //
148  // Indicates if any WaxLines have GridAlignmentMetric other
149  // than kGANone.
150  //
151  virtual bool16 GetParcelHasGridAlignedWax(ParcelKey key) const = 0;
152  virtual void SetParcelHasGridAlignedWax(ParcelKey key, bool16 v) = 0;
153 
154  //
155  // Indicates if any WaxLines have NeedsYPosPostProcessing() set
156  // to kTrue.
157  //
158  virtual bool16 GetParcelHasNeedsPostProcessWax(ParcelKey key) const = 0;
159  virtual void SetParcelHasNeedsPostProcessWax(ParcelKey key, bool16 v) = 0;
160 
171  virtual ParcelKey GetFirstLogicalParcelKey(int32* pIndex = nil) const = 0;
172 
181  int32* pIndex = nil) const = 0;
182 
183  enum nextParcelType
184  {
185  npt_box,
186  npt_anypage,
187  npt_oddpage,
188  npt_evenpage
189  };
190 
202  nextParcelType pType,
203  int32* pIndex = nil) const = 0;
204 
213  int32* pIndex = nil) const = 0;
214 
220  virtual ParcelKey GetLastLogicalParcelKey(int32* pIndex = nil) const = 0;
221 
232  virtual ParcelKey GetLastLogicalNonOversetParcelKey(int32* pIndex = nil) const = 0;
233 
234  //
235  // Text Parcel List Options
236  //
237  virtual Text::FirstLineOffsetMetric
238  GetParcelFirstLineOffsetMetric(ParcelKey key) const = 0;
239  virtual PMReal GetParcelMinFirstLineOffset(ParcelKey key) const = 0;
240  virtual bool16 GetIsVertical() const = 0;
241  virtual bool16 GetIsRightToLeft() const = 0;
242 
243  //
244  // To disable Soft Bottom behavior simply return a value smaller or
245  // equal to the Parcel height, such as 0.0.
246  //
247  virtual PMReal GetParcelMaxSoftBottomHeight(ParcelKey key) const = 0;
248  virtual void SetParcelMaxSoftBottomHeight(ParcelKey key, PMReal maxHeight) = 0;
249 
250  virtual bool16 GetParcelIsValidStartBreakLocation(ParcelKey key,
251  Text::StartBreakLocation mode) const = 0;
252  virtual bool16 GetHasAnyValidStartBreakLocation() const = 0;
253 
262  virtual bool16 GetParcelSupportsWrap(ParcelKey key) const = 0;
263 
271  virtual bool16 GetParcelIgnoringWrap(ParcelKey key) const = 0;
272 
276  virtual int32 GetWaxAnchoredElementCount() const = 0;
277 
283  virtual int32 GetWaxAnchoredElementIndex(UID uid) const = 0;
284 
290  virtual void InsertNthWaxAnchoredElement(int32 n, UID uid) = 0;
291 
296  virtual void RemoveNthWaxAnchoredElement(int32 n) = 0;
297 
303  virtual UID GetNthWaxAnchoredElementUID(int32 n) const = 0;
304 
310  virtual ParcelKey GetNthWaxAnchoredElementParcelKey(int32 n) const = 0;
311 
316  virtual void SetNthWaxAnchoredElementParcelKey(int32 n,
317  ParcelKey Key) = 0;
318 
326  virtual int32 GetWaxAnchoredElementsIn(ParcelKey key,
327  UIDList* list = nil) const = 0;
328 
336  virtual ParcelKey GetFirstDamagedParcel() const = 0;
337 
344  virtual void GetFirstKeyIndexes(int32& damagedKeyIndex,
345  int32& needWrapCheckKeyIndex) const = 0;
346 
347  //
348  // See ITextParcelList::ShouldFakeTabAlignToChar for more info.
349  //
350  virtual bool16 ShouldFakeTabAlignToChar() const = 0;
351 
352  //
353  // Invalidate composed cached state for the Parcel including the ink
354  // bounds and pass info. This method will be called whenever the Parcel
355  // goes from the damaged state to the undamaged state.
356  //
357  virtual void InvalidateParcelComposedState(ParcelKey key) = 0;
358 
359  //
360  // This method will be called when the TextParcelList is notified that
361  // the inkBounds within the specified Parcel have changed outside of
362  // composition. The callee should notify the Parent containing Parcel,
363  // if any, by calling ITextParcelList::NotifyInkBoundsChanged().
364  //
365  virtual void NotifyParcelParentInkBoundsChanged(ParcelKey key) = 0;
366 
373  virtual int32 GetParcelsOnSpread(const ISpread* spread,
374  K2Vector<ParcelKey>& keyList) const = 0;
375 
387  virtual int32 GetNonInlineWrapsForParcel(ParcelKey key,
388  TextWrapRefList& sodList) const = 0;
389 
397  virtual void AddParcelWrap(ParcelKey key,
398  const TextWrapRef& sodRef,
399  bool16 isActive,
400  bool16 isNonInline,
401  bool16 isInlineToParcel) = 0;
402 
408  virtual bool16 GetParcelWrapActive(ParcelKey key,
409  const TextWrapRef& sodRef) const = 0;
410 
415  virtual void SetParcelWrapActive(ParcelKey,
416  const TextWrapRef& sodRef) = 0;
417 
422  virtual void ClearParcelWrapActive(ParcelKey key,
423  const TextWrapRef& sodRef) = 0;
424 
432  virtual bool16 GetParcelWrapIsNonInline(ParcelKey key,
433  const TextWrapRef& sodRef) const = 0;
434 
443  virtual bool16 GetParcelWrapIsInlineToParcel(ParcelKey key,
444  const TextWrapRef& sodRef) const = 0;
445 
450  virtual bool16 GetParcelWrapHasOverlappedRange(ParcelKey key,
451  const TextWrapRef& sodRef) const = 0;
452 
457  virtual void GetParcelWrapOverlappedRange(ParcelKey key,
458  const TextWrapRef& sodRef,
459  PMReal& waxYTop,
460  PMReal& waxYBottom) const = 0;
461 
466  virtual void SetParcelWrapOverlappedRange(ParcelKey key,
467  const TextWrapRef& sodRef,
468  const PMReal& waxYTop,
469  const PMReal& waxYBottom) = 0;
470 
476  virtual bool16 GetParcelHasWraps(ParcelKey key) const = 0;
477 
485  virtual int32 GetParcelWraps(ParcelKey key,
486  TextWrapRefList& sodList) const = 0;
487 
495  virtual bool16 GetParcelHasActiveNonInlineWraps(ParcelKey key) const = 0;
496 
504  virtual int32 GetParcelActiveNonInlineWraps(ParcelKey key,
505  TextWrapRefList& sodList) const = 0;
506 
513  virtual bool16 GetParcelHasActiveInlineWraps(ParcelKey key) const = 0;
514 
522  virtual int32 GetParcelActiveInlineWraps(ParcelKey key,
523  TextWrapRefList& sodList) const = 0;
524 
529  virtual void RemoveParcelWrap(ParcelKey key,
530  const TextWrapRef& sodRef) = 0;
531 
537  virtual bool16 GetSupportsColumnSpanType(ICompositionStyle::SpanColumnsTypeOptions spanType) const = 0;
538 
539 };
540 
541 #endif // __ITextParcelListData__