John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1 | // Copyright 2014 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. |
Lei Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 4 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
Dan Sinclair | c411eb9 | 2017-07-25 09:39:30 -0400 | [diff] [blame] | 7 | #ifndef FPDFSDK_PWL_CPWL_ICON_H_ |
| 8 | #define FPDFSDK_PWL_CPWL_ICON_H_ |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 9 | |
Dan Sinclair | dc11ec8 | 2017-07-20 11:08:03 -0400 | [diff] [blame] | 10 | #include <utility> |
| 11 | |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 12 | #include "core/fxcrt/fx_string.h" |
Dan Sinclair | aee0db0 | 2017-09-21 16:53:58 -0400 | [diff] [blame] | 13 | #include "core/fxcrt/unowned_ptr.h" |
Dan Sinclair | c411eb9 | 2017-07-25 09:39:30 -0400 | [diff] [blame] | 14 | #include "fpdfsdk/pwl/cpwl_wnd.h" |
Tom Sepez | 870292c | 2015-04-07 16:12:46 -0700 | [diff] [blame] | 15 | |
Dan Sinclair | dc11ec8 | 2017-07-20 11:08:03 -0400 | [diff] [blame] | 16 | class CPWL_Icon : public CPWL_Wnd { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 17 | public: |
| 18 | CPWL_Icon(); |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 19 | ~CPWL_Icon() override; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 20 | |
Lei Zhang | 0998538 | 2015-08-14 22:23:47 -0700 | [diff] [blame] | 21 | void SetIconFit(CPDF_IconFit* pIconFit) { m_pIconFit = pIconFit; } |
Dan Sinclair | dc11ec8 | 2017-07-20 11:08:03 -0400 | [diff] [blame] | 22 | void SetPDFStream(CPDF_Stream* pStream) { m_pPDFStream = pStream; } |
| 23 | |
| 24 | // horizontal scale, vertical scale |
| 25 | std::pair<float, float> GetScale(); |
| 26 | |
| 27 | // x, y |
| 28 | std::pair<float, float> GetImageOffset(); |
| 29 | |
| 30 | CFX_Matrix GetImageMatrix(); |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 31 | ByteString GetImageAlias(); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 32 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 33 | private: |
Dan Sinclair | dc11ec8 | 2017-07-20 11:08:03 -0400 | [diff] [blame] | 34 | // left, bottom |
| 35 | std::pair<float, float> GetIconPosition(); |
| 36 | |
| 37 | // width, height |
| 38 | std::pair<float, float> GetImageSize(); |
| 39 | |
Dan Sinclair | aee0db0 | 2017-09-21 16:53:58 -0400 | [diff] [blame] | 40 | UnownedPtr<CPDF_Stream> m_pPDFStream; |
| 41 | UnownedPtr<CPDF_IconFit> m_pIconFit; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
Dan Sinclair | c411eb9 | 2017-07-25 09:39:30 -0400 | [diff] [blame] | 44 | #endif // FPDFSDK_PWL_CPWL_ICON_H_ |