OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_ | 7 #ifndef FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_ |
8 #define FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_ | 8 #define FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_ |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 260 |
261 public: | 261 public: |
262 void AttachDoc(CPDFSDK_Document* pDoc); | 262 void AttachDoc(CPDFSDK_Document* pDoc); |
263 CPDFSDK_Document* GetReaderDoc(); | 263 CPDFSDK_Document* GetReaderDoc(); |
264 static FX_BOOL ExtractFileName(CPDFSDK_Document* pDoc, | 264 static FX_BOOL ExtractFileName(CPDFSDK_Document* pDoc, |
265 CFX_ByteString& strFileName); | 265 CFX_ByteString& strFileName); |
266 static FX_BOOL ExtractFolderName(CPDFSDK_Document* pDoc, | 266 static FX_BOOL ExtractFolderName(CPDFSDK_Document* pDoc, |
267 CFX_ByteString& strFolderName); | 267 CFX_ByteString& strFolderName); |
268 void AddDelayData(CJS_DelayData* pData); | 268 void AddDelayData(CJS_DelayData* pData); |
269 void DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex); | 269 void DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex); |
270 void AddDelayAnnotData(CJS_AnnotObj* pData); | |
271 void DoAnnotDelay(); | |
272 void SetIsolate(v8::Isolate* isolate) { m_isolate = isolate; } | 270 void SetIsolate(v8::Isolate* isolate) { m_isolate = isolate; } |
273 CJS_Document* GetCJSDoc() const; | 271 CJS_Document* GetCJSDoc() const; |
274 | 272 |
275 private: | 273 private: |
276 CFX_WideString ReversalStr(CFX_WideString cbFrom); | 274 CFX_WideString ReversalStr(CFX_WideString cbFrom); |
277 CFX_WideString CutString(CFX_WideString cbFrom); | 275 CFX_WideString CutString(CFX_WideString cbFrom); |
278 bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect); | 276 bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect); |
279 int CountWords(CPDF_TextObject* pTextObj); | 277 int CountWords(CPDF_TextObject* pTextObj); |
280 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex); | 278 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex); |
281 | 279 |
282 v8::Isolate* m_isolate; | 280 v8::Isolate* m_isolate; |
283 std::list<std::unique_ptr<IconElement>> m_IconList; | 281 std::list<std::unique_ptr<IconElement>> m_IconList; |
284 CPDFSDK_Document* m_pDocument; | 282 CPDFSDK_Document* m_pDocument; |
285 CFX_WideString m_cwBaseURL; | 283 CFX_WideString m_cwBaseURL; |
286 bool m_bDelay; | 284 bool m_bDelay; |
287 CFX_ArrayTemplate<CJS_DelayData*> m_DelayData; | 285 CFX_ArrayTemplate<CJS_DelayData*> m_DelayData; |
288 CFX_ArrayTemplate<CJS_AnnotObj*> m_DelayAnnotData; | |
289 }; | 286 }; |
290 | 287 |
291 class CJS_Document : public CJS_Object { | 288 class CJS_Document : public CJS_Object { |
292 public: | 289 public: |
293 explicit CJS_Document(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} | 290 explicit CJS_Document(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} |
294 ~CJS_Document() override {} | 291 ~CJS_Document() override {} |
295 | 292 |
296 // CJS_Object | 293 // CJS_Object |
297 void InitInstance(IJS_Runtime* pIRuntime) override; | 294 void InitInstance(IJS_Runtime* pIRuntime) override; |
298 | 295 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 JS_STATIC_METHOD(removeField, Document); | 363 JS_STATIC_METHOD(removeField, Document); |
367 JS_STATIC_METHOD(replacePages, Document); | 364 JS_STATIC_METHOD(replacePages, Document); |
368 JS_STATIC_METHOD(removeIcon, Document); | 365 JS_STATIC_METHOD(removeIcon, Document); |
369 JS_STATIC_METHOD(resetForm, Document); | 366 JS_STATIC_METHOD(resetForm, Document); |
370 JS_STATIC_METHOD(saveAs, Document); | 367 JS_STATIC_METHOD(saveAs, Document); |
371 JS_STATIC_METHOD(submitForm, Document); | 368 JS_STATIC_METHOD(submitForm, Document); |
372 JS_STATIC_METHOD(mailDoc, Document); | 369 JS_STATIC_METHOD(mailDoc, Document); |
373 }; | 370 }; |
374 | 371 |
375 #endif // FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_ | 372 #endif // FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_ |
OLD | NEW |