Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 1 | // Copyright 2017 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
Tom Sepez | 6c62e0e | 2019-08-01 21:49:43 +0000 | [diff] [blame] | 7 | #ifndef FPDFSDK_CPDFSDK_APPSTREAM_H_ |
| 8 | #define FPDFSDK_CPDFSDK_APPSTREAM_H_ |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 9 | |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 10 | #include "core/fxcrt/fx_string.h" |
Dan Sinclair | aee0db0 | 2017-09-21 16:53:58 -0400 | [diff] [blame] | 11 | #include "core/fxcrt/unowned_ptr.h" |
Lei Zhang | 4f261ff | 2018-10-10 18:44:45 +0000 | [diff] [blame] | 12 | #include "third_party/base/optional.h" |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 13 | |
| 14 | class CPDFSDK_Widget; |
| 15 | class CPDF_Dictionary; |
| 16 | class CPDF_Stream; |
| 17 | |
Tom Sepez | 6c62e0e | 2019-08-01 21:49:43 +0000 | [diff] [blame] | 18 | class CPDFSDK_AppStream { |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 19 | public: |
Tom Sepez | 6c62e0e | 2019-08-01 21:49:43 +0000 | [diff] [blame] | 20 | CPDFSDK_AppStream(CPDFSDK_Widget* widget, CPDF_Dictionary* dict); |
| 21 | ~CPDFSDK_AppStream(); |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 22 | |
| 23 | void SetAsPushButton(); |
| 24 | void SetAsCheckBox(); |
| 25 | void SetAsRadioButton(); |
Lei Zhang | 4f261ff | 2018-10-10 18:44:45 +0000 | [diff] [blame] | 26 | void SetAsComboBox(Optional<WideString> sValue); |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 27 | void SetAsListBox(); |
Lei Zhang | 4f261ff | 2018-10-10 18:44:45 +0000 | [diff] [blame] | 28 | void SetAsTextField(Optional<WideString> sValue); |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 29 | |
| 30 | private: |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 31 | void AddImage(const ByteString& sAPType, CPDF_Stream* pImage); |
| 32 | void Write(const ByteString& sAPType, |
| 33 | const ByteString& sContents, |
| 34 | const ByteString& sAPState); |
| 35 | void Remove(const ByteString& sAPType); |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 36 | |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 37 | ByteString GetBackgroundAppStream() const; |
| 38 | ByteString GetBorderAppStream() const; |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 39 | |
Lei Zhang | 4f261ff | 2018-10-10 18:44:45 +0000 | [diff] [blame] | 40 | UnownedPtr<CPDFSDK_Widget> const widget_; |
Tom Sepez | b33a011 | 2019-05-03 20:53:08 +0000 | [diff] [blame] | 41 | RetainPtr<CPDF_Dictionary> const dict_; |
Dan Sinclair | cb2ea42 | 2017-07-19 15:24:49 -0400 | [diff] [blame] | 42 | }; |
| 43 | |
Tom Sepez | 6c62e0e | 2019-08-01 21:49:43 +0000 | [diff] [blame] | 44 | #endif // FPDFSDK_CPDFSDK_APPSTREAM_H_ |