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/. */
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
;
22 } // namespace mozilla
24 nsIFrame
* NS_NewSplitterFrame(mozilla::PresShell
* aPresShell
,
25 mozilla::ComputedStyle
* aStyle
);
27 class nsSplitterFrame final
: public mozilla::SimpleXULLeafFrame
{
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
);
41 bool IsHorizontal() const { return mIsHorizontal
; }
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
;
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
;
80 friend class nsSplitterFrameInner
;
81 RefPtr
<nsSplitterFrameInner
> mInner
;
82 bool mIsHorizontal
= false;
83 }; // class nsSplitterFrame