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