InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IGeometrySuite.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Michael Martz
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 // Note:
24 //
25 //========================================================================================
26 
27 #ifndef _IGeometrySuite_
28 #define _IGeometrySuite_
29 //________________________________________________________________________________________________
30 // INCLUDES
31 //________________________________________________________________________________________________
32 #include "IPMUnknown.h"
33 #include "ShuksanID.h"
34 #include "PMRect.h"
35 #include "PMPoint.h"
36 #include "TransformTypes.h"
37 #include "IReferencePointData.h"
38 
39 class PathInfo;
40 
45 class IGeometrySuite : public IPMUnknown
46 {
47 public:
48 
49  enum { kDefaultIID = IID_IGEOMETRYSUITE };
50 friend class GeometrySuiteASB;
51 
52  virtual Transform::CoordinateSpace DefaultMeasurementSpace() const = 0;
53  virtual Transform::CoordinateSpace DefaultBoundsSpace() const = 0;
54 
55 //protected:
56 
57  virtual int32 GetGeometryItemsCount() const = 0;
58 
62  virtual bool16 CanChangeSelectionHeight( const Transform::CoordinateSpace& boundsSpace) const = 0;
63 
67  virtual bool16 CanChangeSelectionWidth( const Transform::CoordinateSpace& boundsSpace) const = 0;
68 
72  virtual bool16 CanChangeSelectionSize( const Transform::CoordinateSpace& boundsSpace) const = 0;
73 
77  virtual bool16 CanChangeSelectionLength( const Transform::CoordinateSpace& boundsSpace) const = 0;
78 
83 public:
84  virtual bool16 SelectionIsAStraightLine(PathInfo *pathInfo) const = 0;
85 
90  virtual bool16 SelectionIsAPoint(PathInfo *pathInfo) const = 0;
91 //protected:
92 
96  virtual bool16 SelectionHasHeight( const Transform::CoordinateSpace& boundsSpace) const = 0;
97 
101  virtual bool16 SelectionHasWidth( const Transform::CoordinateSpace& boundsSpace) const = 0;
102 
106  virtual bool16 SelectionHasSize( const Transform::CoordinateSpace& boundsSpace) const = 0;
107 
108 
119  virtual void GetSelectionDimensions_( const Transform::CoordinateSpace& boundsSpace,
120  Geometry::BoundsKind boundsKind,
121  const Transform::CoordinateSpace& measurementSpace,
122  K2Vector<PMReal>* widths,
123  K2Vector<PMReal>* heights,
124  bool32 *itemsHaveWidth,
125  bool32 *itemsHaveHeight ) const = 0;
126  virtual void GetSelectionDimensions_( Geometry::BoundsKind boundsKind,
127  const Transform::CoordinateSpace& measurementSpace,
128  K2Vector<PMReal>* widths,
129  K2Vector<PMReal>* heights,
130  bool32 *itemsHaveWidth,
131  bool32 *itemsHaveHeight ) const = 0;
132 
172  virtual ErrorCode ResizeSelection(
173  const Transform::CoordinateSpace& boundsSpace,
174  Geometry::BoundsKind boundsKind,
175  const Transform::TransformOrigin& referencePoint,
176  const Geometry::ResizeValue& newSize,
177  Transform::Target duplicate = Transform::OriginalItems()) = 0;
178 
179  virtual ErrorCode ResizeSelection(
180  Geometry::BoundsKind boundsKind,
181  const Transform::TransformOrigin& referencePoint,
182  const Geometry::ResizeValue& newSize,
183  Transform::Target duplicate = Transform::OriginalItems()) = 0;
184 
190  virtual void GetSelectionHeight( const Transform::CoordinateSpace& boundsSpace, Geometry::BoundsKind boundsKind, const Transform::CoordinateSpace& measurementSpace, K2Vector<PMReal>& results) const = 0;
191  virtual void GetSelectionHeight( Geometry::BoundsKind boundsKind, const Transform::CoordinateSpace& measurementSpace, K2Vector<PMReal>& results) const = 0;
192 
198  virtual void GetSelectionWidth( const Transform::CoordinateSpace& boundsSpace, Geometry::BoundsKind boundsKind, const Transform::CoordinateSpace& measurementSpace, K2Vector<PMReal>& results) const = 0;
199  virtual void GetSelectionWidth( Geometry::BoundsKind boundsKind, const Transform::CoordinateSpace& measurementSpace, K2Vector<PMReal>& results) const = 0;
200 
206  virtual void GetSelectionLength( const Transform::CoordinateSpace& boundsSpace, Geometry::BoundsKind boundsKind, const Transform::CoordinateSpace& measurementSpace, K2Vector<PMReal>& results) const = 0;
207  virtual void GetSelectionLength( Geometry::BoundsKind boundsKind, const Transform::CoordinateSpace& measurementSpace, K2Vector<PMReal>& results) const = 0;
208 
214  virtual void GetSelectionSize( const Transform::CoordinateSpace& boundsSpace, Geometry::BoundsKind boundsKind, const Transform::CoordinateSpace& measurementSpace, K2Vector<PMPoint>& results) const = 0;
215  virtual void GetSelectionSize( Geometry::BoundsKind boundsKind, const Transform::CoordinateSpace& measurementSpace, K2Vector<PMPoint>& results) const = 0;
216 
217 
222  virtual PMRect GetSelectionBounds( const Transform::CoordinateSpace& boundsSpace, Geometry::BoundsKind kind) const = 0;
223 
227 public:
228  virtual void GetSelectionPathInfo( PathInfo *pathInfo) const = 0;
229 
230 
231 
232 
233  inline bool16 CanChangeSelectionHeight() const
234  {
235  return CanChangeSelectionHeight( DefaultBoundsSpace());
236  }
237  inline bool16 CanChangeSelectionWidth() const
238  {
239  return CanChangeSelectionWidth( DefaultBoundsSpace());
240  }
241  inline bool16 CanChangeSelectionSize() const
242  {
243  return CanChangeSelectionSize( DefaultBoundsSpace());
244  }
245  inline bool16 CanChangeSelectionLength() const
246  {
247  return CanChangeSelectionLength( DefaultBoundsSpace());
248  }
249  inline bool16 SelectionHasHeight() const
250  {
251  return SelectionHasHeight( DefaultBoundsSpace());
252  }
253  inline bool16 SelectionHasWidth() const
254  {
255  return SelectionHasWidth( DefaultBoundsSpace());
256  }
257  inline bool16 SelectionHasSize() const
258  {
259  return SelectionHasSize( DefaultBoundsSpace());
260  }
261  inline void GetSelectionHeight( Geometry::BoundsKind boundsKind, K2Vector<PMReal>& results) const
262  {
263  return GetSelectionHeight( DefaultBoundsSpace(), boundsKind, DefaultMeasurementSpace(), results);
264  }
265  inline void GetSelectionWidth( Geometry::BoundsKind boundsKind, K2Vector<PMReal>& results) const
266  {
267  return GetSelectionWidth( DefaultBoundsSpace(), boundsKind, DefaultMeasurementSpace(), results);
268  }
269  inline void GetSelectionLength( Geometry::BoundsKind boundsKind, K2Vector<PMReal>& results) const
270  {
271  return GetSelectionLength( DefaultBoundsSpace(), boundsKind, DefaultMeasurementSpace(), results);
272  }
273  inline void GetSelectionSize( Geometry::BoundsKind boundsKind, K2Vector<PMPoint>& results) const
274  {
275  return GetSelectionSize( DefaultBoundsSpace(), boundsKind, DefaultMeasurementSpace(), results);
276  }
277  inline void GetSelectionDimensions_( Geometry::BoundsKind boundsKind, K2Vector<PMReal>* widths, K2Vector<PMReal>* heights, bool32 *itemsHaveWidth, bool32 *itemsHaveHeight) const
278  {
279  return GetSelectionDimensions_( DefaultBoundsSpace(), boundsKind, DefaultMeasurementSpace(), widths, heights, itemsHaveWidth, itemsHaveHeight);
280  }
281 
282 
283 };
284 
285 #endif // _IGeometrySuite_