InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ISnapToService.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Patrick Lau
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 // Purpose of Interface:
24 // Interface to service for providing snap on support inside a spread when a
25 // page item is moved or resized.
26 //
27 //========================================================================================
28 
29 #ifndef __ISnapToService__
30 #define __ISnapToService__
31 
32 
33 #include "IPMUnknown.h"
34 #include "ISnapTo.h"
35 #include "IDocument.h"
36 #include "IControlView.h"
37 #include "ILayoutControlData.h"
38 
39 class ISnapToService : public IPMUnknown
40 {
41 public:
42  // Check the document and the current snap flags and see if
43  // we want to snap to this SnapTo service
44  //
45  virtual bool16 DoSnap(IDocument *document, SnapFlags flags) = 0;
46 
47  // Return a provider ranking to be used for determining the order of
48  // invocation
49  //
50  virtual PMReal GetProviderRanking() = 0;
51 
52  // Find the snap to point given the current point and view and report
53  // the type of snap found.
54  //
55  virtual SnapType FindSnapPoint(ISnapTo* snapTo, // Snap to interface
56  IControlView* theView, // View being snapped in
57  PMPoint& thePoint, // Point being snapped
58  const PMRect* theRect, // Rect being snapped (may be nil)
59  SnapType snapType, // How to snap the points
60  PMReal snapToZone, // Zone for snapping
61  ILayoutControlData* layoutData) = 0; // Current layout data
62 };
63 
64 #endif //__ISnapToService__