nsSplitterFrame.h (2859B)
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/. */ 6 7 // 8 // nsSplitterFrame 9 // 10 11 #ifndef nsSplitterFrame_h__ 12 #define nsSplitterFrame_h__ 13 14 #include "SimpleXULLeafFrame.h" 15 #include "mozilla/Attributes.h" 16 #include "mozilla/RefPtr.h" 17 18 class nsSplitterFrameInner; 19 20 namespace mozilla { 21 class PresShell; 22 } // namespace mozilla 23 24 nsIFrame* NS_NewSplitterFrame(mozilla::PresShell* aPresShell, 25 mozilla::ComputedStyle* aStyle); 26 27 class nsSplitterFrame final : public mozilla::SimpleXULLeafFrame { 28 public: 29 NS_DECL_FRAMEARENA_HELPERS(nsSplitterFrame) 30 31 explicit nsSplitterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext); 32 void Destroy(DestroyContext&) override; 33 34 #ifdef DEBUG_FRAME_DUMP 35 nsresult GetFrameName(nsAString& aResult) const override { 36 return MakeFrameName(u"SplitterFrame"_ns, aResult); 37 } 38 #endif 39 40 bool IsHorizontal() const { return mIsHorizontal; } 41 42 // nsIFrame overrides 43 nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute, 44 AttrModType aModType) override; 45 46 void Init(nsIContent* aContent, nsContainerFrame* aParent, 47 nsIFrame* aPrevInFlow) override; 48 49 NS_IMETHOD HandlePress(nsPresContext* aPresContext, 50 mozilla::WidgetGUIEvent* aEvent, 51 nsEventStatus* aEventStatus) override; 52 53 NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext, 54 mozilla::WidgetGUIEvent* aEvent, 55 nsEventStatus* aEventStatus, 56 bool aControlHeld) override; 57 58 void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, 59 const ReflowInput& aReflowInput, 60 nsReflowStatus& aStatus) override; 61 62 MOZ_CAN_RUN_SCRIPT 63 NS_IMETHOD HandleDrag(nsPresContext* aPresContext, 64 mozilla::WidgetGUIEvent* aEvent, 65 nsEventStatus* aEventStatus) override; 66 67 NS_IMETHOD HandleRelease(nsPresContext* aPresContext, 68 mozilla::WidgetGUIEvent* aEvent, 69 nsEventStatus* aEventStatus) override; 70 71 nsresult HandleEvent(nsPresContext* aPresContext, 72 mozilla::WidgetGUIEvent* aEvent, 73 nsEventStatus* aEventStatus) override; 74 75 void BuildDisplayList(nsDisplayListBuilder* aBuilder, 76 const nsDisplayListSet& aLists) override; 77 78 private: 79 friend class nsSplitterFrameInner; 80 RefPtr<nsSplitterFrameInner> mInner; 81 bool mIsHorizontal = false; 82 }; // class nsSplitterFrame 83 84 #endif