accessible/src/xul/XULSelectControlAccessible.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/src/xul/XULSelectControlAccessible.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef mozilla_a11y_XULSelectControlAccessible_h__
    1.11 +#define mozilla_a11y_XULSelectControlAccessible_h__
    1.12 +
    1.13 +#include "AccessibleWrap.h"
    1.14 +#include "nsIDOMXULSelectCntrlEl.h"
    1.15 +
    1.16 +namespace mozilla {
    1.17 +namespace a11y {
    1.18 +
    1.19 +/**
    1.20 + * The basic implementation of accessible selection for XUL select controls.
    1.21 + */
    1.22 +class XULSelectControlAccessible : public AccessibleWrap
    1.23 +{
    1.24 +public:
    1.25 +  XULSelectControlAccessible(nsIContent* aContent, DocAccessible* aDoc);
    1.26 +  virtual ~XULSelectControlAccessible() {}
    1.27 +
    1.28 +  // Accessible
    1.29 +  virtual void Shutdown();
    1.30 +
    1.31 +  // SelectAccessible
    1.32 +  virtual already_AddRefed<nsIArray> SelectedItems();
    1.33 +  virtual uint32_t SelectedItemCount();
    1.34 +  virtual Accessible* GetSelectedItem(uint32_t aIndex);
    1.35 +  virtual bool IsItemSelected(uint32_t aIndex);
    1.36 +  virtual bool AddItemToSelection(uint32_t aIndex);
    1.37 +  virtual bool RemoveItemFromSelection(uint32_t aIndex);
    1.38 +  virtual bool SelectAll();
    1.39 +  virtual bool UnselectAll();
    1.40 +
    1.41 +  // Widgets
    1.42 +  virtual Accessible* CurrentItem();
    1.43 +  virtual void SetCurrentItem(Accessible* aItem);
    1.44 +
    1.45 +protected:
    1.46 +  // nsIDOMXULMultiSelectControlElement inherits from this, so we'll always have
    1.47 +  // one of these if the widget is valid and not defunct
    1.48 +  nsCOMPtr<nsIDOMXULSelectControlElement> mSelectControl;
    1.49 +};
    1.50 +
    1.51 +} // namespace a11y
    1.52 +} // namespace mozilla
    1.53 +
    1.54 +#endif
    1.55 +

mercurial