2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#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"
|
2002-09-07 09:38:16 +04:00
|
|
|
#include "nsITimer.h"
|
2008-02-15 05:04:34 +03:00
|
|
|
#include "nsRepeatService.h"
|
1999-06-15 08:02:43 +04:00
|
|
|
|
|
|
|
class nsSliderFrame;
|
|
|
|
|
2008-02-15 05:04:34 +03:00
|
|
|
class nsScrollbarButtonFrame : public nsButtonBoxFrame
|
1999-06-15 08:02:43 +04:00
|
|
|
{
|
|
|
|
public:
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2015-01-06 12:27:56 +03:00
|
|
|
explicit nsScrollbarButtonFrame(nsStyleContext* aContext):
|
|
|
|
nsButtonBoxFrame(aContext), mCursorOnThis(false) {}
|
1999-06-15 08:02:43 +04:00
|
|
|
|
1999-08-29 14:51:15 +04:00
|
|
|
// Overrides
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
1999-08-29 14:51:15 +04:00
|
|
|
|
2006-07-18 21:01:40 +04:00
|
|
|
friend nsIFrame* NS_NewScrollbarButtonFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
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,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
1999-06-15 08:02:43 +04:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
static nsresult GetChildWithTag(nsPresContext* aPresContext,
|
2000-01-22 04:16:50 +03:00
|
|
|
nsIAtom* atom, nsIFrame* start, nsIFrame*& result);
|
1999-06-15 08:02:43 +04:00
|
|
|
static nsresult GetParentWithTag(nsIAtom* atom, nsIFrame* start, nsIFrame*& result);
|
|
|
|
|
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,
|
|
|
|
bool aControlHeld) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
1999-08-20 02:16:23 +04:00
|
|
|
|
2011-08-03 07:39:02 +04:00
|
|
|
NS_IMETHOD HandleDrag(nsPresContext* aPresContext,
|
2013-10-02 07:46:03 +04:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
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,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
1999-08-20 02:16:23 +04:00
|
|
|
|
1999-06-15 08:02:43 +04:00
|
|
|
protected:
|
2013-10-02 07:46:03 +04:00
|
|
|
virtual void MouseClicked(nsPresContext* aPresContext,
|
|
|
|
mozilla::WidgetGUIEvent* aEvent) MOZ_OVERRIDE;
|
1999-06-15 08:02:43 +04:00
|
|
|
|
2008-02-15 05:04:34 +03:00
|
|
|
void StartRepeat() {
|
|
|
|
nsRepeatService::GetInstance()->Start(Notify, this);
|
|
|
|
}
|
|
|
|
void StopRepeat() {
|
|
|
|
nsRepeatService::GetInstance()->Stop(Notify, this);
|
|
|
|
}
|
|
|
|
void Notify();
|
|
|
|
static void Notify(void* aData) {
|
|
|
|
static_cast<nsScrollbarButtonFrame*>(aData)->Notify();
|
|
|
|
}
|
1999-06-15 08:02:43 +04: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
|