michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef NSIFRAMETRAVERSAL_H michael@0: #define NSIFRAMETRAVERSAL_H michael@0: michael@0: #include "nsISupports.h" michael@0: #include "nsIFrame.h" michael@0: michael@0: #define NS_IFRAMEENUMERATOR_IID \ michael@0: { 0x7c633f5d, 0x91eb, 0x494e, \ michael@0: { 0xa1, 0x40, 0x17, 0x46, 0x17, 0x4c, 0x23, 0xd3 } } michael@0: michael@0: class nsIFrameEnumerator : public nsISupports michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMEENUMERATOR_IID) michael@0: michael@0: virtual void First() = 0; michael@0: virtual void Next() = 0; michael@0: virtual nsIFrame* CurrentItem() = 0; michael@0: virtual bool IsDone() = 0; michael@0: michael@0: virtual void Last() = 0; michael@0: virtual void Prev() = 0; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameEnumerator, NS_IFRAMEENUMERATOR_IID) michael@0: michael@0: enum nsIteratorType { michael@0: eLeaf, michael@0: ePreOrder, michael@0: ePostOrder michael@0: }; michael@0: michael@0: // {9d469828-9bf2-4151-a385-05f30219221b} michael@0: #define NS_IFRAMETRAVERSAL_IID \ michael@0: { 0x9d469828, 0x9bf2, 0x4151, { 0xa3, 0x85, 0x05, 0xf3, 0x02, 0x19, 0x22, 0x1b } } michael@0: michael@0: class nsIFrameTraversal : public nsISupports michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMETRAVERSAL_IID) michael@0: michael@0: /** michael@0: * Create a frame iterator with the specified properties. michael@0: * @param aEnumerator [out] the created iterator michael@0: * @param aPresContext [in] michael@0: * @param aStart [in] the frame to start iterating from michael@0: * @param aType [in] the type of the iterator: leaf, pre-order, or post-order michael@0: * @param aVisual [in] whether the iterator should traverse frames in visual michael@0: * bidi order michael@0: * @param aLockInScrollView [in] whether to stop iterating when exiting a michael@0: * scroll view michael@0: * @param aFollowOOFs [in] whether the iterator should follow out-of-flows. michael@0: * If true, when reaching a placeholder frame while going down will get michael@0: * the real frame. Going back up will go on past the placeholder, michael@0: * so the placeholders are logically part of the frame tree. michael@0: */ michael@0: NS_IMETHOD NewFrameTraversal(nsIFrameEnumerator **aEnumerator, michael@0: nsPresContext* aPresContext, michael@0: nsIFrame *aStart, michael@0: int32_t aType, michael@0: bool aVisual, michael@0: bool aLockInScrollView, michael@0: bool aFollowOOFs) = 0; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameTraversal, NS_IFRAMETRAVERSAL_IID) michael@0: michael@0: #endif //NSIFRAMETRAVERSAL_H