InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IGalleyUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner:
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 __IGALLEYUTILS__
25 #define __IGALLEYUTILS__
26 
27 #include "WritingModeID2.h"
28 #include "IFontMgr.h"
29 
30 class IPanelControlData;
31 class IControlView;
33 class IFontInstance;
34 class IDocument;
35 class IGraphicsContext;
36 class IGraphicsPort;
37 class RealAGMColor;
38 class ITextModel;
39 class ITextLines;
40 class IDrawingStyle;
41 
42 namespace InDesign{ class TextRange;}
43 class ITextTarget;
44 class ILayoutTarget;
45 class ITableTarget;
46 class IViewColorScheme;
47 
48 #include "IPMUnknown.h"
49 #include "UIDList.h"
50 #include "ITextDataValidation.h"
51 #include "IInCopyViewPrefs.h"
52 #include "K2Vector.h"
53 #include "RangeData.h"
54 #include "Utils.h"
55 
74 class IGalleyUtils : public IPMUnknown
75 {
76  public:
77  enum { kDefaultIID = IID_IGALLEYUTILS };
78 
91  virtual IControlView *GetWritingWidget(IPanelControlData *panelData, UIDRef storyRef) = 0;
92 
97  virtual UIDRef GetStoryRef(IControlView *writingWidget) = 0;
98 
105  virtual UIDRef GetFrameRef(IControlView *writingWidget) = 0;
106 
112  virtual int32 GetStoryIndex(ITextLines* textLines, ITextModel* textModel) = 0;
113 
119  virtual IControlView *FindGalleyView(IDocument *document) = 0;
120 
127  virtual void MeasureText(IFontInstance *fontInstance, const PMString& data, PMReal* xWidth, PMReal* yWidth) = 0;
128 
139  //virtual IWindow *FindFrontmostGalleyWindow( IDocument *document = nil ) = 0;
140  virtual IDocumentPresentation *FindFrontmostGalleyPresentation( IDocument *document = nil ) = 0;
141 
149  //virtual IWindow *FindFrontmostLayoutWindow( IDocument *document = nil ) = 0;
150  virtual IDocumentPresentation *FindFrontmostLayoutPresentation( IDocument *document = nil ) = 0;
151 
160  virtual UIDList GetGalleyPanels( UIDRef onDocRef = UIDRef() ) = 0;
161 
173  virtual PMString GetFontOfStyle(PMString fontFamilyName, IFontMgr::FontStyleBits fontStyle) = 0;
174 
181  virtual IPMFont* QueryInterfaceFont(bool16 hilite) = 0;
182 
196  virtual void DrawInterfaceString(const PMString& string, IControlView *drawInView, IGraphicsPort* gPort, const PMRect& textBounds,
197  const PMPoint& textLoc, const RealAGMColor& textColor,
198  const RealAGMColor& backgroundColor, bool16 hilite = kFalse) = 0;
199 
203  virtual void GetXMeasureUnitList(K2Vector<ClassID>& unitList) = 0;
204 
212  virtual ITextDataValidation::RangeError ParseLineRange(K2Vector<int32>& rangeList, PMString rangeText, int32 start, int32 end) =0;
213 
214 
224  virtual void GetFontName(PMString &fontName, PMString &fontFamilyName, PMString &style) = 0;
225 
226 
231  virtual void GetFontStyleList(K2Vector<PMString>& StyleList, PMString &fontFamily) = 0;
232 
233 
239  virtual void GetFontNameList(K2Vector<PMString>& fontList, bool16 filterSymbolFonts = kTrue, K2Vector<PMString> *translatedFontList = nil) = 0;
240 
241 
247  virtual void GetFontFamilyAndStyle(PMString &fontName, PMString &fontFamily, PMString &fontStyle) = 0;
248 
252  virtual bool16 InGalleyOrStory ( IDocumentPresentation* pres = nil ) = 0;
253 
257  virtual bool16 InGalley ( IDocumentPresentation* pres = nil ) = 0;
258 
262  virtual bool16 InStory ( IDocumentPresentation* pres = nil ) = 0;
263 
267  virtual bool16 InLayout ( IDocumentPresentation* pres = nil ) = 0;
268 
272  //virtual IInCopyViewPrefs::ActiveView GetDocWindowView ( IWindow* window = nil ) = 0;
274 
280  //virtual void SetDocWindowView ( IWindow* window, IInCopyViewPrefs::ActiveView viewMode ) = 0;
281  virtual void SetViewMode ( IDocumentPresentation* pres, IInCopyViewPrefs::ActiveView viewMode ) = 0;
282 
283 
292  virtual void SetGalleyTextSelection(TextIndex nStart, TextIndex nEnd, UIDRef storyRef, IControlView *forView = nil, bool16 ownedItemAllowed = kFalse) = 0;
293 
302  virtual void SetLayoutTextSelection(TextIndex nStart, TextIndex nEnd, UIDRef storyRef, bool16 ownedItemAllowed = kFalse) = 0;
303 
309  virtual void GetCurrentTextSelection(TextIndex& nStart, TextIndex& nEnd, UIDRef* storyRef, IControlView *view = nil) = 0;
310 
311 
319  virtual void GetListOfUserStories(IDocument *document, UIDList &stories, bool16 stripGraphicStories = kFalse) = 0;
320 
321 
328  virtual bool16 IsStoryCollapsedInGalley(const UIDRef &storyRef) = 0;
329 
330 
336  virtual void GetNonCollapsedStoryList(IDocumentPresentation * pres, UIDList &storyList) = 0;
337 
338 
349  virtual PMString GetPageNumberString(TextIndex pageNumberCharIndex, ITextModel *model) = 0;
350 
351 
360  virtual int32 GetTrueOversetLineLength(ITextModel *model, TextIndex startModelOffset, int32 averageLineLength,
361  int32 primarySpan, bool16 &endsInForceBreak) = 0;
362 
367  virtual int32 EstimateOversetLineLengths(ITextModel *model) = 0;
368 
377  virtual bool16 IsBreakCharacter(const UTF32TextChar &character, bool16 &forceBreak,
378  IDrawingStyle *drawStyle = nil, ITextModel *model = nil, TextIndex position = 0L) = 0;
379 
386  virtual void RefreshAllText(IControlView* writingView, bool16 justInval, bool16 ignoreILE, bool16 backgroundCompose = kFalse) = 0;
387 
388 
391  virtual void InvalInfoColumn(IControlView* writingView) = 0;
392 
398  virtual bool16 SuspendPlayPendingInvals(IDocumentPresentation* pres = nil) = 0;
399 
405  virtual bool16 ResumePlayPendingInvals(IDocumentPresentation* pres = nil) = 0;
406 
412  virtual bool16 SuspendPlayPendingInvals(UIDRef viewRef = UIDRef::gNull) = 0;
413 
419  virtual bool16 ResumePlayPendingInvals(UIDRef viewRef = UIDRef::gNull) = 0;
420 
433  virtual void CorrectFakedSpaceWidth(const UTF32TextChar &character, PMReal ptSize, IFontInstance *fontInstance, PMReal &charWidth) = 0;
434 
441  virtual void ScrollToCursor(IControlView *writingView, bool16 forceScroll = kFalse) = 0;
442 
449  virtual void GetInCopyStoriesForGalley(IDocument *theDoc, UIDList& filteredStories, bool16 stripGraphicStories) = 0;
450 
458  virtual bool16 WriteStoryListFile(const UIDRef &docRef) = 0;
459 
467  virtual bool16 ReadStoryListFile(const UIDRef &docRef) = 0;
468 
478  virtual std::string GetFontOfStyleAsStdStr(PMString fontFamilyName, IFontMgr::FontStyleBits fontStyle) = 0;
479 
487  virtual void GetFontNameAsStdStr(std::string &fontName, PMString &fontFamilyName, PMString &style) = 0;
488 
489 
494  virtual void AttachSpecialContainerToFrames(IDocument* doc, ITextModel* textModel) = 0;
495 };
496 
497 #endif // __IGALLEYUTILS__