00001 #ifndef __AICursorSnap__
00002 #define __AICursorSnap__
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 #ifndef __AITypes__
00029 #include "AITypes.h"
00030 #endif
00031 #ifndef __AIDocumentView__
00032 #include "AIDocumentView.h"
00033 #endif
00034 #ifndef __AITool__
00035 #include "AITool.h"
00036 #endif
00037 
00038 #include "AIHeaderBegin.h"
00039 
00042 
00043 
00044 
00045 
00046 
00047 
00048 #define kAICursorSnapSuite                              "AI Cursor Snap Suite"
00049 #define kAICursorSnapSuiteVersion16             AIAPI_VERSION(16)
00050 #define kAICursorSnapSuiteVersion               kAICursorSnapSuiteVersion16
00051 #define kAICursorSnapVersion                    kAICursorSnapSuiteVersion
00052 
00053 
00057 enum {
00059         kPointConstraint = 1,
00061         kLinearConstraintAbs,
00063         kLinearConstraintRel
00064 };
00065 
00066 
00069 
00070 #define kShiftConstraint                        (1<<0L)
00071 
00072 
00073 
00074 #define kDrawCustomAnnotations          (1<<1L)
00075 
00076 
00079 enum {
00080         kTranslateBoundaryEditor = 1
00081 };
00082 
00083 
00084 
00085 
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00093 struct AICustomAnnotationLine
00094 {
00095         AIRealPoint startPoint;
00096         AIRealPoint endPoint;
00097 };
00098 
00099 typedef AICustomAnnotationLine* AICustomAnnotationLinePtr;
00100 
00111 typedef AIErr(*CustomAnnotationsCallback)(ai::uint32 inId, const AIRealPoint& inSnappedPt, size_t* outNumberOfLines, AICustomAnnotationLine** outAnnotationLines);
00112 
00116 struct AICursorConstraint {
00124         ai::int32                                       kind;
00127         ai::int32                                       flags;
00129         AIRealPoint                                     point;
00131         AIReal                                          angle;
00133         ai::UnicodeString                       label;
00135         CustomAnnotationsCallback       getCustomAnnotationDetails;
00136 
00137         
00138         AICursorConstraint(const ai::int32 inKind,
00139                 const ai::int32 inFlags,
00140                 const AIRealPoint& inPoint,
00141                 const AIReal inAngle,
00142                 const ai::UnicodeString& inLabel,
00143                 const CustomAnnotationsCallback inCustomAnnotationsCallback) :
00144                         kind(inKind),
00145                         flags(inFlags),
00146                         point(inPoint),
00147                         angle(inAngle),
00148                         label(inLabel),
00149                         getCustomAnnotationDetails(inCustomAnnotationsCallback)
00150         {}
00151 
00152         AICursorConstraint() :
00153                 kind(0),
00154                 flags(0),
00155                 angle(kAIRealZero),
00156                 getCustomAnnotationDetails(NULL)
00157         {
00158                 point.h = kAIRealZero;
00159                 point.v = kAIRealZero;
00160         }
00161 
00162         
00163         ~AICursorConstraint() 
00164         {}
00165 };
00166 
00167 
00168 
00169 
00170 
00171 
00172 
00227 struct AICursorSnapSuite {
00228 
00235         AIAPI AIBoolean         (*UseSmartGuides)               (AIDocumentViewHandle view);
00236 
00240         AIAPI AIErr                     (*Reset)                                (void);
00241 
00245         AIAPI AIErr                     (*ClearCustom)                  (void);
00246 
00252         AIAPI AIErr(*SetCustom)                 (const ai::AutoBuffer<AICursorConstraint>& constraints);
00253 
00293         AIAPI AIErr                     (*Track)                                (AIDocumentViewHandle view, const AIRealPoint& srcpoint,
00294                                                                                                 const AIEvent* event, const char* control,
00295                                                                                                 AIRealPoint* dstpoint);
00296 
00333         AIAPI AIErr                     (*HitTrack)                             (AIDocumentViewHandle view, const AIRealPoint &srcpoint,
00334                                                                                                 const AIEvent* event, const char* control,
00335                                                                                                 AIRealPoint* dstpoint, AIBoolean magnifyAnchorPoint);
00336 
00337 
00381         AIAPI AIErr                     (*TrackInRect)                          (AIDocumentViewHandle view, const AIRealPoint& srcpoint,
00382                                                                                                         const AIEvent* event, const char* control,
00383                                                                                                         AIRealPoint* dstpoint, const AIRealRect* srcrect,
00384                                                                                                         AIRealRect* dstrect);
00385 };
00386 
00387 
00388 #include "AIHeaderEnd.h"
00389 
00390 
00391 #endif