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