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

Side by Side Diff: core/include/fpdfdoc/fpdf_doc.h

Issue 984773002: Make conversion between CPDF_Action and its dictionary explicit (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Tabs Created 5 years, 9 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 | core/src/fpdfdoc/doc_action.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 _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
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
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 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 FX_FLOAT GetOriginalColor(int index, FX_BSTR csEn try); 1764 FX_FLOAT GetOriginalColor(int index, FX_BSTR csEn try);
1769 1765
1770 void GetOriginalColor(int& iColorType , FX_FLOAT fc[4], FX_BSTR csEntry); 1766 void GetOriginalColor(int& iColorType , FX_FLOAT fc[4], FX_BSTR csEntry);
1771 1767
1772 CFX_WideString GetCaption(FX_BSTR csEntry); 1768 CFX_WideString GetCaption(FX_BSTR csEntry);
1773 1769
1774 CPDF_Stream* GetIcon(FX_BSTR csEntry); 1770 CPDF_Stream* GetIcon(FX_BSTR csEntry);
1775 friend class CPDF_FormControl; 1771 friend class CPDF_FormControl;
1776 }; 1772 };
1777 #endif 1773 #endif
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_action.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698