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.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef _PWL_SIGNATURE_H_
8#define _PWL_SIGNATURE_H_
9
10class CPWL_Signature;
11class CPWL_Label;
12class CPWL_Signature_Image;
13
14class CPWL_Signature_Image : public CPWL_Image
15{
16public:
17	CPWL_Signature_Image();
18	virtual ~CPWL_Signature_Image();
19
20	void								SetImage(CFX_DIBSource* pImage);
21	CFX_DIBSource*						GetImage();
22
23protected:
24	virtual void						DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
25	virtual void						GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
26
27	virtual void						GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale);
28
29private:
30	CFX_DIBSource*						m_pImage;
31};
32
33class PWL_CLASS CPWL_Signature : public CPWL_Wnd
34{
35public:
36	CPWL_Signature();
37	virtual ~CPWL_Signature();
38
39	void								SetText(FX_LPCWSTR sText);
40	void								SetDescription(FX_LPCWSTR string);
41	void								SetImage(CFX_DIBSource* pImage);
42	void								SetImageStream(CPDF_Stream * pStream, FX_LPCSTR sImageAlias);
43
44	void								SetTextFlag(FX_BOOL bTextExist);
45	void								SetImageFlag(FX_BOOL bImageExist);
46	void								SetFoxitFlag(FX_BOOL bFlagExist);
47
48protected:
49	virtual void						RePosChildWnd();
50	virtual void						CreateChildWnd(const PWL_CREATEPARAM & cp);
51
52	virtual void						DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
53	virtual void						GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
54
55private:
56	CPWL_Label*							m_pText;
57	CPWL_Label*							m_pDescription;
58	CPWL_Signature_Image*				m_pImage;
59
60	FX_BOOL								m_bTextExist;
61	FX_BOOL								m_bImageExist;
62	FX_BOOL								m_bFlagExist;
63};
64
65#endif // _PWL_SIGNATURE_H_
66
67
68