blob: 0c49152a1bfbe3fb5b42d4de6aef48b1f7437820 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2010 The Android Open Source Project
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +00004 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00005 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000010#ifndef SkPDFFormXObject_DEFINED
11#define SkPDFFormXObject_DEFINED
12
13#include "SkPDFStream.h"
14#include "SkPDFTypes.h"
15#include "SkRefCnt.h"
16#include "SkString.h"
17
18class SkMatrix;
19class SkPDFDevice;
20class SkPDFCatalog;
21
22/** \class SkPDFFormXObject
23
vandebo@chromium.orgf60a0012011-02-24 23:14:04 +000024 A form XObject; a self contained description of graphics objects. A form
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000025 XObject is basically a page object with slightly different syntax, that
26 can be drawn onto a page.
27*/
28
29// The caller could keep track of the form XObjects it creates and
30// canonicalize them, but the Skia API doesn't provide enough context to
31// automatically do it (trivially).
vandebo@chromium.org421d6442011-07-20 17:39:01 +000032class SkPDFFormXObject : public SkPDFStream {
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000033public:
34 /** Create a PDF form XObject. Entries for the dictionary entries are
35 * automatically added.
36 * @param device The set of graphical elements on this form.
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000037 */
vandebo@chromium.org1aef2ed2011-02-03 21:46:10 +000038 explicit SkPDFFormXObject(SkPDFDevice* device);
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000039 virtual ~SkPDFFormXObject();
40
41 // The SkPDFObject interface.
edisonn@google.com5bd26d32013-02-28 14:01:44 +000042 virtual void getResources(SkTDArray<SkPDFObject*>* resourceList);
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000043
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000044private:
edisonn@google.com5bd26d32013-02-28 14:01:44 +000045 SkTDArray<SkPDFObject*> fResources;
vandebo@chromium.orgeb6c7592010-10-26 19:54:45 +000046};
47
48#endif