Bug 1833854 - Part 6: Round requested nursery before checking range when changing...
[gecko.git] / layout / xul / nsSplitterFrame.h
blob7c582cb4517750cdc0cf7a3e9f87991da8c49cb9
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 //
8 // nsSplitterFrame
9 //
11 #ifndef nsSplitterFrame_h__
12 #define nsSplitterFrame_h__
14 #include "mozilla/Attributes.h"
15 #include "mozilla/RefPtr.h"
16 #include "SimpleXULLeafFrame.h"
18 class nsSplitterFrameInner;
20 namespace mozilla {
21 class PresShell;
22 } // namespace mozilla
24 nsIFrame* NS_NewSplitterFrame(mozilla::PresShell* aPresShell,
25 mozilla::ComputedStyle* aStyle);
27 class nsSplitterFrame final : public mozilla::SimpleXULLeafFrame {
28 public:
29 NS_DECL_FRAMEARENA_HELPERS(nsSplitterFrame)
31 explicit nsSplitterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
32 void DestroyFrom(nsIFrame* aDestructRoot,
33 PostDestroyData& aPostDestroyData) override;
35 #ifdef DEBUG_FRAME_DUMP
36 nsresult GetFrameName(nsAString& aResult) const override {
37 return MakeFrameName(u"SplitterFrame"_ns, aResult);
39 #endif
41 bool IsHorizontal() const { return mIsHorizontal; }
43 // nsIFrame overrides
44 nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
45 int32_t aModType) override;
47 void Init(nsIContent* aContent, nsContainerFrame* aParent,
48 nsIFrame* aPrevInFlow) override;
50 NS_IMETHOD HandlePress(nsPresContext* aPresContext,
51 mozilla::WidgetGUIEvent* aEvent,
52 nsEventStatus* aEventStatus) override;
54 NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext,
55 mozilla::WidgetGUIEvent* aEvent,
56 nsEventStatus* aEventStatus,
57 bool aControlHeld) override;
59 void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
60 const ReflowInput& aReflowInput,
61 nsReflowStatus& aStatus) override;
63 MOZ_CAN_RUN_SCRIPT
64 NS_IMETHOD HandleDrag(nsPresContext* aPresContext,
65 mozilla::WidgetGUIEvent* aEvent,
66 nsEventStatus* aEventStatus) override;
68 NS_IMETHOD HandleRelease(nsPresContext* aPresContext,
69 mozilla::WidgetGUIEvent* aEvent,
70 nsEventStatus* aEventStatus) override;
72 nsresult HandleEvent(nsPresContext* aPresContext,
73 mozilla::WidgetGUIEvent* aEvent,
74 nsEventStatus* aEventStatus) override;
76 void BuildDisplayList(nsDisplayListBuilder* aBuilder,
77 const nsDisplayListSet& aLists) override;
79 private:
80 friend class nsSplitterFrameInner;
81 RefPtr<nsSplitterFrameInner> mInner;
82 bool mIsHorizontal = false;
83 }; // class nsSplitterFrame
85 #endif