2017-10-27 17:33:53 +00: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 11:12:37 +00: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 04:02:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
Eric D Vaughan
|
|
|
|
This class lays out its children either vertically or horizontally
|
2017-07-06 12:00:35 +00:00
|
|
|
|
1999-06-15 04:02:43 +00:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef nsScrollbarButtonFrame_h___
|
|
|
|
#define nsScrollbarButtonFrame_h___
|
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2000-03-31 07:02:06 +00:00
|
|
|
#include "nsButtonBoxFrame.h"
|
2002-09-07 05:38:16 +00:00
|
|
|
#include "nsITimer.h"
|
2008-02-15 02:04:34 +00:00
|
|
|
#include "nsRepeatService.h"
|
1999-06-15 04:02:43 +00:00
|
|
|
|
2019-04-16 07:24:49 +00:00
|
|
|
namespace mozilla {
|
|
|
|
class PresShell;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2017-05-02 01:50:16 +00:00
|
|
|
class nsScrollbarButtonFrame final : public nsButtonBoxFrame {
|
1999-06-15 04:02:43 +00:00
|
|
|
public:
|
2017-05-26 10:11:11 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS(nsScrollbarButtonFrame)
|
2009-09-12 16:49:24 +00:00
|
|
|
|
2019-02-05 16:45:54 +00:00
|
|
|
explicit nsScrollbarButtonFrame(ComputedStyle* aStyle,
|
|
|
|
nsPresContext* aPresContext)
|
|
|
|
: nsButtonBoxFrame(aStyle, aPresContext, kClassID),
|
|
|
|
mCursorOnThis(false) {}
|
1999-06-15 04:02:43 +00:00
|
|
|
|
1999-08-29 10:51:15 +00:00
|
|
|
// Overrides
|
2017-11-07 00:20:33 +00:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
|
|
|
PostDestroyData& aPostDestroyData) override;
|
1999-08-29 10:51:15 +00:00
|
|
|
|
2019-04-16 07:24:49 +00:00
|
|
|
friend nsIFrame* NS_NewScrollbarButtonFrame(mozilla::PresShell* aPresShell,
|
2018-03-22 18:20:41 +00:00
|
|
|
ComputedStyle* aStyle);
|
1999-06-15 04:02:43 +00:00
|
|
|
|
2014-02-18 07:47:48 +00:00
|
|
|
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
2014-02-18 08:36:33 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsEventStatus* aEventStatus) override;
|
1999-06-15 04:02:43 +00:00
|
|
|
|
2017-10-02 22:05:19 +00:00
|
|
|
static nsresult GetChildWithTag(nsAtom* atom, nsIFrame* start,
|
|
|
|
nsIFrame*& result);
|
|
|
|
static nsresult GetParentWithTag(nsAtom* atom, nsIFrame* start,
|
|
|
|
nsIFrame*& result);
|
1999-06-15 04:02:43 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool HandleButtonPress(nsPresContext* aPresContext,
|
2013-10-02 03:46:03 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus);
|
1999-08-19 22:16:23 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext,
|
2013-10-02 03:46:03 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus,
|
2015-03-21 16:28:04 +00:00
|
|
|
bool aControlHeld) override {
|
2013-10-02 03:46:03 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
1999-08-19 22:16:23 +00:00
|
|
|
|
2019-05-06 13:57:46 +00:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2011-08-03 03:39:02 +00:00
|
|
|
NS_IMETHOD HandleDrag(nsPresContext* aPresContext,
|
2013-10-02 03:46:03 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsEventStatus* aEventStatus) override {
|
2013-10-02 03:46:03 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-08-03 03:39:02 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD HandleRelease(nsPresContext* aPresContext,
|
2013-10-02 03:46:03 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsEventStatus* aEventStatus) override;
|
1999-08-19 22:16:23 +00:00
|
|
|
|
1999-06-15 04:02:43 +00:00
|
|
|
protected:
|
2008-02-15 02:04:34 +00:00
|
|
|
void StartRepeat() {
|
2017-03-29 08:32:52 +00:00
|
|
|
nsRepeatService::GetInstance()->Start(
|
2017-03-29 08:40:05 +00:00
|
|
|
Notify, this, mContent->OwnerDoc(),
|
2017-03-29 08:32:52 +00:00
|
|
|
NS_LITERAL_CSTRING("nsScrollbarButtonFrame"));
|
2008-02-15 02:04:34 +00:00
|
|
|
}
|
|
|
|
void StopRepeat() { nsRepeatService::GetInstance()->Stop(Notify, this); }
|
|
|
|
void Notify();
|
|
|
|
static void Notify(void* aData) {
|
|
|
|
static_cast<nsScrollbarButtonFrame*>(aData)->Notify();
|
|
|
|
}
|
2017-07-06 12:00:35 +00:00
|
|
|
|
2011-11-17 23:41:35 +00:00
|
|
|
bool mCursorOnThis;
|
2008-02-15 02:04:34 +00:00
|
|
|
};
|
1999-06-15 04:02:43 +00:00
|
|
|
|
|
|
|
#endif
|