2013-12-12 01:15:15 +04:00
|
|
|
/*
|
2014-06-04 19:57:42 +04:00
|
|
|
* Copyright 2013 Haiku, Inc. All rights reserved.
|
2013-12-12 01:15:15 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* John Scipione, jscipione@gmail.com
|
|
|
|
*
|
|
|
|
* Corresponds to:
|
|
|
|
* headers/os/interface/OutlineListView.h hrev46526
|
|
|
|
* src/kits/interface/OutlineListView.cpp hrev46526
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\file OutlineListView.h
|
|
|
|
\ingroup interface
|
|
|
|
\ingroup libbe
|
|
|
|
\brief Provides the BOutlineListView class.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\class BOutlineListView
|
|
|
|
\ingroup interface
|
|
|
|
\ingroup libbe
|
|
|
|
\brief Expands upon BListView to display a hierarchical list of items.
|
|
|
|
|
|
|
|
Items with subitems underneath them are called super items and are drawn
|
|
|
|
with a small arrow to the left of their label. The label faces right if
|
|
|
|
the item is collapsed and faces down if the item is expanded.
|
|
|
|
|
|
|
|
An example of an outline list view looks like this:
|
|
|
|
|
|
|
|
\image html BOutlineListView_example.png
|
|
|
|
|
|
|
|
\see BListView for more info on how to use a list view, most of which also
|
|
|
|
applies to an outline list view.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BOutlineListView::BOutlineListView(BRect frame, const char* name,
|
|
|
|
list_view_type type, uint32 resizingMode, uint32 flags)
|
|
|
|
\brief Creates a new BOutlineListView object.
|
|
|
|
|
|
|
|
\param frame The \a frame rectangle to create the view in.
|
|
|
|
\param name The name of the view.
|
|
|
|
\param type Whether the list view supports a single selection or multiple
|
|
|
|
selections.
|
|
|
|
\param resizingMode The resizing mode flags. See BView for details.
|
|
|
|
\param flags The view flags. See BView for details.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BOutlineListView::BOutlineListView(const char* name,
|
|
|
|
list_view_type type, uint32 flags)
|
|
|
|
\brief Creates a new BOutlineListView object suitable for use in a BLayout.
|
|
|
|
|
|
|
|
\param name The name of the view.
|
|
|
|
\param type Whether the list view supports a single selection or multiple
|
|
|
|
selections.
|
|
|
|
\param flags The view flags. See BView for details.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BOutlineListView::BOutlineListView(BMessage* archive)
|
|
|
|
\brief Creates a BOutlineListView object from the \a archive message.
|
|
|
|
|
|
|
|
\param archive The message to create the object from.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BOutlineListView::~BOutlineListView()
|
|
|
|
\brief Delete the outline BOutlineListView object and free the memory used
|
|
|
|
by it.
|
|
|
|
|
|
|
|
This method does not free the attached list items.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\name Archiving
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BArchivable* BOutlineListView::Instantiate(BMessage* archive)
|
|
|
|
\brief Create a new BOutlineListView object from the message \a archive.
|
|
|
|
|
|
|
|
\param archive The message to create the object from.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn status_t BOutlineListView::Archive(BMessage* archive, bool deep) const
|
|
|
|
\brief Archive the BOutlineListView object to a message.
|
|
|
|
|
|
|
|
\param archive The message to archive the object to.
|
|
|
|
\param deep \c true to archive child views.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2014-06-14 01:25:02 +04:00
|
|
|
\name Hook Methods
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::AllAttached()
|
2014-06-14 01:25:02 +04:00
|
|
|
\copydoc BView::AllAttached()
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::AllDetached()
|
2014-06-14 01:25:02 +04:00
|
|
|
\copydoc BView::AllDetached()
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::DetachedFromWindow()
|
|
|
|
\brief Hook method that is called when the outline list view is removed from
|
|
|
|
the view hierarchy.
|
|
|
|
|
2014-06-14 01:25:02 +04:00
|
|
|
\copydetails BView::DetachedFromWindow()
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2014-06-14 01:25:02 +04:00
|
|
|
\fn void BOutlineListView::FrameMoved(BPoint newPosition)
|
2013-12-12 01:15:15 +04:00
|
|
|
\brief Hook method called when the outline list view is moved.
|
|
|
|
|
2014-06-14 01:25:02 +04:00
|
|
|
\copydetails BView::FrameMoved()
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2014-06-14 01:25:02 +04:00
|
|
|
\fn void BOutlineListView::FrameResized(float newWidth, float newHeight)
|
2013-12-12 01:15:15 +04:00
|
|
|
\brief Hook method called when the outline list view is resized.
|
|
|
|
|
2014-06-14 01:25:02 +04:00
|
|
|
\copydetails BView::FrameResized()
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::KeyDown(const char* bytes, int32 numBytes)
|
|
|
|
\brief Hook method that is called when a key is pressed while the view is
|
|
|
|
the focus view of the active window.
|
|
|
|
|
|
|
|
Responds to arrow keys to provide the ability to navigate the outline list
|
|
|
|
or to expand or collapse sections of the outline. Inherits the keys
|
|
|
|
recognized by BListView.
|
|
|
|
|
|
|
|
The following keys are used by the outline list view by default:
|
|
|
|
- Right Arrow Expands the selected item.
|
|
|
|
- Left Arrow Collapses the selected item.
|
|
|
|
|
|
|
|
\param bytes The bytes of the key combination pressed.
|
|
|
|
\param numBytes The number of bytes in \a bytes.
|
|
|
|
|
|
|
|
\see BListView::KeyDown()
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::MessageReceived(BMessage* message)
|
|
|
|
\brief Hook method called when a message is received by the outline list
|
|
|
|
view.
|
|
|
|
|
2014-06-14 01:25:02 +04:00
|
|
|
\copydetails BView::MessageReceived()
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::MouseDown(BPoint where)
|
|
|
|
\brief Hook method called when a mouse button is pressed while the cursor
|
|
|
|
is contained in the frame of the outline list view.
|
|
|
|
|
|
|
|
Responds to mouse clicks expanding or collapsing sections of the outline
|
|
|
|
when the user clicks on a latch.
|
|
|
|
|
|
|
|
\param where The point on the screen where to mouse pointer is when
|
|
|
|
the mouse button is pressed.
|
|
|
|
|
|
|
|
\see BListView::MouseDown()
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::MouseUp(BPoint where)
|
|
|
|
\brief Hook method that is called when a mouse button is released while
|
|
|
|
the cursor is contained in the frame of the outline list view.
|
|
|
|
|
2014-06-14 01:25:02 +04:00
|
|
|
\copydetails BView::MouseUp()
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2014-06-14 01:25:02 +04:00
|
|
|
\name Adding/Removing Items
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::AddUnder(BListItem* item, BListItem* superItem)
|
|
|
|
\brief Adds the \a item one level deeper and immediately after \a superItem.
|
|
|
|
|
|
|
|
\param item The \a item to add.
|
|
|
|
\param superItem The item to add under, if \c NULL adds to end.
|
|
|
|
|
|
|
|
\return \c true if the \a item was added, \c false otherwise.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::AddItem(BListItem* item)
|
|
|
|
\brief Adds the \a item to the end of the list.
|
|
|
|
|
|
|
|
\param item The \a item to add.
|
|
|
|
|
|
|
|
\return \c true if the \a item was added, \c false otherwise.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::AddItem(BListItem* item, int32 fullListIndex)
|
|
|
|
\brief Adds the \a item at \a fullListIndex.
|
|
|
|
|
|
|
|
\param item The \a item to add.
|
|
|
|
\param fullListIndex The index to add \a item at.
|
|
|
|
|
|
|
|
\return \c true if the \a item was added, \c false otherwise.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::AddList(BList* newItems)
|
|
|
|
\brief Adds a list of items to the end of the list.
|
|
|
|
|
|
|
|
\param newItems The list of items to add.
|
|
|
|
|
|
|
|
\return \c true if the items was added, \c false otherwise.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::AddList(BList* newItems, int32 fullListIndex)
|
|
|
|
\brief Adds a list of items at \a fullListIndex
|
|
|
|
|
|
|
|
\param newItems The list of items to add.
|
|
|
|
\param fullListIndex The index to add \a item at.
|
|
|
|
|
|
|
|
\return \c true if the items was added, \c false otherwise.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::RemoveItem(BListItem* item)
|
|
|
|
\brief Removes the \a item from the list.
|
|
|
|
|
|
|
|
\param item The \a item to remove.
|
|
|
|
|
|
|
|
\return \c true if the \a item was removed, \c false otherwise.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BListItem* BOutlineListView::RemoveItem(int32 fullListIndex)
|
|
|
|
\brief Removes the \a item located at \a fullListIndex from the list.
|
|
|
|
|
|
|
|
\return A pointer to the BListItem removed.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::RemoveItems(int32 fullListIndex, int32 count)
|
|
|
|
\brief Removes \a count items starting at \a fullListIndex from the list.
|
|
|
|
|
|
|
|
\return \c true if the items were removed, \c false otherwise.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2014-06-14 01:25:02 +04:00
|
|
|
\name Full List
|
2013-12-12 01:15:15 +04:00
|
|
|
|
|
|
|
These methods replicate similar methods in BListView except work on the
|
|
|
|
full list.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BListItem* BOutlineListView::FullListItemAt(int32 fullListIndex) const
|
|
|
|
\brief Returns a pointer to the BListItem at \a fullListIndex.
|
|
|
|
|
|
|
|
\return A pointer to the the BListItem at \a fullListIndex or \c NULL if not
|
|
|
|
found.
|
|
|
|
|
|
|
|
\see BListView::ItemAt(int32 index)
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn int32 BOutlineListView::FullListIndexOf(BPoint where) const
|
|
|
|
\brief Returns the full list index of the item at \a where.
|
|
|
|
|
|
|
|
\return The index of the item at \a where or -1 if not found.
|
|
|
|
|
|
|
|
\see BListView::IndexOf(BListItem* item)
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn int32 BOutlineListView::FullListIndexOf(BListItem* item) const
|
|
|
|
\brief Returns the full list index of \a item.
|
|
|
|
|
|
|
|
\return The index of the item at \a where or -1 if not found.
|
|
|
|
|
|
|
|
\see BListView::IndexOf(BPoint point)
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BListItem* BOutlineListView::FullListFirstItem() const
|
|
|
|
\brief Returns a pointer to the first BListItem in the list.
|
|
|
|
|
|
|
|
\return A pointer to the first item in the list or \c NULL there are no
|
|
|
|
items.
|
|
|
|
|
|
|
|
\see BListView::FirstItem()
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BListItem* BOutlineListView::FullListLastItem() const
|
|
|
|
\brief Returns a pointer to the list BListItem in the list
|
|
|
|
|
|
|
|
\return A pointer to the last item in the list or \c NULL there are no
|
|
|
|
items.
|
|
|
|
|
|
|
|
\see BListView::LastItem()
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::FullListHasItem(BListItem* item) const
|
|
|
|
\brief Returns whether or not the list contains the specified \a item.
|
|
|
|
|
|
|
|
\param item The list item to check.
|
|
|
|
|
|
|
|
\return \c true if \a item is in the list, \c false otherwise.
|
|
|
|
|
|
|
|
\see BListView::HasItem(BListItem* item)
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn int32 BOutlineListView::FullListCountItems() const
|
|
|
|
\brief Returns the number of items contained in the outline list view.
|
|
|
|
|
|
|
|
\return The number of items.
|
|
|
|
|
|
|
|
\see BListView::CountItems()
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn int32 BOutlineListView::FullListCurrentSelection(int32 index) const
|
|
|
|
\brief Returns the index of a currently selected item relative to the passed
|
|
|
|
in \a index.
|
|
|
|
|
|
|
|
\param index The \a index of the item to get relative to the selected item's
|
|
|
|
index.
|
|
|
|
|
|
|
|
\see BListView::CurrentSelection(int32 index)
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::MakeEmpty()
|
|
|
|
\brief Empties the outline list view of all items.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::FullListIsEmpty() const
|
|
|
|
\brief Returns whether or not the outline list view is empty.
|
|
|
|
|
|
|
|
\return \c true if the outline list view is empty, \c false otherwise.
|
|
|
|
|
|
|
|
\see BListView::IsEmpty()
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::FullListDoForEach(bool(*func)(BListItem* item))
|
|
|
|
\brief Calls the specified function on each item in the outline list.
|
|
|
|
|
|
|
|
\param func The function to call on each item.
|
|
|
|
|
|
|
|
\see BListView::DoForEach(bool (*func)(BListItem* item))
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::FullListDoForEach(bool(*func)(BListItem* item,
|
|
|
|
void* arg), void* arg)
|
|
|
|
\brief Calls the specified function on each item in the outline list.
|
|
|
|
|
|
|
|
\param func The function to call on each item.
|
|
|
|
\param arg The second argument of the function.
|
|
|
|
|
|
|
|
\sa BListView::DoForEach(bool (*func)(BListItem* item, void* arg),
|
|
|
|
void* arg)
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BListItem* BOutlineListView::Superitem(const BListItem* item)
|
|
|
|
\brief Returns a pointer to the item at one level above \a item.
|
|
|
|
|
|
|
|
\return A pointer to the superitem of \a item or \c NULL if the \a item
|
|
|
|
is at the outermost level or not found.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::Expand(BListItem* item)
|
|
|
|
\brief Expands the section referenced by \a item.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::Collapse(BListItem* item)
|
|
|
|
\brief Collapses the section referenced by \a item.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::IsExpanded(int32 fullListIndex)
|
|
|
|
\brief Returns whether or not the section that the item at \a fullListIndex
|
|
|
|
is expanded or not.
|
|
|
|
|
|
|
|
\return \c true if the section is expanded, \c false if it is collapsed.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2014-06-14 01:25:02 +04:00
|
|
|
\name Sorting
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::FullListSortItems(
|
|
|
|
int (*compareFunc)(const BListItem* a, const BListItem* b))
|
|
|
|
\brief Sort the items according the the passed in compare function.
|
|
|
|
|
|
|
|
\param compareFunc The compare function to use to sort the items.
|
|
|
|
|
|
|
|
\see BListView::SortItems(int (*cmp)(const void *, const void *))
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::SortItemsUnder(BListItem* superItem,
|
|
|
|
bool oneLevelOnly, int (*compareFunc)(const BListItem* a,
|
|
|
|
const BListItem* b))
|
|
|
|
\brief Sorts the items under \a superItem.
|
|
|
|
|
|
|
|
\param superItem The base item.
|
|
|
|
\param oneLevelOnly if \c true, only items located one level under
|
|
|
|
superItem are considered.
|
|
|
|
\param compareFunc The compare function to use to sort the items.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn int32 BOutlineListView::CountItemsUnder(BListItem* superItem,
|
|
|
|
bool oneLevelOnly) const
|
|
|
|
\brief Returns the number of items under \a superItem.
|
|
|
|
|
|
|
|
\param superItem The base item.
|
|
|
|
\param oneLevelOnly if \c true, only items located one level under
|
|
|
|
superItem are considered.
|
|
|
|
|
|
|
|
\return The number of items under \a superItem.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BListItem* BOutlineListView::EachItemUnder(BListItem* superItem,
|
|
|
|
bool oneLevelOnly, BListItem* (*eachFunc)(BListItem* item, void* arg),
|
|
|
|
void* arg)
|
|
|
|
\brief Calls \a eachFunc for each item under \a superItem.
|
|
|
|
|
|
|
|
\param superItem The base item.
|
|
|
|
\param oneLevelOnly if \c true, only items located one level under
|
|
|
|
superItem are considered.
|
|
|
|
\param eachFunc The function to call on each item.
|
|
|
|
\param arg The second argument of \a eachFunc.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BListItem* BOutlineListView::ItemUnderAt(BListItem* superItem,
|
|
|
|
bool oneLevelOnly, int32 index) const
|
|
|
|
\brief Returns a pointer to the item at \a index under \a superItem.
|
|
|
|
|
|
|
|
\note If \a oneLevelOnly is \a false, this method acts like
|
|
|
|
FullListItemAt() except the first item in the list is
|
|
|
|
considered to be \a superItem.
|
|
|
|
|
|
|
|
\param superItem The base item.
|
|
|
|
\param oneLevelOnly if \c true, only items located one level under
|
|
|
|
superItem are considered.
|
|
|
|
\param index The index of the item to get.
|
|
|
|
|
|
|
|
\return A pointer to the item at \a index under \a superItem or \c NULL
|
|
|
|
if not found.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since BeOS R3
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn bool BOutlineListView::DoMiscellaneous(MiscCode code, MiscData* data)
|
|
|
|
\brief If \a code is \a B_SWAP_OP, swap the items in \a data, otherwise
|
|
|
|
pass the arguments to BListView::DoMiscellaneous().
|
|
|
|
|
|
|
|
\param code The action \a code to use.
|
|
|
|
\param data The \a data to act on.
|
|
|
|
|
|
|
|
\see BListView::DoMiscellaneous()
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::ExpandOrCollapse(BListItem* item, bool expand)
|
|
|
|
\brief Toggle the expanded state of \a item.
|
|
|
|
|
|
|
|
\param item The \a item to toggle.
|
|
|
|
\param expand If \c true, expand the \a item, if \c false, collapse the
|
|
|
|
\a item.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BRect BOutlineListView::LatchRect(BRect itemRect, int32 level) const
|
|
|
|
\brief Used by derived classes to return the latch area.
|
|
|
|
|
|
|
|
\param itemRect The area of the item to get the latch area of.
|
|
|
|
\param level The \a level of the item to get the latch area of.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::DrawLatch(BRect itemRect, int32 level,
|
|
|
|
bool collapsed, bool highlighted, bool misTracked)
|
|
|
|
\brief Used by derived classes to draw the latch.
|
|
|
|
|
|
|
|
\param itemRect The area of the item to get the latch area of,
|
|
|
|
this is passed to LatchRect() to get the latch area.
|
|
|
|
\param level The \a level of the item to get the latch area of,
|
|
|
|
also passed to LatchRect().
|
|
|
|
\param collapsed \c true to draw the latch in a collapsed state,
|
|
|
|
\c false to draw the latch in an expanded state.
|
|
|
|
\param highlighted \c true to draw the latch in a selected state,
|
|
|
|
\c false to draw the latch in an unselected state. Unused
|
|
|
|
by the base class.
|
|
|
|
\param misTracked Unused by the base class.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void BOutlineListView::DrawItem(BListItem* item, BRect itemRect,
|
|
|
|
bool complete)
|
2014-06-14 01:25:02 +04:00
|
|
|
\brief Used by derived classes to override how an \a item is drawn.
|
2013-12-12 01:15:15 +04:00
|
|
|
|
|
|
|
\param item The \a item to draw.
|
|
|
|
\param itemRect The area of the \a item to draw.
|
|
|
|
\param complete Whether or not to draw the background in addition to the
|
|
|
|
contents.
|
2014-06-14 01:25:02 +04:00
|
|
|
|
|
|
|
\since Haiku R1
|
2013-12-12 01:15:15 +04:00
|
|
|
*/
|