2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
Eric D Vaughan
|
|
|
|
This class lays out its children either vertically or horizontally
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef nsScrollbarButtonFrame_h___
|
|
|
|
#define nsScrollbarButtonFrame_h___
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsButtonBoxFrame.h"
|
|
|
|
#include "nsITimer.h"
|
2008-02-14 18:04:34 -08:00
|
|
|
#include "nsRepeatService.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsSliderFrame;
|
|
|
|
|
2008-02-14 18:04:34 -08:00
|
|
|
class nsScrollbarButtonFrame : public nsButtonBoxFrame
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsScrollbarButtonFrame(nsIPresShell* aPresShell, nsStyleContext* aContext):
|
2011-11-17 15:41:35 -08:00
|
|
|
nsButtonBoxFrame(aPresShell, aContext), mCursorOnThis(false) {}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Overrides
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
friend nsIFrame* NS_NewScrollbarButtonFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
2014-02-17 23:47:48 -08:00
|
|
|
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
2014-02-18 00:36:33 -08:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsresult GetChildWithTag(nsPresContext* aPresContext,
|
|
|
|
nsIAtom* atom, nsIFrame* start, nsIFrame*& result);
|
|
|
|
static nsresult GetParentWithTag(nsIAtom* atom, nsIFrame* start, nsIFrame*& result);
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool HandleButtonPress(nsPresContext* aPresContext,
|
2013-10-01 20:46:03 -07:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD HandleMultiplePress(nsPresContext* aPresContext,
|
2013-10-01 20:46:03 -07:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus,
|
|
|
|
bool aControlHeld) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-08-02 20:39:02 -07:00
|
|
|
NS_IMETHOD HandleDrag(nsPresContext* aPresContext,
|
2013-10-01 20:46:03 -07:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-08-02 20:39:02 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD HandleRelease(nsPresContext* aPresContext,
|
2013-10-01 20:46:03 -07:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
protected:
|
2013-10-01 20:46:03 -07:00
|
|
|
virtual void MouseClicked(nsPresContext* aPresContext,
|
|
|
|
mozilla::WidgetGUIEvent* aEvent) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-02-14 18:04:34 -08: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();
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-11-17 15:41:35 -08:00
|
|
|
bool mCursorOnThis;
|
2008-02-14 18:04:34 -08:00
|
|
|
};
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#endif
|