Chromium Code Reviews| 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 CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 7 #ifndef CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
| 8 #define CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 8 #define CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
| 9 | 9 |
| 10 #include "../fpdfapi/fpdf_parser.h" | 10 #include "../fpdfapi/fpdf_parser.h" |
| 11 #include "../fpdfapi/fpdf_render.h" | 11 #include "../fpdfapi/fpdf_render.h" |
| 12 | 12 |
| 13 class CFieldTree; | |
| 14 class CPDF_AAction; | |
| 13 class CPDF_Action; | 15 class CPDF_Action; |
| 16 class CPDF_ActionFields; | |
| 14 class CPDF_Annot; | 17 class CPDF_Annot; |
| 15 class CPDF_AnnotList; | 18 class CPDF_AnnotList; |
| 19 class CPDF_ApSettings; | |
| 16 class CPDF_Bookmark; | 20 class CPDF_Bookmark; |
| 17 class CPDF_BookmarkTree; | 21 class CPDF_BookmarkTree; |
| 22 class CPDF_DefaultAppearance; | |
| 18 class CPDF_Dest; | 23 class CPDF_Dest; |
| 24 class CPDF_DocJSActions; | |
| 25 class CPDF_FileSpec; | |
| 26 class CPDF_FormControl; | |
| 27 class CPDF_FormField; | |
| 28 class CPDF_FormNotify; | |
| 29 class CPDF_IconFit; | |
| 30 class CPDF_InterForm; | |
| 19 class CPDF_Link; | 31 class CPDF_Link; |
| 20 class CPDF_LinkList; | 32 class CPDF_LinkList; |
| 33 class CPDF_LWinParam; | |
| 21 class CPDF_Metadata; | 34 class CPDF_Metadata; |
| 22 class CPDF_NameTree; | |
| 23 class CPDF_NumberTree; | 35 class CPDF_NumberTree; |
| 36 class CPDF_OCContext; | |
| 37 class CPDF_Page; | |
| 38 class CPDF_RenderOptions; | |
| 24 class CPDF_TextObject; | 39 class CPDF_TextObject; |
| 25 class CPDF_ViewerPreferences; | 40 class CPDF_ViewerPreferences; |
| 26 class CPDF_Page; | |
| 27 class CPDF_RenderOptions; | |
| 28 class CXML_Element; | 41 class CXML_Element; |
| 29 class CPDF_OCContext; | 42 |
| 30 class CPDF_DocJSActions; | 43 class CPDF_NameTree |
| 31 class CPDF_ActionFields; | |
| 32 class CPDF_AAction; | |
| 33 class CPDF_FileSpec; | |
| 34 class CPDF_IconFit; | |
| 35 class CPDF_DefaultAppearance; | |
| 36 class CPDF_InterForm; | |
| 37 class CPDF_FormField; | |
| 38 class CPDF_FormNotify; | |
| 39 class CPDF_FormControl; | |
| 40 class CPDF_LWinParam; | |
| 41 class CFieldTree; | |
| 42 class CPDF_ApSettings; | |
| 43 class CPDF_NameTree | |
| 44 { | 44 { |
| 45 public: | 45 public: |
| 46 | 46 |
| 47 CPDF_NameTree(CPDF_Dictionary* pRoot) | 47 CPDF_NameTree(CPDF_Dictionary* pRoot) |
| 48 { | 48 { |
| 49 m_pRoot = pRoot; | 49 m_pRoot = pRoot; |
| 50 } | 50 } |
| 51 | 51 |
| 52 CPDF_NameTree(CPDF_Document* pDoc, FX_BSTR category); | 52 CPDF_NameTree(CPDF_Document* pDoc, FX_BSTR category); |
| 53 | 53 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 64 | 64 |
| 65 CPDF_Dictionary* GetRoot() const | 65 CPDF_Dictionary* GetRoot() const |
| 66 { | 66 { |
| 67 return m_pRoot; | 67 return m_pRoot; |
| 68 } | 68 } |
| 69 | 69 |
| 70 protected: | 70 protected: |
| 71 | 71 |
| 72 CPDF_Dictionary* m_pRoot; | 72 CPDF_Dictionary* m_pRoot; |
| 73 }; | 73 }; |
| 74 class CPDF_BookmarkTree | 74 class CPDF_BookmarkTree |
| 75 { | 75 { |
| 76 public: | 76 public: |
| 77 CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {} | 77 CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {} |
| 78 | 78 |
| 79 CPDF_Bookmark GetFirstChild(const CPDF_Bookmark& parent) const ; | 79 CPDF_Bookmark GetFirstChild(const CPDF_Bookmark& parent) const ; |
| 80 | 80 |
| 81 CPDF_Bookmark GetNextSibling(const CPDF_Bookmark& bookmark) co nst; | 81 CPDF_Bookmark GetNextSibling(const CPDF_Bookmark& bookmark) co nst; |
| 82 | 82 |
| 83 CPDF_Document* GetDocument() const { return m_pDocument; } | 83 CPDF_Document* GetDocument() const { return m_pDocument; } |
| 84 | 84 |
| 85 protected: | 85 protected: |
| 86 CPDF_Document* m_pDocument; | 86 CPDF_Document* m_pDocument; |
| 87 }; | 87 }; |
| 88 #define PDFBOOKMARK_ITALIC 1 | 88 #define PDFBOOKMARK_ITALIC 1 |
| 89 #define PDFBOOKMARK_BOLD 2 | 89 #define PDFBOOKMARK_BOLD 2 |
| 90 class CPDF_Bookmark | 90 class CPDF_Bookmark |
| 91 { | 91 { |
| 92 public: | 92 public: |
| 93 | 93 |
| 94 CPDF_Bookmark() : m_pDict(NULL) {} | 94 CPDF_Bookmark() : m_pDict(NULL) {} |
| 95 | 95 |
| 96 explicit CPDF_Bookmark(CPDF_Dictionary* pDict) : m_pDict(pDict) {} | 96 explicit CPDF_Bookmark(CPDF_Dictionary* pDict) : m_pDict(pDict) {} |
| 97 | 97 |
| 98 CPDF_Dictionary* GetDict() const { return m_pDict; } | 98 CPDF_Dictionary* GetDict() const { return m_pDict; } |
| 99 | 99 |
| 100 operator bool() const { return m_pDict != NULL; } | 100 operator bool() const { return m_pDict != NULL; } |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 112 CPDF_Dictionary* m_pDict; | 112 CPDF_Dictionary* m_pDict; |
| 113 }; | 113 }; |
| 114 #define PDFZOOM_XYZ 1 | 114 #define PDFZOOM_XYZ 1 |
| 115 #define PDFZOOM_FITPAGE 2 | 115 #define PDFZOOM_FITPAGE 2 |
| 116 #define PDFZOOM_FITHORZ 3 | 116 #define PDFZOOM_FITHORZ 3 |
| 117 #define PDFZOOM_FITVERT 4 | 117 #define PDFZOOM_FITVERT 4 |
| 118 #define PDFZOOM_FITRECT 5 | 118 #define PDFZOOM_FITRECT 5 |
| 119 #define PDFZOOM_FITBBOX 6 | 119 #define PDFZOOM_FITBBOX 6 |
| 120 #define PDFZOOM_FITBHORZ 7 | 120 #define PDFZOOM_FITBHORZ 7 |
| 121 #define PDFZOOM_FITBVERT 8 | 121 #define PDFZOOM_FITBVERT 8 |
| 122 class CPDF_Dest | 122 class CPDF_Dest |
| 123 { | 123 { |
| 124 public: | 124 public: |
| 125 CPDF_Dest() : m_pObj(nullptr) { } | 125 CPDF_Dest() : m_pObj(nullptr) { } |
| 126 explicit CPDF_Dest(CPDF_Object* pObj) : m_pObj(pObj) { } | 126 explicit CPDF_Dest(CPDF_Object* pObj) : m_pObj(pObj) { } |
| 127 | 127 |
| 128 operator bool () const { return m_pObj != NULL; } | 128 operator bool () const { return m_pObj != NULL; } |
| 129 CPDF_Object* GetObject() const { return m_pObj; } | 129 CPDF_Object* GetObject() const { return m_pObj; } |
| 130 | 130 |
| 131 CFX_ByteString GetRemoteName(); | 131 CFX_ByteString GetRemoteName(); |
| 132 int GetPageIndex(CPDF_Document* pDoc); | 132 int GetPageIndex(CPDF_Document* pDoc); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 FX_BOOL GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromC onfig, int nLevel = 0); | 176 FX_BOOL GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromC onfig, int nLevel = 0); |
| 177 | 177 |
| 178 FX_BOOL LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL bFromConfig); | 178 FX_BOOL LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL bFromConfig); |
| 179 | 179 |
| 180 CPDF_Document *m_pDocument; | 180 CPDF_Document *m_pDocument; |
| 181 | 181 |
| 182 UsageType m_eUsageType; | 182 UsageType m_eUsageType; |
| 183 | 183 |
| 184 CFX_MapPtrTemplate<const CPDF_Dictionary*, void*> m_OCGStates; | 184 CFX_MapPtrTemplate<const CPDF_Dictionary*, void*> m_OCGStates; |
| 185 }; | 185 }; |
| 186 class CPDF_LWinParam | 186 class CPDF_LWinParam |
| 187 { | 187 { |
| 188 public: | 188 public: |
| 189 | 189 |
| 190 CPDF_LWinParam(CPDF_Dictionary* pDict) | 190 CPDF_LWinParam(CPDF_Dictionary* pDict) |
| 191 { | 191 { |
| 192 m_pDict = pDict; | 192 m_pDict = pDict; |
| 193 } | 193 } |
| 194 | 194 |
| 195 operator CPDF_Dictionary* () const | 195 operator CPDF_Dictionary* () const |
| 196 { | 196 { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 215 } | 215 } |
| 216 | 216 |
| 217 | 217 |
| 218 inline CFX_ByteString GetParameter() | 218 inline CFX_ByteString GetParameter() |
| 219 { | 219 { |
| 220 return m_pDict->GetString("P"); | 220 return m_pDict->GetString("P"); |
| 221 } | 221 } |
| 222 | 222 |
| 223 CPDF_Dictionary* m_pDict; | 223 CPDF_Dictionary* m_pDict; |
| 224 }; | 224 }; |
| 225 class CPDF_ActionFields | 225 class CPDF_ActionFields |
| 226 { | 226 { |
| 227 public: | 227 public: |
| 228 | 228 |
| 229 CPDF_ActionFields(const CPDF_Action* pAction) | 229 CPDF_ActionFields(const CPDF_Action* pAction) |
| 230 { | 230 { |
| 231 m_pAction = (CPDF_Action*)pAction; | 231 m_pAction = (CPDF_Action*)pAction; |
| 232 } | 232 } |
| 233 | 233 |
| 234 operator CPDF_Action*() const | 234 operator CPDF_Action*() const |
| 235 { | 235 { |
| 236 return m_pAction; | 236 return m_pAction; |
| 237 } | 237 } |
| 238 | 238 |
| 239 FX_DWORD GetFieldsCount() const; | 239 FX_DWORD GetFieldsCount() const; |
| 240 | 240 |
| 241 void GetAllFields(CFX_PtrArray& field Objects) const; | 241 void GetAllFields(CFX_PtrArray& field Objects) const; |
| 242 | 242 |
| 243 CPDF_Object* GetField(FX_DWORD iIndex) const; | 243 CPDF_Object* GetField(FX_DWORD iIndex) const; |
| 244 | 244 |
| 245 CPDF_Action* m_pAction; | 245 CPDF_Action* m_pAction; |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 #define PDFNAMED_NEXTPAGE 1 | 248 #define PDFNAMED_NEXTPAGE 1 |
| 249 #define PDFNAMED_PREVPAGE 2 | 249 #define PDFNAMED_PREVPAGE 2 |
| 250 #define PDFNAMED_FIRSTPAGE 3 | 250 #define PDFNAMED_FIRSTPAGE 3 |
| 251 #define PDFNAMED_LASTPAGE 4 | 251 #define PDFNAMED_LASTPAGE 4 |
| 252 #define PDFJS_MAXLENGTH 64 | 252 #define PDFJS_MAXLENGTH 64 |
| 253 class CPDF_Action | 253 class CPDF_Action |
| 254 { | 254 { |
| 255 public: | 255 public: |
| 256 enum ActionType { | 256 enum ActionType { |
| 257 Unknown = 0, | 257 Unknown = 0, |
| 258 GoTo, | 258 GoTo, |
| 259 GoToR, | 259 GoToR, |
| 260 GoToE, | 260 GoToE, |
| 261 Launch, | 261 Launch, |
| 262 Thread, | 262 Thread, |
| 263 URI, | 263 URI, |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 282 | 282 |
| 283 CPDF_Dictionary* GetDict() const { return m_pDict; } | 283 CPDF_Dictionary* GetDict() const { return m_pDict; } |
| 284 | 284 |
| 285 CFX_ByteString GetTypeName() const | 285 CFX_ByteString GetTypeName() const |
| 286 { | 286 { |
| 287 return m_pDict->GetString("S"); | 287 return m_pDict->GetString("S"); |
| 288 } | 288 } |
| 289 | 289 |
| 290 ActionType GetType() const; | 290 ActionType GetType() const; |
| 291 | 291 |
| 292 | |
| 293 | |
| 294 CPDF_Dest GetDest(CPDF_Document* pDoc) const; | 292 CPDF_Dest GetDest(CPDF_Document* pDoc) const; |
| 295 | 293 |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 CFX_WideString GetFilePath() const; | 294 CFX_WideString GetFilePath() const; |
| 301 | 295 |
| 302 | |
| 303 | |
| 304 | |
| 305 FX_BOOL GetNewWindow() const | 296 FX_BOOL GetNewWindow() const |
| 306 { | 297 { |
| 307 return m_pDict->GetBoolean("NewWindow"); | 298 return m_pDict->GetBoolean("NewWindow"); |
| 308 } | 299 } |
| 309 | 300 |
| 310 | |
| 311 | |
| 312 | |
| 313 CPDF_LWinParam GetWinParam() const; | 301 CPDF_LWinParam GetWinParam() const; |
| 314 | 302 |
| 315 | |
| 316 | |
| 317 | |
| 318 CFX_ByteString GetURI(CPDF_Document* pDoc) const; | 303 CFX_ByteString GetURI(CPDF_Document* pDoc) const; |
| 319 | 304 |
| 320 | |
| 321 | |
| 322 | |
| 323 FX_BOOL GetMouseMap() const | 305 FX_BOOL GetMouseMap() const |
| 324 { | 306 { |
| 325 return m_pDict->GetBoolean("IsMap"); | 307 return m_pDict->GetBoolean("IsMap"); |
| 326 } | 308 } |
| 327 | 309 |
| 328 | |
| 329 | |
| 330 | |
| 331 CPDF_ActionFields GetWidgets() const | 310 CPDF_ActionFields GetWidgets() const |
| 332 { | 311 { |
| 333 return this; | 312 return this; |
| 334 } | 313 } |
| 335 | 314 |
| 336 | |
| 337 | |
| 338 | |
| 339 FX_BOOL GetHideStatus() const | 315 FX_BOOL GetHideStatus() const |
| 340 { | 316 { |
| 341 return m_pDict->GetBoolean("H", TRUE); | 317 return m_pDict->GetBoolean("H", TRUE); |
| 342 } | 318 } |
| 343 | 319 |
| 344 | |
| 345 | |
| 346 | |
| 347 CFX_ByteString GetNamedAction() const | 320 CFX_ByteString GetNamedAction() const |
| 348 { | 321 { |
| 349 return m_pDict->GetString("N"); | 322 return m_pDict->GetString("N"); |
| 350 } | 323 } |
| 351 | 324 |
| 352 | |
| 353 | |
| 354 | |
| 355 FX_DWORD GetFlags() const | 325 FX_DWORD GetFlags() const |
| 356 { | 326 { |
| 357 return m_pDict->GetInteger("Flags"); | 327 return m_pDict->GetInteger("Flags"); |
| 358 } | 328 } |
| 359 | 329 |
| 360 | |
| 361 | |
| 362 | |
| 363 CFX_WideString GetJavaScript() const; | 330 CFX_WideString GetJavaScript() const; |
| 364 | 331 |
| 365 | |
| 366 | |
| 367 | |
| 368 CPDF_Dictionary* GetAnnot() const; | 332 CPDF_Dictionary* GetAnnot() const; |
| 369 | 333 |
| 370 | |
| 371 | |
| 372 | |
| 373 FX_INT32 GetOperationType() const; | 334 FX_INT32 GetOperationType() const; |
| 374 | 335 |
| 375 | |
| 376 | |
| 377 | |
| 378 CPDF_Stream* GetSoundStream() const | 336 CPDF_Stream* GetSoundStream() const |
| 379 { | 337 { |
| 380 return m_pDict->GetStream("Sound"); | 338 return m_pDict->GetStream("Sound"); |
| 381 } | 339 } |
| 382 | 340 |
| 383 FX_FLOAT GetVolume() const | 341 FX_FLOAT GetVolume() const |
| 384 { | 342 { |
| 385 return m_pDict->GetNumber("Volume"); | 343 return m_pDict->GetNumber("Volume"); |
| 386 } | 344 } |
| 387 | 345 |
| 388 FX_BOOL IsSynchronous() const | 346 FX_BOOL IsSynchronous() const |
| 389 { | 347 { |
| 390 return m_pDict->GetBoolean("Synchronous"); | 348 return m_pDict->GetBoolean("Synchronous"); |
| 391 } | 349 } |
| 392 | 350 |
| 393 FX_BOOL IsRepeat() const | 351 FX_BOOL IsRepeat() const |
| 394 { | 352 { |
| 395 return m_pDict->GetBoolean("Repeat"); | 353 return m_pDict->GetBoolean("Repeat"); |
| 396 } | 354 } |
| 397 | 355 |
| 398 FX_BOOL IsMixPlay() const | 356 FX_BOOL IsMixPlay() const |
| 399 { | 357 { |
| 400 return m_pDict->GetBoolean("Mix"); | 358 return m_pDict->GetBoolean("Mix"); |
| 401 } | 359 } |
| 402 | 360 |
| 403 | |
| 404 | |
| 405 | |
| 406 FX_DWORD GetSubActionsCount() const; | 361 FX_DWORD GetSubActionsCount() const; |
| 407 | 362 |
| 408 CPDF_Action GetSubAction(FX_DWORD iIndex) const; | 363 CPDF_Action GetSubAction(FX_DWORD iIndex) const; |
| 409 | 364 |
| 410 protected: | 365 protected: |
| 411 CPDF_Dictionary* m_pDict; | 366 CPDF_Dictionary* m_pDict; |
| 412 }; | 367 }; |
| 413 class CPDF_AAction | 368 class CPDF_AAction |
| 414 { | 369 { |
| 415 public: | 370 public: |
| 416 | 371 |
| 417 CPDF_AAction(CPDF_Dictionary* pDict = NULL) | 372 CPDF_AAction(CPDF_Dictionary* pDict = NULL) |
| 418 { | 373 { |
| 419 m_pDict = pDict; | 374 m_pDict = pDict; |
| 420 } | 375 } |
| 421 | 376 |
| 422 operator CPDF_Dictionary*() const | 377 operator CPDF_Dictionary*() const |
| 423 { | 378 { |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 451 FX_BOOL ActionExist(AActionType eType) const; | 406 FX_BOOL ActionExist(AActionType eType) const; |
| 452 | 407 |
| 453 CPDF_Action GetAction(AActionType eType) const; | 408 CPDF_Action GetAction(AActionType eType) const; |
| 454 | 409 |
| 455 FX_POSITION GetStartPos() const; | 410 FX_POSITION GetStartPos() const; |
| 456 | 411 |
| 457 CPDF_Action GetNextAction(FX_POSITION& pos, AActionType& eTy pe) const; | 412 CPDF_Action GetNextAction(FX_POSITION& pos, AActionType& eTy pe) const; |
| 458 | 413 |
| 459 CPDF_Dictionary* m_pDict; | 414 CPDF_Dictionary* m_pDict; |
| 460 }; | 415 }; |
| 461 class CPDF_DocJSActions | 416 class CPDF_DocJSActions |
| 462 { | 417 { |
| 463 public: | 418 public: |
| 464 CPDF_DocJSActions(CPDF_Document* pDoc); | 419 CPDF_DocJSActions(CPDF_Document* pDoc); |
| 465 | 420 |
| 466 | 421 |
| 467 int CountJSActions() const; | 422 int CountJSActions() const; |
| 468 | 423 |
| 469 CPDF_Action GetJSAction(int index, CFX_ByteString& csName) c onst; | 424 CPDF_Action GetJSAction(int index, CFX_ByteString& csName) c onst; |
| 470 | 425 |
| 471 CPDF_Action GetJSAction(const CFX_ByteString& csName) const; | 426 CPDF_Action GetJSAction(const CFX_ByteString& csName) const; |
| 472 | 427 |
| 473 int FindJSAction(const CFX_ByteString& csNam e) const; | 428 int FindJSAction(const CFX_ByteString& csNam e) const; |
| 474 | 429 |
| 475 | 430 |
| 476 CPDF_Document* GetDocument() const | 431 CPDF_Document* GetDocument() const |
| 477 { | 432 { |
| 478 return m_pDocument; | 433 return m_pDocument; |
| 479 } | 434 } |
| 480 | 435 |
| 481 protected: | 436 protected: |
| 482 | 437 |
| 483 CPDF_Document* m_pDocument; | 438 CPDF_Document* m_pDocument; |
| 484 }; | 439 }; |
| 485 class CPDF_FileSpec | 440 class CPDF_FileSpec |
| 486 { | 441 { |
| 487 public: | 442 public: |
| 488 | 443 |
| 489 CPDF_FileSpec(); | 444 CPDF_FileSpec(); |
| 490 | 445 |
| 491 CPDF_FileSpec(CPDF_Object *pObj) | 446 CPDF_FileSpec(CPDF_Object *pObj) |
| 492 { | 447 { |
| 493 m_pObj = pObj; | 448 m_pObj = pObj; |
| 494 } | 449 } |
| 495 | 450 |
| 496 operator CPDF_Object*() const | 451 operator CPDF_Object*() const |
| 497 { | 452 { |
| 498 return m_pObj; | 453 return m_pObj; |
| 499 } | 454 } |
| 500 | 455 |
| 501 FX_BOOL IsURL() const; | 456 FX_BOOL IsURL() const; |
| 502 | 457 |
| 503 FX_BOOL GetFileName(CFX_WideString &wsFileName) const; | 458 FX_BOOL GetFileName(CFX_WideString &wsFileName) const; |
| 504 | 459 |
| 505 CPDF_Stream* GetFileStream() const; | 460 CPDF_Stream* GetFileStream() const; |
| 506 | 461 |
| 507 void SetFileName(FX_WSTR wsFileName, FX_BOOL bURL = F ALSE); | 462 void SetFileName(FX_WSTR wsFileName, FX_BOOL bURL = F ALSE); |
| 508 protected: | 463 protected: |
| 509 | 464 |
| 510 CPDF_Object *m_pObj; | 465 CPDF_Object *m_pObj; |
| 511 }; | 466 }; |
| 512 class CPDF_LinkList | 467 class CPDF_LinkList |
| 513 { | 468 { |
| 514 public: | 469 public: |
| 515 | 470 |
| 516 CPDF_LinkList(CPDF_Document* pDoc) | 471 CPDF_LinkList(CPDF_Document* pDoc) |
| 517 { | 472 { |
| 518 m_pDocument = pDoc; | 473 m_pDocument = pDoc; |
| 519 } | 474 } |
| 520 | 475 |
| 521 ~CPDF_LinkList(); | 476 ~CPDF_LinkList(); |
| 522 | 477 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 533 protected: | 488 protected: |
| 534 | 489 |
| 535 CPDF_Document* m_pDocument; | 490 CPDF_Document* m_pDocument; |
| 536 | 491 |
| 537 CFX_MapPtrToPtr m_PageMap; | 492 CFX_MapPtrToPtr m_PageMap; |
| 538 | 493 |
| 539 CFX_PtrArray* GetPageLinks(CPDF_Page* pPage); | 494 CFX_PtrArray* GetPageLinks(CPDF_Page* pPage); |
| 540 | 495 |
| 541 void LoadPageLinks(CPDF_Page* pPage, CFX_PtrA rray* pList); | 496 void LoadPageLinks(CPDF_Page* pPage, CFX_PtrA rray* pList); |
| 542 }; | 497 }; |
| 543 class CPDF_Link | 498 class CPDF_Link |
| 544 { | 499 { |
| 545 public: | 500 public: |
| 546 CPDF_Link() : m_pDict(nullptr) { } | 501 CPDF_Link() : m_pDict(nullptr) { } |
| 547 explicit CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) { } | 502 explicit CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) { } |
| 548 | 503 |
| 549 CPDF_Dictionary* GetDict() const { return m_pDict; } | 504 CPDF_Dictionary* GetDict() const { return m_pDict; } |
| 550 | 505 |
| 551 CFX_FloatRect GetRect(); | 506 CFX_FloatRect GetRect(); |
| 552 CPDF_Dest GetDest(CPDF_Document* pDoc); | 507 CPDF_Dest GetDest(CPDF_Document* pDoc); |
| 553 CPDF_Action GetAction(); | 508 CPDF_Action GetAction(); |
| 554 | 509 |
| 555 protected: | 510 protected: |
| 556 CPDF_Dictionary* m_pDict; | 511 CPDF_Dictionary* m_pDict; |
| 557 }; | 512 }; |
| 558 #define ANNOTFLAG_INVISIBLE» » » 1 | 513 |
| 559 #define ANNOTFLAG_HIDDEN» » » 2 | 514 #define ANNOTFLAG_INVISIBLE 1 |
|
Tom Sepez
2015/06/05 21:26:18
nit: as long as you're going to make these line up
Lei Zhang
2015/06/05 22:25:47
Done.
| |
| 560 #define ANNOTFLAG_PRINT»» » » 4 | 515 #define ANNOTFLAG_HIDDEN 2 |
| 561 #define ANNOTFLAG_NOZOOM» » » 8 | 516 #define ANNOTFLAG_PRINT 4 |
| 562 #define ANNOTFLAG_NOROTATE» » » 0x10 | 517 #define ANNOTFLAG_NOZOOM 8 |
| 563 #define ANNOTFLAG_NOVIEW» » » 0x20 | 518 #define ANNOTFLAG_NOROTATE 0x10 |
| 564 #define ANNOTFLAG_READONLY» » » 0x40 | 519 #define ANNOTFLAG_NOVIEW 0x20 |
| 565 #define ANNOTFLAG_LOCKED» » » 0x80 | 520 #define ANNOTFLAG_READONLY 0x40 |
| 566 #define ANNOTFLAG_TOGGLENOVIEW» » 0x100 | 521 #define ANNOTFLAG_LOCKED 0x80 |
| 522 #define ANNOTFLAG_TOGGLENOVIEW 0x100 | |
|
Tom Sepez
2015/06/05 21:15:29
nit: blank line following, so long as you're at it
Lei Zhang
2015/06/05 22:25:47
Done.
| |
| 567 class CPDF_Annot : public CFX_PrivateData | 523 class CPDF_Annot : public CFX_PrivateData |
| 568 { | 524 { |
| 569 public: | 525 public: |
| 570 | 526 enum AppearanceMode { |
| 571 CPDF_Annot(CPDF_Dictionary* pDict); | |
| 572 | |
| 573 ~CPDF_Annot(); | |
| 574 | |
| 575 CPDF_Dictionary*» m_pAnnotDict; | |
| 576 | |
| 577 CFX_ByteString» » GetSubType() const; | |
| 578 | |
| 579 FX_DWORD» » » GetFlags() const | |
| 580 { | |
| 581 return m_pAnnotDict->GetInteger("F"); | |
| 582 } | |
| 583 | |
| 584 void» » » » GetRect(CFX_FloatRect& rect) const; | |
| 585 | |
| 586 enum AppearanceMode»{ | |
| 587 Normal, | 527 Normal, |
| 588 Rollover, | 528 Rollover, |
| 589 Down | 529 Down |
| 590 }; | 530 }; |
| 591 | 531 |
| 592 FX_BOOL» » » » DrawAppearance(const CPDF_Page* pPage, C FX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device, | 532 CPDF_Annot(CPDF_Dictionary* pDict, CPDF_AnnotList* pList); |
| 593 AppearanceMode mode, const CPDF_RenderOpt ions* pOptions); | 533 ~CPDF_Annot(); |
| 594 | 534 |
| 595 FX_BOOL» » » » DrawInContext(const CPDF_Page* pPage, co nst CPDF_RenderContext* pContext, | 535 CFX_ByteString GetSubType() const; |
| 596 const CFX_AffineMatrix* pUser2Device, Appe aranceMode mode); | |
| 597 | 536 |
| 598 void» » » » ClearCachedAP(); | 537 FX_DWORD GetFlags() const; |
| 599 | 538 |
| 539 void GetRect(CFX_FloatRect& rect) const; | |
| 600 | 540 |
| 601 void» » » » DrawBorder(CFX_RenderDevice* pDevice, co nst CFX_AffineMatrix* pUser2Device, | 541 CPDF_Dictionary* GetAnnotDict(); |
| 602 const CPDF_RenderOptions* pOptions); | |
| 603 | 542 |
| 604 CPDF_PageObject*» GetBorder(FX_BOOL bPrint, const CPDF_RenderOptions* pOpt ions); | 543 FX_BOOL DrawAppearance(const CPDF_Page* pPage, |
| 544 CFX_RenderDevice* pDevice, | |
| 545 const CFX_AffineMatrix* pUser2Device, | |
| 546 AppearanceMode mode, | |
| 547 const CPDF_RenderOptions* pOptions); | |
| 605 | 548 |
| 549 FX_BOOL DrawInContext(const CPDF_Page* pPage, | |
| 550 const CPDF_RenderContext* pContext, | |
| 551 const CFX_AffineMatrix* pUser2Device, | |
| 552 AppearanceMode mode); | |
| 606 | 553 |
| 554 void ClearCachedAP(); | |
| 607 | 555 |
| 608 int»» » » » CountIRTNotes(); | 556 void DrawBorder(CFX_RenderDevice* pDevice, |
| 557 const CFX_AffineMatrix* pUser2Device, | |
| 558 const CPDF_RenderOptions* pOptions); | |
| 609 | 559 |
| 610 CPDF_Annot*»» » GetIRTNote(int index); | 560 CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); |
| 611 | 561 |
| 562 private: | |
| 563 CPDF_Dictionary* const m_pAnnotDict; | |
| 612 | 564 |
| 613 CPDF_Form*» » » GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); | 565 CPDF_AnnotList* const m_pList; |
| 614 private: | |
| 615 | 566 |
| 616 CFX_MapPtrToPtr» » m_APMap; | 567 CFX_MapPtrToPtr m_APMap; |
| 617 protected: | 568 }; |
| 618 friend class» » CPDF_AnnotList; | |
| 619 | 569 |
| 620 CPDF_AnnotList*» » m_pList; | 570 class CPDF_AnnotList |
| 621 | |
| 622 CPDF_Reference*» » NewAnnotRef(); | |
| 623 }; | |
| 624 class CPDF_AnnotList | |
| 625 { | 571 { |
| 626 public: | 572 public: |
| 627 | 573 |
| 628 CPDF_AnnotList(CPDF_Page* pPage); | 574 CPDF_AnnotList(CPDF_Page* pPage); |
| 629 | 575 |
| 630 ~CPDF_AnnotList(); | 576 ~CPDF_AnnotList(); |
| 631 | 577 |
| 632 void GetAnnotMatrix(const CPDF_Dictionary* pAnnotDict, const CFX_Matr ix* pUser2Device, CFX_Matrix &matrix) const; | 578 void GetAnnotMatrix(const CPDF_Dictionary* pAnnotDict, const CFX_Matr ix* pUser2Device, CFX_Matrix &matrix) const; |
| 633 | 579 |
| 634 void GetAnnotRect(const CPDF_Dictionary* pAnnotDict, const CFX_Matrix * pUser2Device, CPDF_Rect &rtAnnot) const; | 580 void GetAnnotRect(const CPDF_Dictionary* pAnnotDict, const CFX_Matrix * pUser2Device, CPDF_Rect &rtAnnot) const; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 686 | 632 |
| 687 void DisplayPass(const CPDF_Page* pPage, CFX_ RenderDevice* pDevice, | 633 void DisplayPass(const CPDF_Page* pPage, CFX_ RenderDevice* pDevice, |
| 688 CPDF_RenderContext* pContext, FX_BOOL bPrint ing, CFX_AffineMatrix* pMatrix, | 634 CPDF_RenderContext* pContext, FX_BOOL bPrint ing, CFX_AffineMatrix* pMatrix, |
| 689 FX_BOOL bWidget, CPDF_RenderOptions* pOption s, FX_RECT* clip_rect); | 635 FX_BOOL bWidget, CPDF_RenderOptions* pOption s, FX_RECT* clip_rect); |
| 690 friend class CPDF_Annot; | 636 friend class CPDF_Annot; |
| 691 }; | 637 }; |
| 692 #define COLORTYPE_TRANSPARENT 0 | 638 #define COLORTYPE_TRANSPARENT 0 |
| 693 #define COLORTYPE_GRAY 1 | 639 #define COLORTYPE_GRAY 1 |
| 694 #define COLORTYPE_RGB 2 | 640 #define COLORTYPE_RGB 2 |
| 695 #define COLORTYPE_CMYK 3 | 641 #define COLORTYPE_CMYK 3 |
| 696 class CPDF_DefaultAppearance | 642 class CPDF_DefaultAppearance |
| 697 { | 643 { |
| 698 public: | 644 public: |
| 699 | 645 |
| 700 CPDF_DefaultAppearance(const CFX_ByteString& csDA = "") | 646 CPDF_DefaultAppearance(const CFX_ByteString& csDA = "") |
| 701 { | 647 { |
| 702 m_csDA = csDA; | 648 m_csDA = csDA; |
| 703 } | 649 } |
| 704 | 650 |
| 705 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) | 651 CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA) |
| 706 { | 652 { |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1016 #define FORMFIELD_REQUIRED 0x02 | 962 #define FORMFIELD_REQUIRED 0x02 |
| 1017 #define FORMFIELD_NOEXPORT 0x04 | 963 #define FORMFIELD_NOEXPORT 0x04 |
| 1018 #define FORMRADIO_NOTOGGLEOFF 0x100 | 964 #define FORMRADIO_NOTOGGLEOFF 0x100 |
| 1019 #define FORMRADIO_UNISON 0x200 | 965 #define FORMRADIO_UNISON 0x200 |
| 1020 #define FORMTEXT_MULTILINE 0x100 | 966 #define FORMTEXT_MULTILINE 0x100 |
| 1021 #define FORMTEXT_PASSWORD 0x200 | 967 #define FORMTEXT_PASSWORD 0x200 |
| 1022 #define FORMTEXT_NOSCROLL 0x400 | 968 #define FORMTEXT_NOSCROLL 0x400 |
| 1023 #define FORMTEXT_COMB 0x800 | 969 #define FORMTEXT_COMB 0x800 |
| 1024 #define FORMCOMBO_EDIT 0x100 | 970 #define FORMCOMBO_EDIT 0x100 |
| 1025 #define FORMLIST_MULTISELECT 0x100 | 971 #define FORMLIST_MULTISELECT 0x100 |
| 1026 class CPDF_FormField | 972 class CPDF_FormField |
| 1027 { | 973 { |
| 1028 public: | 974 public: |
| 1029 | 975 |
| 1030 enum Type { | 976 enum Type { |
| 1031 Unknown, | 977 Unknown, |
| 1032 PushButton, | 978 PushButton, |
| 1033 RadioButton, | 979 RadioButton, |
| 1034 CheckBox, | 980 CheckBox, |
| 1035 Text, | 981 Text, |
| 1036 RichText, | 982 RichText, |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1238 CFX_WideString GetCheckValue(FX_BOOL bDefault); | 1184 CFX_WideString GetCheckValue(FX_BOOL bDefault); |
| 1239 | 1185 |
| 1240 FX_BOOL SetCheckValue(const CFX_WideStri ng& value, FX_BOOL bDefault, FX_BOOL bNotify); | 1186 FX_BOOL SetCheckValue(const CFX_WideStri ng& value, FX_BOOL bDefault, FX_BOOL bNotify); |
| 1241 | 1187 |
| 1242 | 1188 |
| 1243 FX_FLOAT m_FontSize; | 1189 FX_FLOAT m_FontSize; |
| 1244 | 1190 |
| 1245 CPDF_Font* m_pFont; | 1191 CPDF_Font* m_pFont; |
| 1246 }; | 1192 }; |
| 1247 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* na me, int nLevel = 0); | 1193 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* na me, int nLevel = 0); |
| 1248 class CPDF_IconFit | 1194 class CPDF_IconFit |
| 1249 { | 1195 { |
| 1250 public: | 1196 public: |
| 1251 | 1197 |
| 1252 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) | 1198 CPDF_IconFit(CPDF_Dictionary* pDict = NULL) |
| 1253 { | 1199 { |
| 1254 m_pDict = pDict; | 1200 m_pDict = pDict; |
| 1255 } | 1201 } |
| 1256 | 1202 |
| 1257 operator CPDF_Dictionary*() const | 1203 operator CPDF_Dictionary*() const |
| 1258 { | 1204 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1290 CPDF_Dictionary* m_pDict; | 1236 CPDF_Dictionary* m_pDict; |
| 1291 }; | 1237 }; |
| 1292 | 1238 |
| 1293 #define TEXTPOS_CAPTION 0 | 1239 #define TEXTPOS_CAPTION 0 |
| 1294 #define TEXTPOS_ICON 1 | 1240 #define TEXTPOS_ICON 1 |
| 1295 #define TEXTPOS_BELOW 2 | 1241 #define TEXTPOS_BELOW 2 |
| 1296 #define TEXTPOS_ABOVE 3 | 1242 #define TEXTPOS_ABOVE 3 |
| 1297 #define TEXTPOS_RIGHT 4 | 1243 #define TEXTPOS_RIGHT 4 |
| 1298 #define TEXTPOS_LEFT 5 | 1244 #define TEXTPOS_LEFT 5 |
| 1299 #define TEXTPOS_OVERLAID 6 | 1245 #define TEXTPOS_OVERLAID 6 |
| 1300 class CPDF_FormControl | 1246 class CPDF_FormControl |
| 1301 { | 1247 { |
| 1302 public: | 1248 public: |
| 1303 | 1249 |
| 1304 CPDF_FormField::Type GetType() | 1250 CPDF_FormField::Type GetType() |
| 1305 { | 1251 { |
| 1306 return m_pField->GetType(); | 1252 return m_pField->GetType(); |
| 1307 } | 1253 } |
| 1308 | 1254 |
| 1309 CPDF_InterForm* GetInterForm() const | 1255 CPDF_InterForm* GetInterForm() const |
| 1310 { | 1256 { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1498 CPDF_ApSettings GetMK(FX_BOOL bCreate); | 1444 CPDF_ApSettings GetMK(FX_BOOL bCreate); |
| 1499 | 1445 |
| 1500 CPDF_InterForm* m_pForm; | 1446 CPDF_InterForm* m_pForm; |
| 1501 | 1447 |
| 1502 CPDF_FormField* m_pField; | 1448 CPDF_FormField* m_pField; |
| 1503 | 1449 |
| 1504 CPDF_Dictionary* m_pWidgetDict; | 1450 CPDF_Dictionary* m_pWidgetDict; |
| 1505 friend class CPDF_InterForm; | 1451 friend class CPDF_InterForm; |
| 1506 friend class CPDF_FormField; | 1452 friend class CPDF_FormField; |
| 1507 }; | 1453 }; |
| 1508 class CPDF_FormNotify | 1454 class CPDF_FormNotify |
| 1509 { | 1455 { |
| 1510 public: | 1456 public: |
| 1511 | 1457 |
| 1512 virtual ~CPDF_FormNotify() {} | 1458 virtual ~CPDF_FormNotify() {} |
| 1513 | 1459 |
| 1514 virtual int BeforeValueChange(const CPDF_FormField* pField, CFX_Wide String& csValue) | 1460 virtual int BeforeValueChange(const CPDF_FormField* pField, CFX_Wide String& csValue) |
| 1515 { | 1461 { |
| 1516 return 0; | 1462 return 0; |
| 1517 } | 1463 } |
| 1518 | 1464 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1550 { | 1496 { |
| 1551 return 0; | 1497 return 0; |
| 1552 } | 1498 } |
| 1553 | 1499 |
| 1554 virtual int AfterFormImportData(const CPDF_InterForm* pForm) | 1500 virtual int AfterFormImportData(const CPDF_InterForm* pForm) |
| 1555 { | 1501 { |
| 1556 return 0; | 1502 return 0; |
| 1557 } | 1503 } |
| 1558 }; | 1504 }; |
| 1559 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict ); | 1505 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict ); |
| 1560 class CPDF_PageLabel | 1506 class CPDF_PageLabel |
| 1561 { | 1507 { |
| 1562 public: | 1508 public: |
| 1563 | 1509 |
| 1564 CPDF_PageLabel(CPDF_Document* pDocument) | 1510 CPDF_PageLabel(CPDF_Document* pDocument) |
| 1565 { | 1511 { |
| 1566 m_pDocument = pDocument; | 1512 m_pDocument = pDocument; |
| 1567 } | 1513 } |
| 1568 | 1514 |
| 1569 | 1515 |
| 1570 CFX_WideString GetLabel(int nPage) cons t; | 1516 CFX_WideString GetLabel(int nPage) cons t; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1614 | 1560 |
| 1615 FX_INT32 NumCopies() const; | 1561 FX_INT32 NumCopies() const; |
| 1616 | 1562 |
| 1617 CPDF_Array* PrintPageRange() const; | 1563 CPDF_Array* PrintPageRange() const; |
| 1618 | 1564 |
| 1619 CFX_ByteString Duplex() const; | 1565 CFX_ByteString Duplex() const; |
| 1620 | 1566 |
| 1621 protected: | 1567 protected: |
| 1622 CPDF_Document* m_pDoc; | 1568 CPDF_Document* m_pDoc; |
| 1623 }; | 1569 }; |
| 1624 class CPDF_ApSettings | 1570 class CPDF_ApSettings |
| 1625 { | 1571 { |
| 1626 public: | 1572 public: |
| 1627 | 1573 |
| 1628 CPDF_ApSettings(CPDF_Dictionary* pDict = NULL) | 1574 CPDF_ApSettings(CPDF_Dictionary* pDict = NULL) |
| 1629 { | 1575 { |
| 1630 m_pDict = pDict; | 1576 m_pDict = pDict; |
| 1631 } | 1577 } |
| 1632 | 1578 |
| 1633 operator CPDF_Dictionary* () const | 1579 operator CPDF_Dictionary* () const |
| 1634 { | 1580 { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1744 | 1690 |
| 1745 void GetOriginalColor(int& iColorType , FX_FLOAT fc[4], FX_BSTR csEntry); | 1691 void GetOriginalColor(int& iColorType , FX_FLOAT fc[4], FX_BSTR csEntry); |
| 1746 | 1692 |
| 1747 CFX_WideString GetCaption(FX_BSTR csEntry); | 1693 CFX_WideString GetCaption(FX_BSTR csEntry); |
| 1748 | 1694 |
| 1749 CPDF_Stream* GetIcon(FX_BSTR csEntry); | 1695 CPDF_Stream* GetIcon(FX_BSTR csEntry); |
| 1750 friend class CPDF_FormControl; | 1696 friend class CPDF_FormControl; |
| 1751 }; | 1697 }; |
| 1752 | 1698 |
| 1753 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ | 1699 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ |
| OLD | NEW |