InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPathUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Bernd Paradies
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 __IPathUtils__
25 #define __IPathUtils__
26 
27 #include "GenericID.h"
28 #include "IPMUnknown.h"
29 #include "Utils.h"
30 
31 #include "INewPageItemCmdData.h"
32 #include "TransformTypes.h" // CoordinateSpace
33 #include "PMPathPoint.h"
34 #include "PMRect.h"
35 #include "UIDList.h"
36 
38 enum PMPageItemType {
40  kIsPoint,
42  kIsLine,
44  kIsSquare,
46  kIsRectangle,
48  kIsCircle,
50  kIsOval,
51  kIsEllipse = kIsOval,
53  kIsPoly,
55  kIsPath,
57  kIsCompoundPath,
59  kPMUnknownType
60 };
61 
62 class IPathGeometry;
63 class IHandleShape;
64 class IPathSelectionList;
66 class PathSelectionList;
67 class ITransform;
68 class IHierarchy;
69 
70 
74 class IPathUtils : public IPMUnknown
75 {
76 public:
77  enum { kDefaultIID = IID_IPATHUTILS };
78 
84 
102  (
103  const UIDRef& parent,
104  PMRect& boundsRect,
106  ClassID itemClass,
107  bool16 bAllowDefaultStandOff = kTrue,
108  const Transform::CoordinateSpace &boundsSpace = Transform::PasteboardCoordinates(),
110  ) const = 0;
111 
128  (
129  const UIDRef& parent,
130  PMRect& boundsRect,
132  bool16 bAllowDefaultStandOff = kTrue,
133  const Transform::CoordinateSpace &boundsSpace = Transform::PasteboardCoordinates()
134  ) const = 0;
135 
151  virtual UIDRef CreateOvalSpline
152  (
153  const UIDRef& parent,
154  PMRect& boundsRect,
156  bool16 bAllowDefaultStandOff = kTrue,
157  const Transform::CoordinateSpace &boundsSpace = Transform::PasteboardCoordinates()
158  ) const = 0;
159 
175  virtual UIDRef CreateLineSpline
176  (
177  const UIDRef& parent,
178  const PMPointList& pathPoints,
180  bool16 bAllowDefaultStandOff = kTrue,
181  const Transform::CoordinateSpace &boundsSpace = Transform::PasteboardCoordinates()
182  ) const = 0;
183 
200  virtual UIDRef CreateSpline
201  (
202  const UIDRef& parent,
203  const PMPathPointList& pathPointList,
205  bool16 bAllowDefaultStandOff = kTrue,
206  bool16 bClosedPath = kTrue,
207  const Transform::CoordinateSpace &boundsSpace = Transform::PasteboardCoordinates()
208  ) const = 0;
209 
229  (
230  const UIDRef& parent,
231  PMRect& boundsRect,
232  int32 numSides,
233  int32 starInset,
235  bool16 bAllowDefaultStandOff = kTrue,
236  const Transform::CoordinateSpace &boundsSpace = Transform::PasteboardCoordinates()
237  ) const = 0;
239 
246  virtual void MakeLinePath
247  (
248  IPathGeometry* iPathGeometry,
249  const PMPointList& pathPoints
250  ) const = 0;
251 
252 
257  virtual void MakeRectanglePath
258  (
259  IPathGeometry* iPathGeometry,
260  const PMRect& boundsRect
261  ) const = 0;
262 
267  virtual void MakeOvalPath
268  (
269  IPathGeometry* iPathGeometry,
270  const PMRect& boundsRect
271  ) const = 0;
272 
280  virtual void MakeRegPolyPath
281  (
282  IPathGeometry* iPathGeometry,
283  const PMRect& boundsRect,
284  int32 numSides,
285  int32 starInset
286  ) const = 0;
287 
293  virtual void MakeSplinePath
294  (
295  IPathGeometry* iPathGeometry,
296  const PMPathPointList& pathPointList,
297  bool16 bClosePath = kTrue
298  ) const = 0;
299 
306  virtual void MakeUnitCirclePolygon
307  (
308  PMPointList& polyPts,
309  int32 numSides,
310  int32 starInset
311  ) const = 0;
312 
314 
324  virtual bool16 CalculateDirectionPoints(const IPathGeometry* iPathGeometry, const PMPathPoint& thePoint, const int32 pathIndex, const int32 pointIndex, PMPoint& leftDirPt, PMPoint& rightDirPt) const = 0;
325 
328 
333  virtual bool16 IsSquare( const IPathGeometry* iPathGeometry ) const = 0;
334 
339  virtual bool16 IsRectangle( const IPathGeometry* iPathGeometry ) const = 0;
340 
345  virtual bool16 IsPoint( const IPathGeometry* iPathGeometry ) const = 0;
346 
351  virtual bool16 IsLine( const IPathGeometry* iPathGeometry ) const = 0;
352 
357  virtual bool16 IsOval( const IPathGeometry* iPathGeometry ) const = 0;
358 
363  virtual bool16 IsCircle( const IPathGeometry* iPathGeometry ) const = 0;
364 
369  virtual bool16 IsPolygon( const IPathGeometry* iPathGeometry ) const = 0;
370 
375  virtual bool16 IsCompoundPath( const IPathGeometry* iPathGeometry ) const = 0;
376 
383  virtual PMPageItemType WhichKindOfPageItem( const IPathGeometry* iPathGeometry ) const = 0;
385 
386 
394  virtual void AppendPathPointSelectors( IPathGeometry* pathGeom, int32 pathIndex, PointSelectorList& pts ) const = 0;
395 
400  virtual void AppendAllPathPointSelectors( IPathGeometry* pathGeom, PointSelectorList& pts ) const = 0;
401 
406  virtual bool16 IsPathSelectable( const IPMUnknown* pageItem ) const = 0;
407 
412  virtual bool16 IsPathSelectable( const UIDRef& pageItem ) const = 0;
413 
420  virtual void AppendNonPathSelectables( const UIDList& selectionList, UIDList& itemList ) const = 0;
421 
427  virtual void FilterUnselectedPathObjects( const IPathSelectionSuite* pathSelectionSuite, UIDList& itemList ) const = 0;
428 
432  virtual void FilterNonPathSelectables( UIDList& itemList ) const = 0;
433 
439  virtual bool16 AllPointsOnObjectSelected( IPathSelectionList* pathSelectionList, IPathGeometry* pathGeom ) const = 0;
440 
447  //virtual bool16 AllPointsOnPathSelected( IPathSelectionList* pathSelectionList, IPathGeometry* pathGeom, int32 pathIndex ) const = 0;
448 
449  virtual bool16 AllPointsOnObjectSelected( IPathGeometry* pathGeom, const PointSelectorList& pts ) const = 0;
450  virtual bool16 AllPointsOnPathSelected( IPathGeometry* pathGeom, int32 pathIndex, const PointSelectorList& pts ) const = 0;
451 
453 
456 
461  virtual PMRect GetPolyPathBBox
462  (
463  const PMPointList& polyPts
464  ) const = 0;
465 
472  (
473  bool16 tryPathHandleShape,
474  const UIDRef& item
475  ) const = 0;
476 
483  (
484  bool16 tryPathHandleShape,
485  IPMUnknown* iUnknown
486  ) const = 0;
487 
492  virtual bool16 IsAnyPathOpen( const IPathGeometry* iPathGeometry ) const = 0;
493 
499  virtual bool16 IsValidSelector( const IPathGeometry* pathGeom, const PointSelector& handle ) const = 0;
500 
508  virtual PMRect::PointIndex GetVisualPointIndex(const PointSelector& controlPtIndex, ITransform* itemTransform) const = 0;
509 
515  virtual void GetPathSelectableUIDList(UIDList* resultList, IHierarchy* hierarchy) = 0;
517 };
518 
519 
520 #endif // __IPathUtils__