IAnnot.h
1 
14 #pragma once
15 #include "AnnotTypeDefine.h"
16 
17 
18 namespace foxit
19 {
20  namespace rdk
21  {
22  namespace uiextensions
23  {
24  //Annot property
25  public interface class IAnnotSettingImplementor
26  {
27  int GetAnnotDrawBorderWidth();
28 
29  void UpdateSaveCommandVisible();
30  void SavePropertySetting();
31 
32  void SetAnnotDrawBorderWidth(int linewidth);
33 
34  void SetNoteLogoUrl(Platform::String^ url);
35  Platform::String^ GetNoteLogoUrl();
36 
37  void SetNoteAuthor(Platform::String^ authorName);
38  Platform::String^ GetNoteAuthor();
39 
40  void SetIsLinkHighlight(bool isHighlight);
41  bool GetIsLinkHighlight();
42 
43  void SetViewIsDarkMode(Platform::String^ isDarkMode);
44  Platform::String^ GetViewIsDarkMode();
45 
46  void SetIsFirstUserAnnot(bool isFirstUserAnnot);
47  bool GetIsFirstUserAnnot();
48 
49  Windows::UI::Color GetAnnotColor();
50  void SetAnnotColor(Windows::UI::Color value);
51 
52  double GetAnnotOpacity();
53  void SetAnnotOpacity(double value);
54 
55  Windows::UI::Color GetHightLightAnnotColor();
56  void SetHightLightAnnotColor(Windows::UI::Color value);
57 
58  double GetHightLightAnnotOpacity();
59  void SetHightLightAnnotOpacity(double value);
60 
61  Windows::UI::Color GetUnderLineAnnotColor();
62  void SetUnderLineAnnotColor(Windows::UI::Color value);
63 
64  double GetUnderLineAnnotOpacity();
65  void SetUnderLineAnnotOpacity(double value);
66 
67  Windows::UI::Color GetStrikeOutAnnotColor();
68  void SetStrikeOutAnnotColor(Windows::UI::Color value);
69 
70  double GetStrikeOutAnnotOpacity();
71  void SetStrikeOutAnnotOpacity(double value);
72 
73  Windows::UI::Color GetSquigglyAnnotColor();
74  void SetSquigglyAnnotColor(Windows::UI::Color value);
75 
76  double GetSquigglyAnnotOpacity();
77  void SetSquigglyAnnotOpacity(double value);
78 
79  Windows::UI::Color GetLineAnnotColor();
80  void SetLineAnnotColor(Windows::UI::Color value);
81 
82  int GetEraserWidth();
83  void SetEraserWidth(int value);
84 
85  int GetStampIndex();
86  void SetStampIndex(int value);
87 
88  bool GetHightLightIsContinueOpera();
89  void SetHightLightIsContinueOpera(bool value);
90 
91  bool GetAreaHightLightIsContinueOpera();
92  void SetAreaHightLightIsContinueOpera(bool value);
93 
94  bool GetStrikeOutIsContinueOpera();
95  void SetStrikeOutIsContinueOpera(bool value);
96 
97  bool GetUnderLineIsContinueOpera();
98  void SetUnderLineIsContinueOpera(bool value);
99 
100  bool GetSquigglyIsContinueOpera();
101  void SetSquigglyIsContinueOpera(bool value);
102 
103  bool GetTextIsContinueOpera();
104  void SetTextIsContinueOpera(bool value);
105 
106  bool GetLineIsContinueOpera();
107  void SetLineIsContinueOpera(bool value);
108 
109  bool GetArrowIsContinueOpera();
110  void SetArrowIsContinueOpera(bool value);
111 
112  bool GetSquareIsContinueOpera();
113  void SetSquareIsContinueOpera(bool value);
114 
115  bool GetCircleIsContinueOpera();
116  void SetCircleIsContinueOpera(bool value);
117 
118  bool GetStampIsContinueOpera();
119  void SetStampeIsContinueOpera(bool value);
120 
121  bool GetFreeTextIsContinueOpera();
122  void SetFreeTextIsContinueOpera(bool value);
123 
124  Windows::UI::Color GetFreeTextColor();
125  void SetFreeTextColor(Windows::UI::Color value);
126 
127  double GetFreeTextAnnotOpacity();
128  void SetFreeTextAnnotOpacity(double value);
129 
130  int GetFreeTextFontSize();
131  void SetFreeTextFontSize(int value);
132 
133  Platform::String^ GetFreeTextFontName();
134  void SetFreeTextFontName(Platform::String^ value);
135 
136  void SetIsFirstUserTip(bool isFirstUserTip);
137  bool GetIsFirstUserTip();
138 
139  bool GetInsertTextIsContinueOpera();
140  void SetInsertTextIsContinueOpera(bool value);
141 
142  Windows::UI::Color GetInsertTextColor();
143  void SetInsertTextColor(Windows::UI::Color value);
144 
145  double GetInsertTextAnnotOpacity();
146  void SetInsertTextAnnotOpacity(double value);
147 
148  Windows::UI::Color GetReplaceTextColor();
149  void SetReplaceTextColor(Windows::UI::Color value);
150 
151  double GetReplaceTextAnnotOpacity();
152  void SetReplaceTextAnnotOpacity(double value);
153 
154  bool GetReplaceTextIsContinueOpera();
155  void SetReplaceTextIsContinueOpera(bool value);
156  };
157 
158  ref class PDFPageWrapper
159  {
160  internal:
161  Platform::Object^ Pointer;
162  };
163 
164  ref class PDFAnnotWrapper
165  {
166  internal:
167  Platform::Object^ Pointer;
168  };
169 
171  {
172  internal:
173  Platform::Object^ Pointer;
174  };
175 
176  public ref class PDFAnnotHandle sealed
177  {
178  public:
179  property Platform::Object^ PDFAnnot
180  {
181  Platform::Object^ get()
182  {
183  PDFAnnotWrapper^ wrap = ref new PDFAnnotWrapper;
184  wrap->Pointer = _PdfAnnot;
185  return wrap;
186  }
187  }
188 
189  internal:
191  {
192 
193  }
194  PDFAnnotHandle(foxit::pdf::annots::Annot^ pdfannot)
195  {
196  _PdfAnnot = pdfannot;
197  }
198 
199  property foxit::pdf::annots::Annot^ PDF_Annot
200  {
201  foxit::pdf::annots::Annot^ get()
202  {
203  return _PdfAnnot;
204  }
205  void set(foxit::pdf::annots::Annot^ value)
206  {
207  _PdfAnnot = value;
208  }
209  }
210 
211  private:
212  foxit::pdf::annots::Annot^ _PdfAnnot;
213  };
214 
215  interface class IAnnotManager;
216  [Windows::Foundation::Metadata::WebHostHidden]
217  public interface class IBaseAnnot
218  {
219  public:
220  property int PageIndex
221  {
222  int get();
223  }
224 
225  property int AnnoIndex
226  {
227  int get();
228  }
229 
230  property Platform::String^ Name
231  {
232  Platform::String^ get();
233  void set(Platform::String^ value);
234  }
235 
236  property Platform::String^ Title
237  {
238  Platform::String^ get();
239  void set(Platform::String^ value);
240  }
241 
242  property Platform::String^ Contents
243  {
244  Platform::String^ get();
245  void set(Platform::String^ value);
246  }
247 
248  property Windows::UI::Color Color
249  {
250  Windows::UI::Color get();
251  void set(Windows::UI::Color value);
252  }
253 
254  property double Opacity
255  {
256  double get();
257  void set(double value);
258  }
259 
260  property Windows::Foundation::Rect MinRect
261  {
262  Windows::Foundation::Rect get();
263  void set(Windows::Foundation::Rect value);
264  }
265 
266  property AnnotBorderWrap^ AnnotBorder
267  {
268  AnnotBorderWrap^ get();
269  void set(AnnotBorderWrap^ value);
270  }
271 
272  property double BorderWidth
273  {
274  double get();
275  void set(double value);
276  }
277 
278  property Windows::Foundation::DateTime CreationDateTime
279  {
280  Windows::Foundation::DateTime get();
281  void set(Windows::Foundation::DateTime value);
282  }
283 
284  property Windows::Foundation::DateTime ModifiedDateTime
285  {
286  Windows::Foundation::DateTime get();
287  void set(Windows::Foundation::DateTime value);
288  }
289 
290  property AnnotationType AnnotType
291  {
292  AnnotationType get();
293  }
294 
295  property IAnnotManager^ AnnotMgr
296  {
297  IAnnotManager^ get();
298  }
299 
300  property bool IsModifyProperty
301  {
302  bool get();
303  void set(bool isModify);
304  }
305 
306 
307  property Platform::Object^ PageHandleWrap
308  {
309  Platform::Object^ get();
310  }
311 
312  property PDFAnnotHandle^ AnnotHandleWrap
313  {
314  PDFAnnotHandle^ get();
315  }
316 
318  virtual bool IsVisibity();
320  virtual bool IsHitTest(Windows::Foundation::Point pagePoint);
322  bool IsHitTestRange(Windows::Foundation::Point pagePoint);
324  [Windows::Foundation::Metadata::DefaultOverload]
325  bool OnLoadAnnot(IAnnotManager^ annotmgr, Platform::Object^ pageObj, int annotIndex);
326  bool OnLoadAnnot(IAnnotManager^ annotmgr, Platform::Object^ pageObj, PDFAnnotHandle^ annot);
328  bool OnCreate(IAnnotManager^ annotmgr, Platform::Object^ pageObj);
330  bool OnDelete();
331  bool OnDeleteNoReflesh();
333  bool SetSelectedState(bool bIsShow);
334 
335  void SetAnnotVisible(bool isVisible);
336  void CheckPageIndex();
337  };
338 
339 
340  [Windows::Foundation::Metadata::WebHostHidden]
341  public interface class IBaseAnnotEventPeer
342  {
343  void OnPointerPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
344  void OnPointerMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
345  void OnPointerReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
346  void OnTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
347  void OnRightTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::RightTappedRoutedEventArgs^ e);
348  void OnManipulationStarted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs^ e);
349  void OnManipulationDelta(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs^ e);
350  void OnManipulationCompleted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^ e);
351  void OnManipulationInertiaStarting(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationInertiaStartingRoutedEventArgs^ e);
352 
353  void OnCreateAnnotAfterSelectText();
354  };
355 
356  [Windows::Foundation::Metadata::WebHostHidden]
357  public interface class IBaseAnnotHandler
358  {
359  public:
360  property AnnotationType AnnotHandlerType
361  {
362  AnnotationType get();
363  }
364  property IAnnotManager^ AnnotMgr
365  {
366  IAnnotManager^ get();
367  }
368  property IBaseAnnotEventPeer^ AnnotEvent
369  {
370  IBaseAnnotEventPeer^ get();
371  }
372 
373  public:
374  IBaseAnnotEventPeer^ OnCreateEventPeer();
375  void SetEventPeer(IBaseAnnotEventPeer^ peer);
376  void SetAnnotMgr(IAnnotManager^ manager);
377  bool IsHitTest(IBaseAnnot^ pAnnot, Windows::Foundation::Point ptDevice);
378  void ClearSelectedBorder();
379  void CancelDrawingOneStep();
380  void EndConsistentDrawing();
381  void EndDrawing();
382  void Reset();
383 
384  public:
386  [Windows::Foundation::Metadata::DefaultOverload]
387  void OnCreateNewAnnot(Platform::Object^ pageObj, int annotIndex);
388  void OnCreateNewAnnot(Platform::Object^ pageObj, IBaseAnnot^ newannot);
390  IBaseAnnot^ OnLoadAnnot(Platform::Object^ pageObj, PDFAnnotHandle^ annot);
392  bool OnDelete(IBaseAnnot^ pAnnot);
394  bool OnRelease(IBaseAnnot^ pAnnot);
395 
397  bool OnVisible(IBaseAnnot^ pAnnot);
399  bool OnHidden(IBaseAnnot^ pAnnot);
401  bool OnPrint(IBaseAnnot^ pAnnot);
402 
403  void OnMoving(IBaseAnnot^ pAnnot);
404  void OnMoved(IBaseAnnot^ pAnnot);
405  void CanecelMoving(IBaseAnnot^ pAnnot);
406  void OnMoveOutOfPage(IBaseAnnot^ pAnnot);
407  bool OnResizing(IBaseAnnot^ pAnnot);
408  void OnPopupMenu(IBaseAnnot^ pAnnot, Windows::Foundation::Point point);
409  void OnDoAnnotAction(IBaseAnnot^ pAnnot, Windows::Foundation::Point curPoint);
410 
411  void CreateAnnotAfterSelectText();
412  void OnCreateNewAnnotGroup(Platform::Object^ pageObj, Windows::Foundation::Collections::IVector<IBaseAnnot^>^ newannots);
413 
414  public:
415  void OnPointerPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
416  void OnPointerMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
417  void OnPointerReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
418  void OnTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
419  void OnRightTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::RightTappedRoutedEventArgs^ e);
420  void OnManipulationStarted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs^ e);
421  void OnManipulationDelta(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs^ e);
422  void OnManipulationCompleted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^ e);
423  void OnManipulationInertiaStarting(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationInertiaStartingRoutedEventArgs^ e);
424  };
425 
426  [Windows::Foundation::Metadata::WebHostHidden]
427  public interface class IAnnotManagerPeer
428  {
429  int GetPageCount();
430  Platform::Object^ GetPdfPageObject(int pageIndex);
431  void NotifyDocumentChanged();
432  void UpdatePageView(int pageIndex);
433 
434  void SaveAnonotModifyBeforeProperty();
435  void InsertAnnotModifyUndo();
436 
437  void OnAnnotPointerEntered(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
438  void OnAnnotPointerExited(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
439  void OnAnnotPointerMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
440  void OnAnnotPointerPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
441  void OnAnnotPointerReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
442  void OnAnnotTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
443  void OnAnnotRightTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::RightTappedRoutedEventArgs^ e);
444 
445  void OnAnnotManipulationStarted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs^ e);
446  void OnAnnotManipulationDelta(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs^ e);
447  void OnAnnotManipulationCompleted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^ e);
448  void OnManipulationInertiaStarting(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationInertiaStartingRoutedEventArgs^ e);
449  };
450 
451 
452  [Windows::Foundation::Metadata::WebHostHidden]
453  public interface class IAnnotManager
454  {
455  void OnCreate(IAnnotManagerPeer^ annotPeer);
456  bool OnLoaded();
457  void OnDelete();
458  void AddAnnot(IBaseAnnot^ annot);
459  void DeleteAnnot(IBaseAnnot^ annot);
460  void ClearAnnots(int nPageIndex);
462  void OnCreateNewAnnot(Platform::Object^ pageObj, IBaseAnnot^ newannot);
464  IBaseAnnot^ OnLoadAnnot(Platform::Object^ pageObj, PDFAnnotHandle^ annot);
465 
466  void NotifyDocumentChanged();
467  void UpdatePageView(int pageindex);
468  void OnInitAnnot(int nPageindex);
469  void ReInitAnnot(int nPageinex);
470  void FinalizeAnnots(int nPageIndex);
471  IBaseAnnotHandler^ GetAnnotHandlerByType(AnnotationType type);
473  void OnPointerEntered(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
475  void OnPointerExited(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
477  void OnPointerMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
479  void OnPointerPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
481  void OnPointerReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
483  void OnTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e);
485  void OnRightTapped(Platform::Object^ sender, Windows::UI::Xaml::Input::RightTappedRoutedEventArgs^ e);
487  void OnManipulationStarted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationStartedRoutedEventArgs^ e);
489  void OnManipulationDelta(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationDeltaRoutedEventArgs^ e);
491  void OnManipulationCompleted(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationCompletedRoutedEventArgs^ e);
493  void OnManipulationInertiaStarting(Platform::Object^ sender, Windows::UI::Xaml::Input::ManipulationInertiaStartingRoutedEventArgs^ e);
494 
495  void RefleshOnePageAnnots(int nPageIndex);
496  IBaseAnnot^ IsHitAnnot(int index, Windows::Foundation::Point ptDevice);
497  Windows::Foundation::Collections::IVector<IBaseAnnot^>^ IsHitInkAnnot(int index, Windows::Foundation::Point ptDevice);
498  IBaseAnnot^ GetAnnotHitPoint(int index, Windows::Foundation::Point pagePt);
499  Windows::Foundation::Collections::IVector<IBaseAnnot^>^ GetAnnotsHitPoint(int index, Windows::Foundation::Point pagePt);
500  Windows::Foundation::Collections::IVector<PDFAnnotHandle^>^ GetDrawingAnnots(int pageindex);
501 
502  IAnnotSettingImplementor^ GetAnnotSetting();
503  void SetAnnotSetting(IAnnotSettingImplementor^ pSettingPageview);
504  IBaseAnnot^ GetSelectedAnnot();
505  void SetSelectedAnnot(IBaseAnnot^ annot);
506  void SetPdfSelectAnnotNull();
507  void EndDrawing();
508 
509  Windows::Foundation::Collections::IVector<IBaseAnnot^>^ GetPageNotes(int pageIndex);
510  Windows::Foundation::Collections::IVector<IBaseAnnot^>^ GetPageWidgetAnnots(int pageIndex);
511  void UpdateNoteRect(int pageIndex, Windows::Foundation::Rect rect);
512  void SetNewCreateAnnot(Windows::Foundation::Rect rect);
513  Windows::Foundation::Rect GetNewCreateAnnotRect();
514  void ClearResource();
515 
516  void UpdateAnnotMinRect(int pageIndex, AnnotationType type, Windows::Foundation::Rect oldrect, Windows::Foundation::Rect minrect);
517 
518  void AnnotCollections_CritsecLock();
519  void AnnotCollections_CritsecUnLock();
520 
521  void OnCreateNewAnnotGroup(Platform::Object^ pageObj, Windows::Foundation::Collections::IVector<IBaseAnnot^>^ newannots);
522 
523  bool IsGetGroupAnnotElement(int pageIndex, Windows::Foundation::Rect minrect, int annotIndex, AnnotationType groupAnnotType);
524  IBaseAnnot^ GetGroupAnnot();
525  void SetGroupAnnotNullptr();
526 
527  void DeleteAnnotCollection(int pageIndex);
528  void InsertModifyAnnotBeforeDelete();
529 
530  [Windows::Foundation::Metadata::DefaultOverload]
531  void ChangePageIndex(int srcIndex, int dstIndex);
532  void ChangePageIndex(Windows::Foundation::Collections::IVector<int>^ srcIndexs, int dstIndex);
533  void PageDeleteBefore(Windows::Foundation::Collections::IVector<int>^ pageIndexs);
534  void PageDeleteAfter(Windows::Foundation::Collections::IVector<int>^ pageIndexs);
535  void CheckPageIndex(int startIndex, int increasingCount);
536 
537  void OnNotifyAnnotModify(IBaseAnnot^ pAnnot);
538  void LockViewCtrl();
539  void UnlockViewCtrl();
540 
541  event Windows::Foundation::EventHandler<IBaseAnnot^>^ AddAnnotEvent;
542  event Windows::Foundation::EventHandler<IBaseAnnot^>^ DeleteAnnotEvent;
543  event Windows::Foundation::EventHandler<IBaseAnnot^>^ ModifyAnnotEvent;
544  };
545  }
546  }
547 }
Definition: FoxitRdkComponentViewCtrl.h:3
Definition: IAnnot.h:217

Foxit Software Corporation Logo
@2017 Foxit Software Incorporated. All rights reserved.