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 _FPDF_DOC_H_ | 7 #ifndef _FPDF_DOC_H_ |
8 #define _FPDF_DOC_H_ | 8 #define _FPDF_DOC_H_ |
9 #ifndef _FPDF_PARSER_ | 9 #ifndef _FPDF_PARSER_ |
10 #include "../fpdfapi/fpdf_parser.h" | 10 #include "../fpdfapi/fpdf_parser.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 }; | 257 }; |
258 | 258 |
259 #define PDFNAMED_NEXTPAGE 1 | 259 #define PDFNAMED_NEXTPAGE 1 |
260 #define PDFNAMED_PREVPAGE 2 | 260 #define PDFNAMED_PREVPAGE 2 |
261 #define PDFNAMED_FIRSTPAGE 3 | 261 #define PDFNAMED_FIRSTPAGE 3 |
262 #define PDFNAMED_LASTPAGE 4 | 262 #define PDFNAMED_LASTPAGE 4 |
263 #define PDFJS_MAXLENGTH 64 | 263 #define PDFJS_MAXLENGTH 64 |
264 class CPDF_Action : public CFX_Object | 264 class CPDF_Action : public CFX_Object |
265 { | 265 { |
266 public: | 266 public: |
267 | |
268 CPDF_Action(CPDF_Dictionary* pDict = NULL) | |
269 { | |
270 m_pDict = pDict; | |
271 } | |
272 | |
273 operator CPDF_Dictionary* () const | |
274 { | |
275 return m_pDict; | |
276 } | |
277 | |
278 enum ActionType { | 267 enum ActionType { |
279 Unknown = 0, | 268 Unknown = 0, |
280 GoTo, | 269 GoTo, |
281 GoToR, | 270 GoToR, |
282 GoToE, | 271 GoToE, |
283 Launch, | 272 Launch, |
284 Thread, | 273 Thread, |
285 URI, | 274 URI, |
286 Sound, | 275 Sound, |
287 Movie, | 276 Movie, |
288 Hide, | 277 Hide, |
289 Named, | 278 Named, |
290 SubmitForm, | 279 SubmitForm, |
291 ResetForm, | 280 ResetForm, |
292 ImportData, | 281 ImportData, |
293 JavaScript, | 282 JavaScript, |
294 SetOCGState, | 283 SetOCGState, |
295 Rendition, | 284 Rendition, |
296 Trans, | 285 Trans, |
297 GoTo3DView | 286 GoTo3DView |
298 }; | 287 }; |
299 | 288 |
| 289 CPDF_Action() : m_pDict(nullptr) { } |
| 290 explicit CPDF_Action(CPDF_Dictionary* pDict) : m_pDict(pDict) { } |
| 291 |
| 292 operator bool () const { return m_pDict != NULL; } |
| 293 |
| 294 CPDF_Dictionary* GetDict() const { return m_pDict; } |
| 295 |
300 CFX_ByteString GetTypeName() const | 296 CFX_ByteString GetTypeName() const |
301 { | 297 { |
302 return m_pDict->GetString("S"); | 298 return m_pDict->GetString("S"); |
303 } | 299 } |
304 | 300 |
305 ActionType GetType() const; | 301 ActionType GetType() const; |
306 | 302 |
307 | 303 |
308 | 304 |
309 CPDF_Dest GetDest(CPDF_Document* pDoc) const; | 305 CPDF_Dest GetDest(CPDF_Document* pDoc) const; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 return m_pDict->GetBoolean("Mix"); | 411 return m_pDict->GetBoolean("Mix"); |
416 } | 412 } |
417 | 413 |
418 | 414 |
419 | 415 |
420 | 416 |
421 FX_DWORD GetSubActionsCount() const; | 417 FX_DWORD GetSubActionsCount() const; |
422 | 418 |
423 CPDF_Action GetSubAction(FX_DWORD iIndex) const; | 419 CPDF_Action GetSubAction(FX_DWORD iIndex) const; |
424 | 420 |
425 | 421 protected: |
426 CPDF_Dictionary* m_pDict; | 422 CPDF_Dictionary* m_pDict; |
427 }; | 423 }; |
428 class CPDF_AAction : public CFX_Object | 424 class CPDF_AAction : public CFX_Object |
429 { | 425 { |
430 public: | 426 public: |
431 | 427 |
432 CPDF_AAction(CPDF_Dictionary* pDict = NULL) | 428 CPDF_AAction(CPDF_Dictionary* pDict = NULL) |
433 { | 429 { |
434 m_pDict = pDict; | 430 m_pDict = pDict; |
435 } | 431 } |
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1769 FX_FLOAT GetOriginalColor(int index, FX_BSTR csEn
try); | 1765 FX_FLOAT GetOriginalColor(int index, FX_BSTR csEn
try); |
1770 | 1766 |
1771 void GetOriginalColor(int& iColorType
, FX_FLOAT fc[4], FX_BSTR csEntry); | 1767 void GetOriginalColor(int& iColorType
, FX_FLOAT fc[4], FX_BSTR csEntry); |
1772 | 1768 |
1773 CFX_WideString GetCaption(FX_BSTR csEntry); | 1769 CFX_WideString GetCaption(FX_BSTR csEntry); |
1774 | 1770 |
1775 CPDF_Stream* GetIcon(FX_BSTR csEntry); | 1771 CPDF_Stream* GetIcon(FX_BSTR csEntry); |
1776 friend class CPDF_FormControl; | 1772 friend class CPDF_FormControl; |
1777 }; | 1773 }; |
1778 #endif | 1774 #endif |
OLD | NEW |