1 // Copyright 2016 The PDFium Authors 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 XFA_FXFA_LAYOUT_CXFA_TRAVERSESTRATEGY_LAYOUTITEM_H_ 8 #define XFA_FXFA_LAYOUT_CXFA_TRAVERSESTRATEGY_LAYOUTITEM_H_ 9 10 #include "xfa/fxfa/layout/cxfa_layoutitem.h" 11 #include "xfa/fxfa/parser/cxfa_nodeiteratortemplate.h" 12 13 class CXFA_TraverseStrategy_LayoutItem { 14 public: GetFirstChild(CXFA_LayoutItem * pLayoutItem)15 static CXFA_LayoutItem* GetFirstChild(CXFA_LayoutItem* pLayoutItem) { 16 return pLayoutItem->GetFirstChild(); 17 } GetNextSibling(CXFA_LayoutItem * pLayoutItem)18 static CXFA_LayoutItem* GetNextSibling(CXFA_LayoutItem* pLayoutItem) { 19 return pLayoutItem->GetNextSibling(); 20 } GetParent(CXFA_LayoutItem * pLayoutItem)21 static CXFA_LayoutItem* GetParent(CXFA_LayoutItem* pLayoutItem) { 22 return pLayoutItem->GetParent(); 23 } 24 }; 25 26 using CXFA_LayoutItemIterator = 27 CXFA_NodeIteratorTemplate<CXFA_LayoutItem, 28 CXFA_TraverseStrategy_LayoutItem, 29 CXFA_LayoutItem*>; 30 31 #endif // XFA_FXFA_LAYOUT_CXFA_TRAVERSESTRATEGY_LAYOUTITEM_H_ 32