| vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef SkPDFFormXObject_DEFINED |
| 18 | #define SkPDFFormXObject_DEFINED |
| 19 | |
| 20 | #include "SkPDFStream.h" |
| 21 | #include "SkPDFTypes.h" |
| 22 | #include "SkRefCnt.h" |
| 23 | #include "SkString.h" |
| 24 | |
| 25 | class SkMatrix; |
| 26 | class SkPDFDevice; |
| 27 | class SkPDFCatalog; |
| 28 | |
| 29 | /** \class SkPDFFormXObject |
| 30 | |
| vandebo@chromium.org | f60a001 | 2011-02-24 23:14:04 +0000 | [diff] [blame] | 31 | A form XObject; a self contained description of graphics objects. A form |
| vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 32 | XObject is basically a page object with slightly different syntax, that |
| 33 | can be drawn onto a page. |
| 34 | */ |
| 35 | |
| 36 | // The caller could keep track of the form XObjects it creates and |
| 37 | // canonicalize them, but the Skia API doesn't provide enough context to |
| 38 | // automatically do it (trivially). |
| vandebo@chromium.org | 421d644 | 2011-07-20 17:39:01 +0000 | [diff] [blame] | 39 | class SkPDFFormXObject : public SkPDFStream { |
| vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 40 | public: |
| 41 | /** Create a PDF form XObject. Entries for the dictionary entries are |
| 42 | * automatically added. |
| 43 | * @param device The set of graphical elements on this form. |
| vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 44 | */ |
| vandebo@chromium.org | 1aef2ed | 2011-02-03 21:46:10 +0000 | [diff] [blame] | 45 | explicit SkPDFFormXObject(SkPDFDevice* device); |
| vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 46 | virtual ~SkPDFFormXObject(); |
| 47 | |
| 48 | // The SkPDFObject interface. |
| vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 49 | virtual void getResources(SkTDArray<SkPDFObject*>* resourceList); |
| 50 | |
| vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 51 | private: |
| vandebo@chromium.org | 79ac4fd | 2011-02-08 19:22:40 +0000 | [diff] [blame] | 52 | SkTDArray<SkPDFObject*> fResources; |
| vandebo@chromium.org | eb6c759 | 2010-10-26 19:54:45 +0000 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | #endif |