accessible/src/xul/nsXULSliderAccessible.h
author Sean Stangl <sstangl@mozilla.com>
Mon, 04 Jun 2012 13:30:29 -0700
changeset 106267 56ba58a77e8f11cff724a9ddb50839a0c5663e2c
parent 106264 474d3f16960fb6bc790f0f46b77d0248424b84ef
parent 95738 af83ecf3ee15bf7a44d9cf159133953331a58824
permissions -rw-r--r--
Merge m-c to Ionmonkey.

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */

#ifndef _nsXULSliderAccessible_H_
#define _nsXULSliderAccessible_H_

#include "AccessibleWrap.h"

#include "nsIDOMElement.h"

/**
 * Used for XUL slider and scale elements.
 */
class nsXULSliderAccessible : public AccessibleWrap
{
public:
  nsXULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc);

  // nsISupports
  NS_DECL_ISUPPORTS_INHERITED

  // nsIAccessible
  NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
  NS_IMETHOD DoAction(PRUint8 aIndex);

  // nsIAccessibleValue
  NS_DECL_NSIACCESSIBLEVALUE

  // Accessible
  virtual void Value(nsString& aValue);
  virtual mozilla::a11y::role NativeRole();
  virtual PRUint64 NativeInteractiveState() const;
  virtual bool NativelyUnavailable() const;
  virtual bool CanHaveAnonChildren();

  // ActionAccessible
  virtual PRUint8 ActionCount();

protected:
  /**
   * Return anonymous slider element.
   */
  nsIContent* GetSliderElement() const;

  nsresult GetSliderAttr(nsIAtom *aName, nsAString& aValue);
  nsresult SetSliderAttr(nsIAtom *aName, const nsAString& aValue);

  nsresult GetSliderAttr(nsIAtom *aName, double *aValue);
  nsresult SetSliderAttr(nsIAtom *aName, double aValue);

private:
  mutable nsCOMPtr<nsIContent> mSliderNode;
};


/**
 * Used for slider's thumb element.
 */
class nsXULThumbAccessible : public AccessibleWrap
{
public:
  nsXULThumbAccessible(nsIContent* aContent, DocAccessible* aDoc);

  // Accessible
  virtual mozilla::a11y::role NativeRole();
};

#endif