InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IFrameList.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Zak_Williamson
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 __IFrameList__
25 #define __IFrameList__
26 
27 #include "IPMUnknown.h"
28 #include "TextID.h"
29 #include "K2Vector.h"
30 
31 class ITextFrameColumn;
32 class ITextModel;
33 class RangeData;
34 
43 class IFrameList : public IPMUnknown
44 {
45 public:
46  enum { kDefaultIID = IID_IFRAMELIST };
47 
48  enum { kAtTheEnd = -1 };
49 
56  virtual void SetTextModelUID(UID modelUID) = 0;
57 
62  virtual UID GetTextModelUID() const = 0;
63 
68  virtual ITextModel * QueryTextModel() const = 0;
69 
75  virtual int32 GetFrameIndex(UID frameUID) const = 0;
76 
82  virtual int32 GetFrameIndex(const ITextFrameColumn* frame) const = 0;
83 
88  virtual int32 GetFrameCount() const = 0;
89 
95  virtual UID GetNthFrameUID(int32 n) const = 0;
96 
102  virtual ITextFrameColumn * QueryNthFrame(int32 n) const = 0;
103 
109  virtual TextIndex GetFrameStart(UID frameUID) const = 0;
110 
116  virtual int32 GetFrameSpan(UID frameUID) const = 0;
117 
125  virtual ITextFrameColumn * QueryFrameContaining(TextIndex textIndex, int32 * frameIndex /* = nil*/) const = 0;
126 
133  virtual int32 GetFrameIndexContaining(TextIndex at) const = 0;
134 
142  virtual void GetFramesContaining(const RangeData& range, int32* firstIndex, int32* lastIndex) const = 0;
143 
150  virtual bool16 GetWasOversetValid() const = 0;
151 
156  virtual bool16 GetWasOverset() const = 0;
157 
162  virtual void SetWasOverset(bool16 ov) = 0;
163 
168  virtual void AddFrame(UID frameUID) = 0;
169 
175  virtual void AddFrameAt(UID frameUID, int32 at) = 0;
176 
182  virtual void ProcessAddFrameAt(UID frameUID, int32 at) = 0;
183 
188  virtual void RemoveFrame(UID frameUID) = 0;
189 
193  virtual void ClearFrameList() = 0;
194 
201  virtual int32 GetFirstDamagedFrameIndex() const = 0;
202 
211  virtual void ClearInViewCache() = 0;
212 
218  virtual bool16 IsInView(UID frameUID) const = 0;
219 
224  virtual void AddToInViewCache(UID frameUID) = 0;
225 
226  /*
227  Normally recomposition and damage recording clear the "in view"
228  cache every time they are called, since they have no way of
229  knowing if what is in view has changed. However, recalculating
230  the cache is not free and some operations like Change All
231  make a lot of separate calls to mark damage (which calls IsInView)
232  without the possibility of what is in view changing. For these cases
233  you can (carefully) "freeze" and "unfreeze" the in view cache.
234  Freezing the cache clears it and prevents subsequent calls to
235  ClearInViewCache from having any effect. IsInView will populate
236  the cache as usual.
237  Note: The "frozen" flag is not persistent, so you must maintain
238  a reference on the IFrameList for the entire time the cache is frozen.
239  @param freezeIt If set to kTrue, the cache is frozen.
240  */
241  virtual void FreezeInViewCache(bool16 freezeIt) = 0;
242 
249  {
250  public:
251  InViewCacheFreezer(IFrameList * frameList)
252  : fFrameList(frameList)
253  {
254  if (frameList != nil)
255  {
256  fFrameList->AddRef();
257  fFrameList->FreezeInViewCache(kTrue);
258  }
259  }
260 
262  {
263  if (fFrameList != nil)
264  fFrameList->FreezeInViewCache(kFalse);
265  }
266 
267  private:
268  InterfacePtr<IFrameList> fFrameList;
269  };
270 
278  virtual uint32 GetChangeCounter() const = 0;
279 
280 #ifdef DEBUG
281 
284  virtual void LockDamaging( bool16 bLock ) = 0;
285 
289  virtual bool16 IsDamagingLocked() const = 0;
290 #endif
291 
296  virtual void SetNotInViewList(const UIDList& frameList) = 0;
297 
302  virtual void RemoveNotInViewList(const UIDList& frameList) = 0;
303 
304 };
305 
306 #endif