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

Side by Side Diff: include/core/SkAnnotation.h

Issue 12466008: PDF: add support for named destinations (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « gyp/gmslides.gypi ('k') | include/pdf/SkPDFDevice.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkAnnotation_DEFINED 8 #ifndef SkAnnotation_DEFINED
9 #define SkAnnotation_DEFINED 9 #define SkAnnotation_DEFINED
10 10
11 #include "SkFlattenable.h" 11 #include "SkFlattenable.h"
12 12
13 class SkData; 13 class SkData;
14 class SkDataSet; 14 class SkDataSet;
15 class SkPoint;
15 class SkStream; 16 class SkStream;
16 class SkWStream; 17 class SkWStream;
17 18
18 /** 19 /**
19 * Experimental class for annotating draws. Do not use directly yet. 20 * Experimental class for annotating draws. Do not use directly yet.
20 * Use helper functions at the bottom of this file for now. 21 * Use helper functions at the bottom of this file for now.
21 */ 22 */
22 class SkAnnotation : public SkFlattenable { 23 class SkAnnotation : public SkFlattenable {
23 public: 24 public:
24 enum Flags { 25 enum Flags {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 58
58 /** 59 /**
59 * Experimental collection of predefined Keys into the Annotation dictionary 60 * Experimental collection of predefined Keys into the Annotation dictionary
60 */ 61 */
61 class SkAnnotationKeys { 62 class SkAnnotationKeys {
62 public: 63 public:
63 /** 64 /**
64 * Returns the canonical key whose payload is a URL 65 * Returns the canonical key whose payload is a URL
65 */ 66 */
66 static const char* URL_Key(); 67 static const char* URL_Key();
68
69 /**
70 * Returns the canonical key whose payload is the name of a destination to
71 * be defined.
72 */
73 static const char* Define_Named_Dest_Key();
74
75 /**
76 * Returns the canonical key whose payload is the name of a destination to
77 * be linked to.
78 */
79 static const char* Link_Named_Dest_Key();
67 }; 80 };
68 81
69 /////////////////////////////////////////////////////////////////////////////// 82 ///////////////////////////////////////////////////////////////////////////////
70 // 83 //
71 // Experimental helper functions to use Annotations 84 // Experimental helper functions to use Annotations
72 // 85 //
73 86
74 struct SkRect; 87 struct SkRect;
75 class SkCanvas; 88 class SkCanvas;
76 89
77 /** 90 /**
78 * Experimental! 91 * Experimental!
79 * 92 *
80 * Annotate the canvas by associating the specified URL with the 93 * Annotate the canvas by associating the specified URL with the
81 * specified rectangle (in local coordinates, just like drawRect). If the 94 * specified rectangle (in local coordinates, just like drawRect). If the
82 * backend of this canvas does not support annotations, this call is 95 * backend of this canvas does not support annotations, this call is
83 * safely ignored. 96 * safely ignored.
84 * 97 *
85 * The caller is responsible for managing its ownership of the SkData. 98 * The caller is responsible for managing its ownership of the SkData.
86 */ 99 */
87 SK_API void SkAnnotateRectWithURL(SkCanvas*, const SkRect&, SkData*); 100 SK_API void SkAnnotateRectWithURL(SkCanvas*, const SkRect&, SkData*);
88 101
102 /**
103 * Experimental!
104 *
105 * Annotate the canvas by associating a name with the specified point.
106 *
107 * If the backend of this canvas does not support annotations, this call is
108 * safely ignored.
109 *
110 * The caller is responsible for managing its ownership of the SkData.
111 */
112 SK_API void SkAnnotateNamedDestination(SkCanvas*, const SkPoint&, SkData*);
113
114 /**
115 * Experimental!
116 *
117 * Annotate the canvas by making the specified rectangle link to a named
118 * destination.
119 *
120 * If the backend of this canvas does not support annotations, this call is
121 * safely ignored.
122 *
123 * The caller is responsible for managing its ownership of the SkData.
124 */
125 SK_API void SkAnnotateLinkToDestination(SkCanvas*, const SkRect&, SkData*);
126
127
89 #endif 128 #endif
OLDNEW
« no previous file with comments | « gyp/gmslides.gypi ('k') | include/pdf/SkPDFDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698