1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_ListBoxObject_h
8 #define mozilla_dom_ListBoxObject_h
10 #include "mozilla/dom/BoxObject.h"
11 #include "nsPIListBoxObject.h"
16 class ListBoxObject MOZ_FINAL
: public BoxObject
,
17 public nsPIListBoxObject
20 NS_DECL_ISUPPORTS_INHERITED
21 NS_DECL_NSILISTBOXOBJECT
25 virtual JSObject
* WrapObject(JSContext
* aCx
) MOZ_OVERRIDE
;
28 virtual nsListBoxBodyFrame
* GetListBoxBody(bool aFlush
) MOZ_OVERRIDE
;
31 virtual void Clear() MOZ_OVERRIDE
;
32 virtual void ClearCachedValues() MOZ_OVERRIDE
;
34 // ListBoxObject.webidl
35 int32_t GetRowCount();
36 int32_t GetNumberOfVisibleRows();
37 int32_t GetIndexOfFirstVisibleRow();
38 void EnsureIndexIsVisible(int32_t rowIndex
);
39 void ScrollToIndex(int32_t rowIndex
);
40 void ScrollByLines(int32_t numLines
);
41 already_AddRefed
<Element
> GetItemAtIndex(int32_t index
);
42 int32_t GetIndexOfItem(Element
& item
);
45 nsListBoxBodyFrame
*mListBoxBody
;
52 } // namespace mozilla
54 #endif // mozilla_dom_ListBoxObject_h