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 "nsBoxFrame.h"
18 class nsSplitterFrameInner
;
22 } // namespace mozilla
24 nsIFrame
* NS_NewSplitterFrame(mozilla::PresShell
* aPresShell
,
25 mozilla::ComputedStyle
* aStyle
);
27 class nsSplitterFrame final
: public nsBoxFrame
{
29 NS_DECL_FRAMEARENA_HELPERS(nsSplitterFrame
)
31 explicit nsSplitterFrame(ComputedStyle
* aStyle
, nsPresContext
* aPresContext
);
32 virtual void DestroyFrom(nsIFrame
* aDestructRoot
,
33 PostDestroyData
& aPostDestroyData
) override
;
35 #ifdef DEBUG_FRAME_DUMP
36 virtual nsresult
GetFrameName(nsAString
& aResult
) const override
{
37 return MakeFrameName(u
"SplitterFrame"_ns
, aResult
);
42 virtual nsresult
AttributeChanged(int32_t aNameSpaceID
, nsAtom
* aAttribute
,
43 int32_t aModType
) override
;
45 virtual void Init(nsIContent
* aContent
, nsContainerFrame
* aParent
,
46 nsIFrame
* aPrevInFlow
) override
;
48 NS_IMETHOD
DoXULLayout(nsBoxLayoutState
& aBoxLayoutState
) 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
;
60 NS_IMETHOD
HandleDrag(nsPresContext
* aPresContext
,
61 mozilla::WidgetGUIEvent
* aEvent
,
62 nsEventStatus
* aEventStatus
) override
;
64 NS_IMETHOD
HandleRelease(nsPresContext
* aPresContext
,
65 mozilla::WidgetGUIEvent
* aEvent
,
66 nsEventStatus
* aEventStatus
) override
;
68 virtual nsresult
HandleEvent(nsPresContext
* aPresContext
,
69 mozilla::WidgetGUIEvent
* aEvent
,
70 nsEventStatus
* aEventStatus
) override
;
72 virtual void BuildDisplayList(nsDisplayListBuilder
* aBuilder
,
73 const nsDisplayListSet
& aLists
) override
;
75 virtual void GetInitialOrientation(bool& aIsHorizontal
) override
;
78 friend class nsSplitterFrameInner
;
79 RefPtr
<nsSplitterFrameInner
> mInner
;
81 }; // class nsSplitterFrame