2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
class nsSliderFrame;
|
|
|
|
|
2008-02-15 02:04:34 +00:00
|
|
|
class nsScrollbarButtonFrame : public nsButtonBoxFrame
|
1999-06-15 04:02:43 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2006-03-26 21:30:36 +00:00
|
|
|
nsScrollbarButtonFrame(nsIPresShell* aPresShell, nsStyleContext* aContext):
|
2011-11-17 23:41:35 +00:00
|
|
|
nsButtonBoxFrame(aPresShell, aContext), mCursorOnThis(false) {}
|
1999-06-15 04:02:43 +00:00
|
|
|
|
1999-08-29 10:51:15 +00:00
|
|
|
// Overrides
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
1999-08-29 10:51:15 +00:00
|
|
|
|
2006-07-18 17:01:40 +00:00
|
|
|
friend nsIFrame* NS_NewScrollbarButtonFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-06-15 04:02:43 +00:00
|
|
|
|
2013-10-02 03:46:03 +00:00
|
|
|
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
|
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
2012-09-14 16:10:08 +00:00
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
1999-06-15 04:02:43 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
static nsresult GetChildWithTag(nsPresContext* aPresContext,
|
2000-01-22 01:16:50 +00:00
|
|
|
nsIAtom* atom, nsIFrame* start, nsIFrame*& result);
|
1999-06-15 04:02:43 +00:00
|
|
|
static nsresult GetParentWithTag(nsIAtom* atom, nsIFrame* start, nsIFrame*& result);
|
|
|
|
|
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,
|
|
|
|
bool aControlHeld) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
1999-08-19 22:16:23 +00:00
|
|
|
|
2011-08-03 03:39:02 +00:00
|
|
|
NS_IMETHOD HandleDrag(nsPresContext* aPresContext,
|
2013-10-02 03:46:03 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
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,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
1999-08-19 22:16:23 +00:00
|
|
|
|
1999-06-15 04:02:43 +00:00
|
|
|
protected:
|
2013-10-02 03:46:03 +00:00
|
|
|
virtual void MouseClicked(nsPresContext* aPresContext,
|
|
|
|
mozilla::WidgetGUIEvent* aEvent) MOZ_OVERRIDE;
|
2011-09-29 06:19:26 +00:00
|
|
|
void DoButtonAction(bool aSmoothScroll);
|
1999-06-15 04:02:43 +00:00
|
|
|
|
2008-02-15 02:04:34 +00: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 04:02:43 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mIncrement;
|
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
|