2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-06-15 08:02:43 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
Eric D Vaughan
|
|
|
|
This class lays out its children either vertically or horizontally
|
2017-07-06 15:00:35 +03:00
|
|
|
|
1999-06-15 08:02:43 +04:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef nsScrollbarButtonFrame_h___
|
|
|
|
#define nsScrollbarButtonFrame_h___
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2000-03-31 11:02:06 +04:00
|
|
|
#include "nsButtonBoxFrame.h"
|
2008-02-15 05:04:34 +03:00
|
|
|
#include "nsRepeatService.h"
|
1999-06-15 08:02:43 +04:00
|
|
|
|
2019-04-16 10:24:49 +03:00
|
|
|
namespace mozilla {
|
|
|
|
class PresShell;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2017-05-02 04:50:16 +03:00
|
|
|
class nsScrollbarButtonFrame final : public nsButtonBoxFrame {
|
1999-06-15 08:02:43 +04:00
|
|
|
public:
|
2017-05-26 13:11:11 +03:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS(nsScrollbarButtonFrame)
|
2009-09-12 20:49:24 +04:00
|
|
|
|
2019-02-05 19:45:54 +03:00
|
|
|
explicit nsScrollbarButtonFrame(ComputedStyle* aStyle,
|
|
|
|
nsPresContext* aPresContext)
|
|
|
|
: nsButtonBoxFrame(aStyle, aPresContext, kClassID),
|
|
|
|
mCursorOnThis(false) {}
|
1999-06-15 08:02:43 +04:00
|
|
|
|
1999-08-29 14:51:15 +04:00
|
|
|
// Overrides
|
2017-11-07 03:20:33 +03:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
|
|
|
PostDestroyData& aPostDestroyData) override;
|
1999-08-29 14:51:15 +04:00
|
|
|
|
2019-04-16 10:24:49 +03:00
|
|
|
friend nsIFrame* NS_NewScrollbarButtonFrame(mozilla::PresShell* aPresShell,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyle* aStyle);
|
1999-06-15 08:02:43 +04:00
|
|
|
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
2014-02-18 12:36:33 +04:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsEventStatus* aEventStatus) override;
|
1999-06-15 08:02:43 +04:00
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
static nsresult GetChildWithTag(nsAtom* atom, nsIFrame* start,
|
|
|
|
nsIFrame*& result);
|
|
|
|
static nsresult GetParentWithTag(nsAtom* atom, nsIFrame* start,
|
|
|
|
nsIFrame*& result);
|
1999-06-15 08:02:43 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool HandleButtonPress(nsPresContext* aPresContext,
|
2013-10-02 07:46:03 +04:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus);
|
1999-08-20 02:16:23 +04:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext,
|
2013-10-02 07:46:03 +04:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aControlHeld) override {
|
2013-10-02 07:46:03 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
2019-05-06 16:57:46 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2011-08-03 07:39:02 +04:00
|
|
|
NS_IMETHOD HandleDrag(nsPresContext* aPresContext,
|
2013-10-02 07:46:03 +04:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsEventStatus* aEventStatus) override {
|
2013-10-02 07:46:03 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-08-03 07:39:02 +04:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD HandleRelease(nsPresContext* aPresContext,
|
2013-10-02 07:46:03 +04:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsEventStatus* aEventStatus) override;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-06-15 08:02:43 +04:00
|
|
|
protected:
|
2008-02-15 05:04:34 +03:00
|
|
|
void StartRepeat() {
|
2017-03-29 11:32:52 +03:00
|
|
|
nsRepeatService::GetInstance()->Start(Notify, this, mContent->OwnerDoc(),
|
|
|
|
"nsScrollbarButtonFrame"_ns);
|
2008-02-15 05:04:34 +03:00
|
|
|
}
|
|
|
|
void StopRepeat() { nsRepeatService::GetInstance()->Stop(Notify, this); }
|
|
|
|
void Notify();
|
|
|
|
static void Notify(void* aData) {
|
|
|
|
static_cast<nsScrollbarButtonFrame*>(aData)->Notify();
|
|
|
|
}
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2011-11-18 03:41:35 +04:00
|
|
|
bool mCursorOnThis;
|
2008-02-15 05:04:34 +03:00
|
|
|
};
|
1999-06-15 08:02:43 +04:00
|
|
|
|
|
|
|
#endif
|