layout/base/nsIFrameTraversal.h
author Daniel Holbert <dholbert@cs.stanford.edu>
Fri, 27 Oct 2017 10:33:53 -0700
changeset 388808 905239391e05483e8fb221378dd2092c5a0df8b7
parent 252503 c4753659cf72fac4c4abf1a6980d0ed587c26c61
child 448947 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame This patch was generated automatically by the "modeline.py" script, available here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py For every file that is modified in this patch, the changes are as follows: (1) The patch changes the file to use the exact C++ mode lines from the Mozilla coding style guide, available here: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line (2) The patch deletes any blank lines between the mode line & the MPL boilerplate comment. (3) If the file previously had the mode lines and MPL boilerplate in a single contiguous C++ comment, then the patch splits them into separate C++ comments, to match the boilerplate in the coding style. MozReview-Commit-ID: EuRsDue63tK

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NSIFRAMETRAVERSAL_H
#define NSIFRAMETRAVERSAL_H

#include "nsISupports.h"
#include "nsIFrame.h"

#define NS_IFRAMEENUMERATOR_IID \
{ 0x7c633f5d, 0x91eb, 0x494e, \
  { 0xa1, 0x40, 0x17, 0x46, 0x17, 0x4c, 0x23, 0xd3 } }

class nsIFrameEnumerator : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMEENUMERATOR_IID)

  virtual void First() = 0;
  virtual void Next() = 0;
  virtual nsIFrame* CurrentItem() = 0;
  virtual bool IsDone() = 0;

  virtual void Last() = 0;
  virtual void Prev() = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameEnumerator, NS_IFRAMEENUMERATOR_IID)

enum nsIteratorType {
  eLeaf,
  ePreOrder,
  ePostOrder
};

// {d33fe76c-207c-4359-a315-8eb1eecf80e5}
#define NS_IFRAMETRAVERSAL_IID \
{ 0xd33fe76c, 0x207c, 0x4359, { 0xa3, 0x15, 0x8e, 0xb1, 0xee, 0xcf, 0x80, 0xe5 } }

class nsIFrameTraversal : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMETRAVERSAL_IID)

  /**
   * Create a frame iterator with the specified properties.
   * @param aEnumerator [out] the created iterator
   * @param aPresContext [in]
   * @param aStart [in] the frame to start iterating from
   * @param aType [in] the type of the iterator: leaf, pre-order, or post-order
   * @param aVisual [in] whether the iterator should traverse frames in visual
   *        bidi order
   * @param aLockInScrollView [in] whether to stop iterating when exiting a
   *        scroll view
   * @param aFollowOOFs [in] whether the iterator should follow out-of-flows.
   *        If true, when reaching a placeholder frame while going down will get
   *        the real frame. Going back up will go on past the placeholder,
   *        so the placeholders are logically part of the frame tree.
   * @param aSkipPopupChecks [in] if false, then don't iterate into or out of a
   *        popup frame. If true, skip any popup related checks.
   */
  NS_IMETHOD NewFrameTraversal(nsIFrameEnumerator **aEnumerator,
                               nsPresContext* aPresContext,
                               nsIFrame *aStart,
                               int32_t aType,
                               bool aVisual,
                               bool aLockInScrollView,
                               bool aFollowOOFs,
                               bool aSkipPopupChecks) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameTraversal, NS_IFRAMETRAVERSAL_IID)

#endif //NSIFRAMETRAVERSAL_H