michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_a11y_XULSelectControlAccessible_h__ michael@0: #define mozilla_a11y_XULSelectControlAccessible_h__ michael@0: michael@0: #include "AccessibleWrap.h" michael@0: #include "nsIDOMXULSelectCntrlEl.h" michael@0: michael@0: namespace mozilla { michael@0: namespace a11y { michael@0: michael@0: /** michael@0: * The basic implementation of accessible selection for XUL select controls. michael@0: */ michael@0: class XULSelectControlAccessible : public AccessibleWrap michael@0: { michael@0: public: michael@0: XULSelectControlAccessible(nsIContent* aContent, DocAccessible* aDoc); michael@0: virtual ~XULSelectControlAccessible() {} michael@0: michael@0: // Accessible michael@0: virtual void Shutdown(); michael@0: michael@0: // SelectAccessible michael@0: virtual already_AddRefed SelectedItems(); michael@0: virtual uint32_t SelectedItemCount(); michael@0: virtual Accessible* GetSelectedItem(uint32_t aIndex); michael@0: virtual bool IsItemSelected(uint32_t aIndex); michael@0: virtual bool AddItemToSelection(uint32_t aIndex); michael@0: virtual bool RemoveItemFromSelection(uint32_t aIndex); michael@0: virtual bool SelectAll(); michael@0: virtual bool UnselectAll(); michael@0: michael@0: // Widgets michael@0: virtual Accessible* CurrentItem(); michael@0: virtual void SetCurrentItem(Accessible* aItem); michael@0: michael@0: protected: michael@0: // nsIDOMXULMultiSelectControlElement inherits from this, so we'll always have michael@0: // one of these if the widget is valid and not defunct michael@0: nsCOMPtr mSelectControl; michael@0: }; michael@0: michael@0: } // namespace a11y michael@0: } // namespace mozilla michael@0: michael@0: #endif michael@0: