Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: fpdfsdk/src/javascript/Document.h

Issue 1566433003: Replace IconTree class with std::list. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix tests. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | fpdfsdk/src/javascript/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 #include <memory>
12
10 #include "JS_Define.h" 13 #include "JS_Define.h"
11 14
12 class PrintParamsObj : public CJS_EmbedObj { 15 class PrintParamsObj : public CJS_EmbedObj {
13 public: 16 public:
14 PrintParamsObj(CJS_Object* pJSObject); 17 PrintParamsObj(CJS_Object* pJSObject);
15 ~PrintParamsObj() override {} 18 ~PrintParamsObj() override {}
16 19
17 public: 20 public:
18 FX_BOOL bUI; 21 FX_BOOL bUI;
19 int nStart; 22 int nStart;
(...skipping 10 matching lines...) Expand all
30 CJS_PrintParamsObj(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} 33 CJS_PrintParamsObj(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
31 ~CJS_PrintParamsObj() override {} 34 ~CJS_PrintParamsObj() override {}
32 35
33 DECLARE_JS_CLASS(); 36 DECLARE_JS_CLASS();
34 }; 37 };
35 38
36 class Icon; 39 class Icon;
37 class Field; 40 class Field;
38 41
39 struct IconElement { 42 struct IconElement {
40 IconElement() : IconName(L""), NextIcon(NULL), IconStream(NULL) {} 43 IconElement(const CFX_WideString& name, Icon* stream)
41 virtual ~IconElement() {} 44 : IconName(name), IconStream(stream) {}
45
42 CFX_WideString IconName; 46 CFX_WideString IconName;
43 IconElement* NextIcon;
44 Icon* IconStream; 47 Icon* IconStream;
45 }; 48 };
46 49
47 class IconTree {
48 public:
49 IconTree() : m_pHead(NULL), m_pEnd(NULL), m_iLength(0) {}
50
51 virtual ~IconTree() {}
52
53 public:
54 void InsertIconElement(IconElement* pNewIcon);
55 void DeleteIconTree();
56 int GetLength();
57 IconElement* operator[](int iIndex);
58
59 private:
60 IconElement* m_pHead;
61 IconElement* m_pEnd;
62 int m_iLength;
63 };
64
65 struct CJS_DelayData; 50 struct CJS_DelayData;
66 struct CJS_DelayAnnot; 51 struct CJS_DelayAnnot;
67 struct CJS_AnnotObj; 52 struct CJS_AnnotObj;
68 53
69 class Document : public CJS_EmbedObj { 54 class Document : public CJS_EmbedObj {
70 public: 55 public:
71 Document(CJS_Object* pJSObject); 56 Document(CJS_Object* pJSObject);
72 ~Document() override; 57 ~Document() override;
73 58
74 public: 59 public:
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 CJS_Document* GetCJSDoc() const; 273 CJS_Document* GetCJSDoc() const;
289 274
290 private: 275 private:
291 CFX_WideString ReversalStr(CFX_WideString cbFrom); 276 CFX_WideString ReversalStr(CFX_WideString cbFrom);
292 CFX_WideString CutString(CFX_WideString cbFrom); 277 CFX_WideString CutString(CFX_WideString cbFrom);
293 bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect); 278 bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect);
294 int CountWords(CPDF_TextObject* pTextObj); 279 int CountWords(CPDF_TextObject* pTextObj);
295 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex); 280 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex);
296 281
297 v8::Isolate* m_isolate; 282 v8::Isolate* m_isolate;
298 IconTree* m_pIconTree; 283 std::list<std::unique_ptr<IconElement>> m_IconList;
299 CPDFSDK_Document* m_pDocument; 284 CPDFSDK_Document* m_pDocument;
300 CFX_WideString m_cwBaseURL; 285 CFX_WideString m_cwBaseURL;
301 bool m_bDelay; 286 bool m_bDelay;
302 CFX_ArrayTemplate<CJS_DelayData*> m_DelayData; 287 CFX_ArrayTemplate<CJS_DelayData*> m_DelayData;
303 CFX_ArrayTemplate<CJS_AnnotObj*> m_DelayAnnotData; 288 CFX_ArrayTemplate<CJS_AnnotObj*> m_DelayAnnotData;
304 }; 289 };
305 290
306 class CJS_Document : public CJS_Object { 291 class CJS_Document : public CJS_Object {
307 public: 292 public:
308 explicit CJS_Document(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} 293 explicit CJS_Document(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 JS_STATIC_METHOD(removeField, Document); 366 JS_STATIC_METHOD(removeField, Document);
382 JS_STATIC_METHOD(replacePages, Document); 367 JS_STATIC_METHOD(replacePages, Document);
383 JS_STATIC_METHOD(removeIcon, Document); 368 JS_STATIC_METHOD(removeIcon, Document);
384 JS_STATIC_METHOD(resetForm, Document); 369 JS_STATIC_METHOD(resetForm, Document);
385 JS_STATIC_METHOD(saveAs, Document); 370 JS_STATIC_METHOD(saveAs, Document);
386 JS_STATIC_METHOD(submitForm, Document); 371 JS_STATIC_METHOD(submitForm, Document);
387 JS_STATIC_METHOD(mailDoc, Document); 372 JS_STATIC_METHOD(mailDoc, Document);
388 }; 373 };
389 374
390 #endif // FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_ 375 #endif // FPDFSDK_SRC_JAVASCRIPT_DOCUMENT_H_
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/src/javascript/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698