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 Destroy(DestroyContext
&) override
;
34 #ifdef DEBUG_FRAME_DUMP
35 nsresult
GetFrameName(nsAString
& aResult
) const override
{
36 return MakeFrameName(u
"SplitterFrame"_ns
, aResult
);
40 bool IsHorizontal() const { return mIsHorizontal
; }
43 nsresult
AttributeChanged(int32_t aNameSpaceID
, nsAtom
* aAttribute
,
44 int32_t aModType
) override
;
46 void Init(nsIContent
* aContent
, nsContainerFrame
* aParent
,
47 nsIFrame
* aPrevInFlow
) override
;
49 NS_IMETHOD
HandlePress(nsPresContext
* aPresContext
,
50 mozilla::WidgetGUIEvent
* aEvent
,
51 nsEventStatus
* aEventStatus
) override
;
53 NS_IMETHOD
HandleMultiplePress(nsPresContext
* aPresContext
,
54 mozilla::WidgetGUIEvent
* aEvent
,
55 nsEventStatus
* aEventStatus
,
56 bool aControlHeld
) override
;
58 void Reflow(nsPresContext
* aPresContext
, ReflowOutput
& aDesiredSize
,
59 const ReflowInput
& aReflowInput
,
60 nsReflowStatus
& aStatus
) override
;
63 NS_IMETHOD
HandleDrag(nsPresContext
* aPresContext
,
64 mozilla::WidgetGUIEvent
* aEvent
,
65 nsEventStatus
* aEventStatus
) override
;
67 NS_IMETHOD
HandleRelease(nsPresContext
* aPresContext
,
68 mozilla::WidgetGUIEvent
* aEvent
,
69 nsEventStatus
* aEventStatus
) override
;
71 nsresult
HandleEvent(nsPresContext
* aPresContext
,
72 mozilla::WidgetGUIEvent
* aEvent
,
73 nsEventStatus
* aEventStatus
) override
;
75 void BuildDisplayList(nsDisplayListBuilder
* aBuilder
,
76 const nsDisplayListSet
& aLists
) override
;
79 friend class nsSplitterFrameInner
;
80 RefPtr
<nsSplitterFrameInner
> mInner
;
81 bool mIsHorizontal
= false;
82 }; // class nsSplitterFrame