| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_ | 7 #ifndef XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_ |
| 8 #define XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_ | 8 #define XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_ |
| 9 | 9 |
| 10 #include "xfa/fxfa/parser/cxfa_document.h" | 10 #include "xfa/fxfa/parser/cxfa_document.h" |
| 11 | 11 |
| 12 class CXFA_ContainerLayoutItem; | 12 class CXFA_ContainerLayoutItem; |
| 13 class CXFA_ContentLayoutItem; | 13 class CXFA_ContentLayoutItem; |
| 14 class CXFA_LayoutProcessor; | 14 class CXFA_LayoutProcessor; |
| 15 | 15 |
| 16 void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem); | 16 void XFA_ReleaseLayoutItem(CXFA_LayoutItem* pLayoutItem); |
| 17 | 17 |
| 18 class CXFA_LayoutItem { | 18 class CXFA_LayoutItem { |
| 19 public: | 19 public: |
| 20 virtual ~CXFA_LayoutItem(); | 20 virtual ~CXFA_LayoutItem(); |
| 21 | 21 |
| 22 FX_BOOL IsContainerLayoutItem() const { return !m_bIsContentLayoutItem; } | 22 bool IsContainerLayoutItem() const { return !m_bIsContentLayoutItem; } |
| 23 FX_BOOL IsContentLayoutItem() const { return m_bIsContentLayoutItem; } | 23 bool IsContentLayoutItem() const { return m_bIsContentLayoutItem; } |
| 24 CXFA_ContainerLayoutItem* AsContainerLayoutItem(); | 24 CXFA_ContainerLayoutItem* AsContainerLayoutItem(); |
| 25 CXFA_ContentLayoutItem* AsContentLayoutItem(); | 25 CXFA_ContentLayoutItem* AsContentLayoutItem(); |
| 26 | 26 |
| 27 CXFA_ContainerLayoutItem* GetPage() const; | 27 CXFA_ContainerLayoutItem* GetPage() const; |
| 28 CXFA_Node* GetFormNode() const; | 28 CXFA_Node* GetFormNode() const; |
| 29 void GetRect(CFX_RectF& rtLayout, FX_BOOL bRelative = FALSE) const; | 29 void GetRect(CFX_RectF& rtLayout, bool bRelative = false) const; |
| 30 int32_t GetIndex() const; | 30 int32_t GetIndex() const; |
| 31 int32_t GetCount() const; | 31 int32_t GetCount() const; |
| 32 CXFA_LayoutItem* GetParent() const; | 32 CXFA_LayoutItem* GetParent() const; |
| 33 const CXFA_LayoutItem* GetFirst() const; | 33 const CXFA_LayoutItem* GetFirst() const; |
| 34 CXFA_LayoutItem* GetFirst(); | 34 CXFA_LayoutItem* GetFirst(); |
| 35 const CXFA_LayoutItem* GetLast() const; | 35 const CXFA_LayoutItem* GetLast() const; |
| 36 CXFA_LayoutItem* GetLast(); | 36 CXFA_LayoutItem* GetLast(); |
| 37 CXFA_LayoutItem* GetPrev() const; | 37 CXFA_LayoutItem* GetPrev() const; |
| 38 CXFA_LayoutItem* GetNext() const; | 38 CXFA_LayoutItem* GetNext() const; |
| 39 | 39 |
| 40 void AddChild(CXFA_LayoutItem* pChildItem); | 40 void AddChild(CXFA_LayoutItem* pChildItem); |
| 41 void AddHeadChild(CXFA_LayoutItem* pChildItem); | 41 void AddHeadChild(CXFA_LayoutItem* pChildItem); |
| 42 void RemoveChild(CXFA_LayoutItem* pChildItem); | 42 void RemoveChild(CXFA_LayoutItem* pChildItem); |
| 43 void InsertChild(CXFA_LayoutItem* pBeforeItem, CXFA_LayoutItem* pChildItem); | 43 void InsertChild(CXFA_LayoutItem* pBeforeItem, CXFA_LayoutItem* pChildItem); |
| 44 | 44 |
| 45 CXFA_Node* m_pFormNode; | 45 CXFA_Node* m_pFormNode; |
| 46 CXFA_LayoutItem* m_pParent; | 46 CXFA_LayoutItem* m_pParent; |
| 47 CXFA_LayoutItem* m_pNextSibling; | 47 CXFA_LayoutItem* m_pNextSibling; |
| 48 CXFA_LayoutItem* m_pFirstChild; | 48 CXFA_LayoutItem* m_pFirstChild; |
| 49 | 49 |
| 50 protected: | 50 protected: |
| 51 CXFA_LayoutItem(CXFA_Node* pNode, FX_BOOL bIsContentLayoutItem); | 51 CXFA_LayoutItem(CXFA_Node* pNode, bool bIsContentLayoutItem); |
| 52 | 52 |
| 53 FX_BOOL m_bIsContentLayoutItem; | 53 bool m_bIsContentLayoutItem; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 #endif // XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_ | 56 #endif // XFA_FXFA_PARSER_CXFA_LAYOUTITEM_H_ |
| OLD | NEW |