Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / src / fxfa / src / parser / xfa_basic_imp.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _XFA_BASIC_IMP\r
8 #define _XFA_BASIC_IMP\r
9 typedef struct _XFA_NOTSUREATTRIBUTE {\r
10     XFA_ELEMENT                         eElement;\r
11     XFA_ATTRIBUTE                       eAttribute;\r
12     XFA_ATTRIBUTETYPE           eType;\r
13     FX_LPVOID                           pValue;\r
14 } XFA_NOTSUREATTRIBUTE, * XFA_LPNOTSUREATTRIBUTE;\r
15 typedef XFA_NOTSUREATTRIBUTE const * XFA_LPCNOTSUREATTRIBUTE;\r
16 XFA_LPCNOTSUREATTRIBUTE XFA_GetNotsureAttribute(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, XFA_ATTRIBUTETYPE eType = XFA_ATTRIBUTETYPE_NOTSURE);\r
17 class CXFA_WideTextRead : public IFX_Stream\r
18 {\r
19 public:\r
20     CXFA_WideTextRead(const CFX_WideString &wsBuffer);\r
21     virtual void                                Release();\r
22     virtual IFX_Stream*         Retain();\r
23 \r
24     virtual FX_DWORD                    GetAccessModes() const;\r
25     virtual int32_t                     GetLength() const;\r
26     virtual int32_t                     Seek(FX_STREAMSEEK eSeek, int32_t iOffset);\r
27     virtual int32_t                     GetPosition();\r
28     virtual FX_BOOL                             IsEOF() const;\r
29 \r
30     virtual int32_t                     ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)\r
31     {\r
32         return 0;\r
33     }\r
34     virtual int32_t                     ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL);\r
35     virtual int32_t                     WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)\r
36     {\r
37         return 0;\r
38     }\r
39     virtual int32_t                     WriteString(FX_LPCWSTR pStr, int32_t iLength)\r
40     {\r
41         return 0;\r
42     }\r
43     virtual void                                Flush() {}\r
44     virtual FX_BOOL                             SetLength(int32_t iLength)\r
45     {\r
46         return FALSE;\r
47     }\r
48 \r
49     virtual int32_t                     GetBOM(uint8_t bom[4]) const\r
50     {\r
51         return 0;\r
52     }\r
53     virtual FX_WORD                             GetCodePage() const;\r
54     virtual FX_WORD                             SetCodePage(FX_WORD wCodePage);\r
55 \r
56     virtual void                                Lock() {}\r
57     virtual void                                Unlock() {}\r
58 \r
59     virtual IFX_Stream*         CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength)\r
60     {\r
61         return NULL;\r
62     }\r
63 \r
64     CFX_WideString                              GetSrcText() const\r
65     {\r
66         return m_wsBuffer;\r
67     }\r
68 protected:\r
69     CFX_WideString                              m_wsBuffer;\r
70     int32_t                                     m_iPosition;\r
71     int32_t                                     m_iRefCount;\r
72 };\r
73 #endif\r