00001 #ifndef __AIAnnotatorDrawer__
00002 #define __AIAnnotatorDrawer__
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
00029 #ifndef __AITypes__
00030 #include "AITypes.h"
00031 #endif
00032
00033 #ifndef __AIPlugin__
00034 #include "AIPlugin.h"
00035 #endif
00036
00037 #include "AIDocumentView.h"
00038 #include "AIFont.h"
00039 #include "AIAGMTypes.h"
00040
00041 #include "AIHeaderBegin.h"
00042
00043
00044 #undef DrawText
00045
00049
00050
00051
00052
00053
00054
00055 #define kAIAnnotatorDrawerSuite "AI Annotator Drawer Suite"
00056 #define kAIAnnotatorDrawerSuiteVersion5 AIAPI_VERSION(5)
00057 #define kAIAnnotatorDrawerSuiteVersion kAIAnnotatorDrawerSuiteVersion5
00058 #define kAIAnnotatorDrawerVersion kAIAnnotatorDrawerSuiteVersion
00059
00060
00061
00062
00063
00064
00065
00066
00067 class AIAnnotatorDrawer;
00068
00072 enum AIHorizAlignment
00073 {
00074 kAILeft,
00075 kAICenter,
00076 kAIRight,
00077 kAIHorizDummy = 0xFFFFFFFF
00078 };
00079
00083 enum AIVertAlignment
00084 {
00085 kAITop,
00086 kAIMiddle,
00087 kAIBottom,
00088 kAIVertDummy = 0xFFFFFFFF
00089 };
00090
00094 enum AIAnnotatorFont
00095 {
00096 kAIAFSmall,
00097 kAIAFMedium,
00098 kAIAFLarge,
00099 kAIAFDummy = 0xFFFFFFFF
00100 };
00101
00106 enum AIAnnotatorPortOption
00107 {
00108 kAIOptionAAGraphics = 0x1,
00109 kDummyPortOption = 0x80000000
00110 };
00111
00112
00113
00114
00115
00116
00117
00120 #define kDashBufferTooShortError 'SHRT'
00121
00123 #define kNoStrokeParamsError 'NPRM'
00124
00126 #define kDashArrayTooBigError 'DBIG'
00127
00129 #define kNoDashError 'NDSH'
00130
00139 struct AIAnnotatorDrawerSuite
00140 {
00142
00143
00149 AIAPI void (*SetColor)(AIAnnotatorDrawer *drawer, const AIRGBColor &color);
00150
00157 AIAPI void (*GetColor)(AIAnnotatorDrawer *drawer, AIRGBColor &color);
00159
00161
00162
00167 AIAPI void (*SetLineWidth)(AIAnnotatorDrawer *drawer, const AIReal newWidth);
00173 AIAPI AIReal (*GetLineWidth)(AIAnnotatorDrawer *drawer);
00174
00181 AIAPI void (*SetLineDashed)(AIAnnotatorDrawer *drawer, AIBoolean dashed);
00188 AIAPI AIBoolean (*GetLineDashed)(AIAnnotatorDrawer *drawer);
00189
00195 AIAPI AIErr (*DrawLine)(AIAnnotatorDrawer *drawer, const AIPoint &start, const AIPoint &end);
00202 AIAPI AIErr (*DrawRect)(AIAnnotatorDrawer *drawer, const AIRect &rect, AIBoolean fill);
00203
00211 AIAPI AIErr (*DrawPolygon)(AIAnnotatorDrawer *drawer, const AIPoint points[], ai::uint32 numPoints, AIBoolean fill);
00212
00219 AIAPI AIErr (*DrawEllipse)(AIAnnotatorDrawer *drawer, const AIRect &rect, AIBoolean fill);
00220
00233 AIAPI AIErr (*DrawBezier)(AIAnnotatorDrawer *drawer, const AIPoint &start, const AIPoint pointSets[][3], ai::uint32 numPointSets, AIBoolean fill);
00234
00242 AIAPI AIErr (*SetLineDashedEx)(AIAnnotatorDrawer *drawer, AIFloat dashData[], ai::int32 numDashes);
00243
00250 AIAPI AIErr (*GetLineDashedEx)(AIAnnotatorDrawer *drawer, AIFloat dashData[], ai::int32 &numDashes);
00251
00253
00255
00256
00261 AIAPI AIErr (*DrawText)(AIAnnotatorDrawer *drawer, const ai::UnicodeString &text, const AIPoint &bottomLeft);
00262
00270 AIAPI AIErr (*DrawTextAligned)(AIAnnotatorDrawer *drawer, const ai::UnicodeString &text, const AIHorizAlignment horizAlign, const AIVertAlignment vertAlign, const AIRect &rect);
00271
00280 AIAPI AIErr (*GetTextBounds)(AIAnnotatorDrawer *drawer, const ai::UnicodeString &text, AIPoint *location, AIBoolean useFontFallback, AIRect &bounds);
00281
00286 AIAPI void (*SetFontSize)(AIAnnotatorDrawer *drawer, const AIReal size);
00287
00293 AIAPI AIReal (*GetFontSize)(AIAnnotatorDrawer *drawer);
00294
00299 AIAPI AIErr (*SetFontPreset)(AIAnnotatorDrawer *drawer, AIAnnotatorFont font);
00300
00305 AIAPI AIErr (*SetFontByFontKey)(AIAnnotatorDrawer *drawer, AIFontKey font);
00306
00313 AIAPI AIErr (*SetFontByName)(AIAnnotatorDrawer *drawer, const ai::UnicodeString &name);
00314
00321 AIAPI AIFontKey (*GetFontKey)(AIAnnotatorDrawer *drawer);
00322
00329 AIAPI void (*GetFontName)(AIAnnotatorDrawer *drawer, ai::UnicodeString &name);
00331
00333
00334
00343 AIAPI void (*DefineClipStart)(AIAnnotatorDrawer *drawer);
00344
00351 AIAPI void (*DefineClipEnd)(AIAnnotatorDrawer *drawer);
00352
00357 AIAPI void (*ClearClip)(AIAnnotatorDrawer *drawer);
00359
00361
00362
00368 AIAPI AIErr (*SetHighlightMode)(AIAnnotatorDrawer *drawer, AIBoolean highlightOn);
00369
00375 AIAPI AIBoolean (*GetHighlightMode)(AIAnnotatorDrawer *drawer);
00376
00382 AIAPI AIErr (*DrawPNGImage)(AIAnnotatorDrawer *drawer, const ai::uint8* inPNGImageData, ai::uint32 inDataSize, const AIPoint &topLeft);
00383
00389 AIAPI AIErr (*DrawPNGImageCentered)(AIAnnotatorDrawer *drawer, const ai::uint8* inPNGImageData, ai::uint32 inDataSize, const AIRect &rect);
00390
00396 AIAPI AIAGMPort* (*GetAGMPort)(AIAnnotatorDrawer *drawer);
00397
00402 AIAPI void (*ReleaseAGMPort)(AIAGMPort *&aiAGMPort);
00403
00413 AIAPI AIErr(*GetPortOptions)(AIAnnotatorDrawer* drawer, ai::uint32 whichOptions, ai::uint32 &options);
00414
00424 AIAPI AIErr(*SetPortOptions)( AIAnnotatorDrawer* drawer, ai::uint32 whichOptions, ai::uint32 options);
00425
00431 AIAPI AIErr (*SetOpacity)(AIAnnotatorDrawer* drawer, AIReal opacity);
00432
00439 AIAPI AIReal (*GetOpacity)(AIAnnotatorDrawer* drawer);
00440 };
00441
00442
00443 #include "AIHeaderEnd.h"
00444
00445
00446 #endif
00447