14cbcabffSJohn Scipione/* 247852bffSJohn Scipione * Copyright 2014 Haiku, Inc. All rights reserved. 34cbcabffSJohn Scipione * Distributed under the terms of the MIT License. 44cbcabffSJohn Scipione * 54cbcabffSJohn Scipione * Authors: 64cbcabffSJohn Scipione * John Scipione, jscipione@gmail.com 74cbcabffSJohn Scipione * 84cbcabffSJohn Scipione * Corresponds to: 94cbcabffSJohn Scipione * headers/os/interface/ListView.h hrev45555 104cbcabffSJohn Scipione * src/kits/interface/ListView.cpp hrev45555 114cbcabffSJohn Scipione */ 124cbcabffSJohn Scipione 134cbcabffSJohn Scipione 144cbcabffSJohn Scipione/*! 154cbcabffSJohn Scipione \file ListView.h 164cbcabffSJohn Scipione \ingroup interface 174cbcabffSJohn Scipione \ingroup libbe 184cbcabffSJohn Scipione \brief ListView class definition. 194cbcabffSJohn Scipione*/ 204cbcabffSJohn Scipione 214cbcabffSJohn Scipione 224cbcabffSJohn Scipione/*! 234cbcabffSJohn Scipione \class BListView 244cbcabffSJohn Scipione \ingroup interface 254cbcabffSJohn Scipione \ingroup libbe 264cbcabffSJohn Scipione \brief Displays a list of items that the user can select and invoke. 274cbcabffSJohn Scipione 28853f7246SJohn Scipione BListView's can be one of two types set by the type parameter of the 29853f7246SJohn Scipione constructor: 30853f7246SJohn Scipione - \c B_SINGLE_SELECTION_LIST Can select only one item in the list at a 31853f7246SJohn Scipione time. This is the default. 32853f7246SJohn Scipione - \c B_MULTIPLE_SELECTION_LIST Can select any number of items by 33853f7246SJohn Scipione holding down Option for a discontinuous selection, or Shift for 34853f7246SJohn Scipione a contiguous selection. 354cbcabffSJohn Scipione 364cbcabffSJohn Scipione An example of a BListView looks like this: 374cbcabffSJohn Scipione \image html BListView_example.png 384cbcabffSJohn Scipione 394cbcabffSJohn Scipione Click on an item to select it and double-click an item to invoke it. The 404cbcabffSJohn Scipione BListView doesn't define what it means to "invoke" an item. See 41853f7246SJohn Scipione BListView::SetSelectionMessage() and BListView::SetInvocationMessage() 42853f7246SJohn Scipione to set a message to be set when these actions occur. You can also select 43853f7246SJohn Scipione and invoke items with keyboard keys such as the up and down arrow keys, 44853f7246SJohn Scipione Page Up and Page Down and the Enter key or Space key to invoke the item. 454cbcabffSJohn Scipione 46853f7246SJohn Scipione This class is based on the BList class from the Support Kit and many of 47853f7246SJohn Scipione the methods it uses behave similarly. 484cbcabffSJohn Scipione 49853f7246SJohn Scipione Although a BListView is scrollable, it doesn't provide scroll bars by 50853f7246SJohn Scipione itself. You should add the BListView as a child of a BScrollView to make 51853f7246SJohn Scipione it scrollable. 524cbcabffSJohn Scipione 534cbcabffSJohn Scipione The code to add a BListView to a BScrollView looks something like this: 544cbcabffSJohn Scipione 554cbcabffSJohn Scipione\code 564cbcabffSJohn Scipione BListView* list = new BListView(frame, "List", B_SINGLE_SELECTION_LIST); 574cbcabffSJohn Scipione list->AddItem(new BStringItem("Item 1")); 584cbcabffSJohn Scipione list->AddItem(new BStringItem("Item 2")); 594cbcabffSJohn Scipione ... 604cbcabffSJohn Scipione view->AddChild(new BScrollView("scroll_view", list, 614cbcabffSJohn Scipione B_FOLLOW_LEFT | B_FOLLOW_TOP, 0, false, true)); 624cbcabffSJohn Scipione\endcode 634cbcabffSJohn Scipione 644cbcabffSJohn Scipione \see BScrollView for more information on scrolling views. 654cbcabffSJohn Scipione \see BList in the Support Kit. 664cbcabffSJohn Scipione \see BOutlineListView 674cbcabffSJohn Scipione \see BListItem 6847852bffSJohn Scipione 6947852bffSJohn Scipione \since BeOS R3 704cbcabffSJohn Scipione*/ 714cbcabffSJohn Scipione 724cbcabffSJohn Scipione 734cbcabffSJohn Scipione/*! 744cbcabffSJohn Scipione \fn BListView::BListView(BRect frame, const char* name, list_view_type type, 754cbcabffSJohn Scipione uint32 resizingMode, uint32 flags) 764cbcabffSJohn Scipione \brief Creates a new list view. This is the non-layout constructor. 774cbcabffSJohn Scipione 784cbcabffSJohn Scipione \param frame The frame rectangle of the view. 794cbcabffSJohn Scipione \param name The name of the view. 804cbcabffSJohn Scipione \param type Whether the list view supports a single selection or multiple 814cbcabffSJohn Scipione selections. 82853f7246SJohn Scipione \param resizingMode The resizing mode flags. See BView for details. 83853f7246SJohn Scipione \param flags The view flags. See BView for details. 8447852bffSJohn Scipione 8547852bffSJohn Scipione \since BeOS R3 864cbcabffSJohn Scipione*/ 874cbcabffSJohn Scipione 884cbcabffSJohn Scipione 894cbcabffSJohn Scipione/*! 90853f7246SJohn Scipione \fn BListView::BListView(const char* name, list_view_type type, 91853f7246SJohn Scipione uint32 flags) 92853f7246SJohn Scipione \brief Creates a new list view suitable as part of a layout with the 93853f7246SJohn Scipione specified \a name, \a type, and \a flags. 944cbcabffSJohn Scipione 954cbcabffSJohn Scipione \param name The name of the view. 964cbcabffSJohn Scipione \param type Whether the list view supports a single selection or multiple 974cbcabffSJohn Scipione selections. 98853f7246SJohn Scipione \param flags The view flags. See BView for details. 9947852bffSJohn Scipione 10047852bffSJohn Scipione \since Haiku R1 1014cbcabffSJohn Scipione*/ 1024cbcabffSJohn Scipione 1034cbcabffSJohn Scipione 1044cbcabffSJohn Scipione/*! 1054cbcabffSJohn Scipione \fn BListView::BListView(list_view_type type) 1064cbcabffSJohn Scipione \brief Creates a new list view suitable as part of a layout. 1074cbcabffSJohn Scipione 1084cbcabffSJohn Scipione \param type Whether the list view supports a single selection or multiple 1094cbcabffSJohn Scipione selections. 11047852bffSJohn Scipione 11147852bffSJohn Scipione \since Haiku R1 1124cbcabffSJohn Scipione*/ 1134cbcabffSJohn Scipione 1144cbcabffSJohn Scipione 1154cbcabffSJohn Scipione/*! 1164cbcabffSJohn Scipione \fn BListView::BListView(BMessage* archive) 117853f7246SJohn Scipione \brief Creates a BListView object from the \a archive message. 1184cbcabffSJohn Scipione 119853f7246SJohn Scipione \param archive The message to create the object from. 12047852bffSJohn Scipione 12147852bffSJohn Scipione \since BeOS R3 1224cbcabffSJohn Scipione*/ 1234cbcabffSJohn Scipione 1244cbcabffSJohn Scipione 1254cbcabffSJohn Scipione/*! 1264cbcabffSJohn Scipione \fn BListView::~BListView() 127853f7246SJohn Scipione \brief Delete the BListView object and free the memory used by it. 1284cbcabffSJohn Scipione 129853f7246SJohn Scipione This method does not free the attached list items. 13047852bffSJohn Scipione 13147852bffSJohn Scipione \since BeOS R3 1324cbcabffSJohn Scipione*/ 1334cbcabffSJohn Scipione 1344cbcabffSJohn Scipione 1354cbcabffSJohn Scipione/*! 1364cbcabffSJohn Scipione \name Archiving 1374cbcabffSJohn Scipione*/ 1384cbcabffSJohn Scipione 1394cbcabffSJohn Scipione 1404cbcabffSJohn Scipione//! @{ 1414cbcabffSJohn Scipione 1424cbcabffSJohn Scipione 1434cbcabffSJohn Scipione/*! 1444cbcabffSJohn Scipione \fn BArchivable* BListView::Instantiate(BMessage* archive) 145853f7246SJohn Scipione \brief Create a new BListView object from the message \a archive. 1464cbcabffSJohn Scipione 14747852bffSJohn Scipione \copydetails BView::Instantiate() 1484cbcabffSJohn Scipione*/ 1494cbcabffSJohn Scipione 1504cbcabffSJohn Scipione 1514cbcabffSJohn Scipione/*! 15247852bffSJohn Scipione \fn status_t BListView::Archive(BMessage* data, bool deep) const 153853f7246SJohn Scipione \brief Archive the BListView object to a message. 1544cbcabffSJohn Scipione 15547852bffSJohn Scipione \copydetails BView::Archive() 1564cbcabffSJohn Scipione*/ 1574cbcabffSJohn Scipione 1584cbcabffSJohn Scipione 1594cbcabffSJohn Scipione//! @} 1604cbcabffSJohn Scipione 1614cbcabffSJohn Scipione 1624cbcabffSJohn Scipione/*! 16347852bffSJohn Scipione \name Hook Methods 1644cbcabffSJohn Scipione*/ 1654cbcabffSJohn Scipione 1664cbcabffSJohn Scipione 1674cbcabffSJohn Scipione//! @{ 1684cbcabffSJohn Scipione 1694cbcabffSJohn Scipione 1704cbcabffSJohn Scipione/*! 1714cbcabffSJohn Scipione \fn void BListView::Draw(BRect updateRect) 1724cbcabffSJohn Scipione \brief Hook method called to draw the contents of the text view. 1734cbcabffSJohn Scipione 1744cbcabffSJohn Scipione You should not have to call this method directly, use Invalidate() instead. 1754cbcabffSJohn Scipione 1764cbcabffSJohn Scipione \param updateRect The rectangular area to draw. 1774cbcabffSJohn Scipione 1784cbcabffSJohn Scipione \see BView::Draw() 17947852bffSJohn Scipione 18047852bffSJohn Scipione \since BeOS R3 1814cbcabffSJohn Scipione*/ 1824cbcabffSJohn Scipione 1834cbcabffSJohn Scipione 1844cbcabffSJohn Scipione/*! 1854cbcabffSJohn Scipione \fn void BListView::AttachedToWindow() 1864cbcabffSJohn Scipione \brief Hook method called when the list view is added to the view hierarchy. 1874cbcabffSJohn Scipione 18847852bffSJohn Scipione \copydetails BView::AttachedToWindow() 1894cbcabffSJohn Scipione*/ 1904cbcabffSJohn Scipione 1914cbcabffSJohn Scipione 1924cbcabffSJohn Scipione/*! 1934cbcabffSJohn Scipione \fn void BListView::DetachedFromWindow() 1944cbcabffSJohn Scipione \brief Hook method that is called when the list view is removed from the 1954cbcabffSJohn Scipione view hierarchy. 1964cbcabffSJohn Scipione 19747852bffSJohn Scipione \copydetails BView::DetachedFromWindow() 1984cbcabffSJohn Scipione*/ 1994cbcabffSJohn Scipione 2004cbcabffSJohn Scipione 2014cbcabffSJohn Scipione/*! 2024cbcabffSJohn Scipione \fn void BListView::AllAttached() 2034cbcabffSJohn Scipione \brief Hook method called once all views are attached to the view. 2044cbcabffSJohn Scipione 20547852bffSJohn Scipione \copydetails BView::AllAttached() 2064cbcabffSJohn Scipione*/ 2074cbcabffSJohn Scipione 2084cbcabffSJohn Scipione 2094cbcabffSJohn Scipione/*! 2104cbcabffSJohn Scipione \fn void BListView::AllDetached() 2114cbcabffSJohn Scipione \brief Hook method called once all views are detached from the view. 2124cbcabffSJohn Scipione 21347852bffSJohn Scipione \copydetails BView::AllDetached() 2144cbcabffSJohn Scipione*/ 2154cbcabffSJohn Scipione 2164cbcabffSJohn Scipione 2174cbcabffSJohn Scipione/*! 21847852bffSJohn Scipione \fn void BListView::FrameResized(float newWidth, float newHeight) 2194cbcabffSJohn Scipione \brief Hook method called when the list view is resized. 2204cbcabffSJohn Scipione 22147852bffSJohn Scipione \copydetails BView::FrameResized() 2224cbcabffSJohn Scipione*/ 2234cbcabffSJohn Scipione 2244cbcabffSJohn Scipione 2254cbcabffSJohn Scipione/*! 22647852bffSJohn Scipione \fn void BListView::FrameMoved(BPoint newPosition) 2274cbcabffSJohn Scipione \brief Hook method called when the list view is moved. 2284cbcabffSJohn Scipione 22947852bffSJohn Scipione \copydetails BView::FrameMoved() 2304cbcabffSJohn Scipione*/ 2314cbcabffSJohn Scipione 2324cbcabffSJohn Scipione 2334cbcabffSJohn Scipione/*! 2344cbcabffSJohn Scipione \fn void BListView::TargetedByScrollView(BScrollView* view) 2354cbcabffSJohn Scipione \brief Hook method called when the list view is attached to a BScrollView. 2364cbcabffSJohn Scipione 2374cbcabffSJohn Scipione \param view The BScrollView the list view is attached to. 23847852bffSJohn Scipione 23947852bffSJohn Scipione \since BeOS R3 2404cbcabffSJohn Scipione*/ 2414cbcabffSJohn Scipione 2424cbcabffSJohn Scipione 2434cbcabffSJohn Scipione/*! 24447852bffSJohn Scipione \fn void BListView::WindowActivated(bool active) 2454cbcabffSJohn Scipione \brief Hook method that is called when the window becomes the active window 2464cbcabffSJohn Scipione or gives up that status. 2474cbcabffSJohn Scipione 24847852bffSJohn Scipione \copydetails BView::WindowActivated() 2494cbcabffSJohn Scipione*/ 2504cbcabffSJohn Scipione 2514cbcabffSJohn Scipione 2524cbcabffSJohn Scipione/*! 2534cbcabffSJohn Scipione \fn void BListView::MessageReceived(BMessage* message) 254853f7246SJohn Scipione \brief Hook method called when a message is received by the list view. 2554cbcabffSJohn Scipione 25647852bffSJohn Scipione \copydetails BView::MessageReceived() 2574cbcabffSJohn Scipione*/ 2584cbcabffSJohn Scipione 2594cbcabffSJohn Scipione 2604cbcabffSJohn Scipione/*! 2614cbcabffSJohn Scipione \fn void BListView::KeyDown(const char* bytes, int32 numBytes) 2624cbcabffSJohn Scipione \brief Hook method that is called when a key is pressed while the view is 2634cbcabffSJohn Scipione the focus view of the active window. 2644cbcabffSJohn Scipione 2654cbcabffSJohn Scipione The following keys are used by the list view by default: 2664cbcabffSJohn Scipione - Up Arrow Selects the previous item. 2674cbcabffSJohn Scipione - Down Arrow Selects the next item. 268853f7246SJohn Scipione - Page Up Selects the item one view height above the 269853f7246SJohn Scipione current item. 270853f7246SJohn Scipione - Page Down Selects the item one view height below the 271853f7246SJohn Scipione current item. 2724cbcabffSJohn Scipione - Home Selects the first item in the list. 2734cbcabffSJohn Scipione - End Select the last item in the list. 2744cbcabffSJohn Scipione - Enter and Spacebar Invokes the currently selected item. 2754cbcabffSJohn Scipione 2764cbcabffSJohn Scipione \param bytes The \a bytes representing the keys pushed down. 2774cbcabffSJohn Scipione \param numBytes The size of \a bytes. 2784cbcabffSJohn Scipione 2794cbcabffSJohn Scipione \see BView::KeyDown() 28047852bffSJohn Scipione 28147852bffSJohn Scipione \since BeOS R3 2824cbcabffSJohn Scipione*/ 2834cbcabffSJohn Scipione 2844cbcabffSJohn Scipione 2854cbcabffSJohn Scipione/*! 2864cbcabffSJohn Scipione \fn void BListView::MouseDown(BPoint point) 2874cbcabffSJohn Scipione \brief Hook method that is called when a mouse button is pushed down while 2884cbcabffSJohn Scipione the cursor is contained in the view. 2894cbcabffSJohn Scipione 2904cbcabffSJohn Scipione By default this method selects items on a single click, and invokes them on a 2914cbcabffSJohn Scipione double click. This method calls InitiateDrag() to allow derived classes the 2924cbcabffSJohn Scipione opportunity to drag and drop items from the list. 2934cbcabffSJohn Scipione 2944cbcabffSJohn Scipione \param point The \a point where the mouse button was pushed down. 2954cbcabffSJohn Scipione 2964cbcabffSJohn Scipione \see BView::MouseDown() 29747852bffSJohn Scipione 29847852bffSJohn Scipione \since BeOS R3 2994cbcabffSJohn Scipione*/ 3004cbcabffSJohn Scipione 3014cbcabffSJohn Scipione 3024cbcabffSJohn Scipione/*! 3034cbcabffSJohn Scipione \fn void BListView::MouseUp(BPoint where) 3044cbcabffSJohn Scipione \brief Hook method that is called when a mouse button is released while 3054cbcabffSJohn Scipione the cursor is contained in the view. 3064cbcabffSJohn Scipione 3074cbcabffSJohn Scipione \param where The location that the mouse button was released. 3084cbcabffSJohn Scipione 3094cbcabffSJohn Scipione \see BView::MouseUp() 31047852bffSJohn Scipione 31147852bffSJohn Scipione \since BeOS R3 3124cbcabffSJohn Scipione*/ 3134cbcabffSJohn Scipione 3144cbcabffSJohn Scipione 3154cbcabffSJohn Scipione/*! 3164cbcabffSJohn Scipione \fn void BListView::MouseMoved(BPoint where, uint32 code, 3174cbcabffSJohn Scipione const BMessage* dragMessage) 3184cbcabffSJohn Scipione \brief Hook method that is called whenever the mouse cursor enters, exits 3194cbcabffSJohn Scipione or moves inside the list view. 3204cbcabffSJohn Scipione 3214cbcabffSJohn Scipione \param where The point where the mouse cursor has moved to. 3224cbcabffSJohn Scipione \param code A code which indicating if the mouse entered or exited the view. 3234cbcabffSJohn Scipione \param dragMessage A message containing drag and drop information. 3244cbcabffSJohn Scipione 3254cbcabffSJohn Scipione \see BView::MouseMoved() 32647852bffSJohn Scipione 32747852bffSJohn Scipione \since BeOS R3 3284cbcabffSJohn Scipione*/ 3294cbcabffSJohn Scipione 3304cbcabffSJohn Scipione 3314cbcabffSJohn Scipione/*! 3324cbcabffSJohn Scipione \fn bool BListView::InitiateDrag(BPoint point, int32 index, bool wasSelected) 3334cbcabffSJohn Scipione \brief Hook method called when a drag and drop operation is initiated. 3344cbcabffSJohn Scipione 335853f7246SJohn Scipione This method is used by derived classes to implement drag and drop. 336853f7246SJohn Scipione This method is called by the MouseDown() method. If the derived 337853f7246SJohn Scipione class initiates the drag & drop operation you should return 338853f7246SJohn Scipione \c true, otherwise return \c false. By default this method returns 339853f7246SJohn Scipione \c false. 3404cbcabffSJohn Scipione 3414cbcabffSJohn Scipione \param point Where the drag & drop operation started. 3424cbcabffSJohn Scipione \param index 3434cbcabffSJohn Scipione \param wasSelected Indicates whether or not the item was selected. 3444cbcabffSJohn Scipione 345853f7246SJohn Scipione \returns \c true if a drag & drop operation was initiated, \c false 346853f7246SJohn Scipione otherwise. 34747852bffSJohn Scipione 34847852bffSJohn Scipione \since BeOS R3 3494cbcabffSJohn Scipione*/ 3504cbcabffSJohn Scipione 3514cbcabffSJohn Scipione 3524cbcabffSJohn Scipione/*! 3534cbcabffSJohn Scipione \fn void BListView::SelectionChanged() 3544cbcabffSJohn Scipione \brief Hook method that is called when the selection changes. 3554cbcabffSJohn Scipione 3564cbcabffSJohn Scipione This method should be implemented by derived classes, the default 3574cbcabffSJohn Scipione implementation does nothing. 35847852bffSJohn Scipione 35947852bffSJohn Scipione \since BeOS R3 3604cbcabffSJohn Scipione*/ 3614cbcabffSJohn Scipione 3624cbcabffSJohn Scipione 3634cbcabffSJohn Scipione//! @} 3644cbcabffSJohn Scipione 3654cbcabffSJohn Scipione 3664cbcabffSJohn Scipione/*! 36747852bffSJohn Scipione \name Resizing 3684cbcabffSJohn Scipione*/ 3694cbcabffSJohn Scipione 3704cbcabffSJohn Scipione 3714cbcabffSJohn Scipione//! @{ 3724cbcabffSJohn Scipione 3734cbcabffSJohn Scipione 3744cbcabffSJohn Scipione/*! 3754cbcabffSJohn Scipione \fn void BListView::ResizeToPreferred() 37644b87466SJohn Scipione \brief Resize the view to its preferred size. 3774cbcabffSJohn Scipione 3784cbcabffSJohn Scipione \see BView::ResizeToPreferred() 37947852bffSJohn Scipione 38047852bffSJohn Scipione \since BeOS R3 3814cbcabffSJohn Scipione*/ 3824cbcabffSJohn Scipione 3834cbcabffSJohn Scipione 3844cbcabffSJohn Scipione/*! 3854cbcabffSJohn Scipione \fn void BListView::GetPreferredSize(float *_width, float *_height) 3864cbcabffSJohn Scipione \brief Fill out the \a _width and \a _height parameters with the preferred 3874cbcabffSJohn Scipione width and height of the list view. 3884cbcabffSJohn Scipione 3894cbcabffSJohn Scipione \param _width The list view's preferred width is written to \a _width. 3904cbcabffSJohn Scipione \param _height The list view's preferred height is written to \a _height. 3914cbcabffSJohn Scipione 3924cbcabffSJohn Scipione \see BView::GetPreferredSize() 39347852bffSJohn Scipione 39447852bffSJohn Scipione \since BeOS R3 3954cbcabffSJohn Scipione*/ 3964cbcabffSJohn Scipione 3974cbcabffSJohn Scipione 3984cbcabffSJohn Scipione/*! 3994cbcabffSJohn Scipione \fn BSize BListView::MinSize() 4004cbcabffSJohn Scipione \brief Returns the minimum size of the list view. 4014cbcabffSJohn Scipione 4024cbcabffSJohn Scipione \return The minimum size of the list view as a BSize. 4034cbcabffSJohn Scipione 4044cbcabffSJohn Scipione \see BView::MinSize() 40547852bffSJohn Scipione 40647852bffSJohn Scipione \since Haiku R1 4074cbcabffSJohn Scipione*/ 4084cbcabffSJohn Scipione 4094cbcabffSJohn Scipione 4104cbcabffSJohn Scipione/*! 4114cbcabffSJohn Scipione \fn BSize BListView::MaxSize() 4124cbcabffSJohn Scipione \brief Returns the maximum size of the list view. 4134cbcabffSJohn Scipione 4144cbcabffSJohn Scipione \return The maximum size of the list view as a BSize. 4154cbcabffSJohn Scipione 4164cbcabffSJohn Scipione \see BView::MaxSize() 41747852bffSJohn Scipione 41847852bffSJohn Scipione \since Haiku R1 4194cbcabffSJohn Scipione*/ 4204cbcabffSJohn Scipione 4214cbcabffSJohn Scipione 4224cbcabffSJohn Scipione/*! 4234cbcabffSJohn Scipione \fn BSize BListView::PreferredSize() 4244cbcabffSJohn Scipione \brief Returns the preferred size of the list view. 4254cbcabffSJohn Scipione 4264cbcabffSJohn Scipione \return The preferred size of the list view as a BSize. 4274cbcabffSJohn Scipione 4284cbcabffSJohn Scipione \see BView::PreferredSize() 42947852bffSJohn Scipione 43047852bffSJohn Scipione \since Haiku R1 4314cbcabffSJohn Scipione*/ 4324cbcabffSJohn Scipione 4334cbcabffSJohn Scipione 4344cbcabffSJohn Scipione//! @} 4354cbcabffSJohn Scipione 4364cbcabffSJohn Scipione 4374cbcabffSJohn Scipione/*! 4384cbcabffSJohn Scipione \fn void BListView::MakeFocus(bool focused) 4394cbcabffSJohn Scipione \brief Highlight or unhighlight the selection when the list view acquires 4404cbcabffSJohn Scipione or loses its focus state. 4414cbcabffSJohn Scipione 4424cbcabffSJohn Scipione \param focused \c true to receive focus or \c false to lose it. 4434cbcabffSJohn Scipione 4444cbcabffSJohn Scipione \see BView::MakeFocus() 44547852bffSJohn Scipione 44647852bffSJohn Scipione \since BeOS R3 4474cbcabffSJohn Scipione*/ 4484cbcabffSJohn Scipione 4494cbcabffSJohn Scipione 4504cbcabffSJohn Scipione/*! 4514cbcabffSJohn Scipione \fn void BListView::SetFont(const BFont* font, uint32 mask) 452853f7246SJohn Scipione \brief Sets the font of the list view to \a font with the font 453853f7246SJohn Scipione parameters set by \a mask. 4544cbcabffSJohn Scipione 4554cbcabffSJohn Scipione \param font The \a font to set the list view to. 4564cbcabffSJohn Scipione \param mask A \a mask indicating which properties of \a font to set. 4574cbcabffSJohn Scipione 4584cbcabffSJohn Scipione \see BView::SetFont() 45947852bffSJohn Scipione 46047852bffSJohn Scipione \since BeOS R3 4614cbcabffSJohn Scipione*/ 4624cbcabffSJohn Scipione 4634cbcabffSJohn Scipione 4644cbcabffSJohn Scipione/*! 46582bfaa95SJohn Scipione \name Scrolling 46682bfaa95SJohn Scipione*/ 46782bfaa95SJohn Scipione 46882bfaa95SJohn Scipione 46982bfaa95SJohn Scipione//! @{ 47082bfaa95SJohn Scipione 47182bfaa95SJohn Scipione 47282bfaa95SJohn Scipione/*! 4734cbcabffSJohn Scipione \fn void BListView::ScrollTo(BPoint point) 4744cbcabffSJohn Scipione \brief Scroll the view to the specified \a point. 4754cbcabffSJohn Scipione 4764cbcabffSJohn Scipione \param point The location to scroll the list view to. 4774cbcabffSJohn Scipione 4784cbcabffSJohn Scipione \see BView::ScrollTo() 47947852bffSJohn Scipione 48047852bffSJohn Scipione \since BeOS R3 4814cbcabffSJohn Scipione*/ 4824cbcabffSJohn Scipione 4834cbcabffSJohn Scipione 4844cbcabffSJohn Scipione/*! 48582bfaa95SJohn Scipione \fn void BListView::ScrollTo(int32 index) 48682bfaa95SJohn Scipione \brief Scrolls to list item at \a index. 48782bfaa95SJohn Scipione 48882bfaa95SJohn Scipione If above top scroll to first item, if below bottom 48982bfaa95SJohn Scipione scroll to last item otherwise scroll to item at \a index. 49082bfaa95SJohn Scipione 49182bfaa95SJohn Scipione \see IndexOf(), MouseMoved(), ScrollToSelection() 49282bfaa95SJohn Scipione 49382bfaa95SJohn Scipione \since Haiku R1 49482bfaa95SJohn Scipione*/ 49582bfaa95SJohn Scipione 49682bfaa95SJohn Scipione 49782bfaa95SJohn Scipione/*! 49882bfaa95SJohn Scipione \fn void BListView::ScrollToSelection() 49982bfaa95SJohn Scipione \brief Scrolls to selected list item. 50082bfaa95SJohn Scipione 50182bfaa95SJohn Scipione \since BeOS R3 50282bfaa95SJohn Scipione*/ 50382bfaa95SJohn Scipione 50482bfaa95SJohn Scipione 50582bfaa95SJohn Scipione//! @} 50682bfaa95SJohn Scipione 50782bfaa95SJohn Scipione 50882bfaa95SJohn Scipione/*! 50947852bffSJohn Scipione \name Adding/Removing Items 5104cbcabffSJohn Scipione*/ 5114cbcabffSJohn Scipione 5124cbcabffSJohn Scipione 5134cbcabffSJohn Scipione//! @{ 5144cbcabffSJohn Scipione 5154cbcabffSJohn Scipione 5164cbcabffSJohn Scipione/*! 5174cbcabffSJohn Scipione \fn bool BListView::AddItem(BListItem *item, int32 index) 5184cbcabffSJohn Scipione \brief Add an \a item to the list view at the specified \a index. 5194cbcabffSJohn Scipione 5204cbcabffSJohn Scipione \param item The list item to add. 521853f7246SJohn Scipione \param index The \a index of where to add the list item, if not 522853f7246SJohn Scipione specified the item is added to the end. 5234cbcabffSJohn Scipione 5244cbcabffSJohn Scipione \return \c true if the list item was added, \c false otherwise. 52547852bffSJohn Scipione 52647852bffSJohn Scipione \since BeOS R3 5274cbcabffSJohn Scipione*/ 5284cbcabffSJohn Scipione 5294cbcabffSJohn Scipione 5304cbcabffSJohn Scipione/*! 5314cbcabffSJohn Scipione \fn bool BListView::AddList(BList* list, int32 index) 532853f7246SJohn Scipione \brief Add a \a list of list items to the list view at the specified 533853f7246SJohn Scipione \a index. 5344cbcabffSJohn Scipione 5354cbcabffSJohn Scipione \param list The \a list of list items to add. 5364cbcabffSJohn Scipione \param index The \a index of where to add the list, if not specified the 5374cbcabffSJohn Scipione \a list is added to the end. 5384cbcabffSJohn Scipione 5394cbcabffSJohn Scipione \return \c true if the \a list was added, \c false otherwise. 54047852bffSJohn Scipione 54147852bffSJohn Scipione \since BeOS R3 5424cbcabffSJohn Scipione*/ 5434cbcabffSJohn Scipione 5444cbcabffSJohn Scipione 5454cbcabffSJohn Scipione/*! 5464cbcabffSJohn Scipione \fn bool BListView::AddList(BList* list) 547080bf8feSJohn Scipione \brief Add a \a list of list items to the end of the list view. 5484cbcabffSJohn Scipione 5494cbcabffSJohn Scipione \param list The \a list of list items to add. 5504cbcabffSJohn Scipione 5514cbcabffSJohn Scipione \return \c true if the \a list was added, \c false otherwise. 55247852bffSJohn Scipione 55347852bffSJohn Scipione \since BeOS R3 5544cbcabffSJohn Scipione*/ 5554cbcabffSJohn Scipione 5564cbcabffSJohn Scipione 5574cbcabffSJohn Scipione/*! 5584cbcabffSJohn Scipione \fn BListItem* BListView::RemoveItem(int32 index) 5594cbcabffSJohn Scipione \brief Remove the item at \a index from the list. 5604cbcabffSJohn Scipione 5614cbcabffSJohn Scipione \param index The \a index of the item to remove. 5624cbcabffSJohn Scipione 5634cbcabffSJohn Scipione \return \c true if the item was removed, \c false otherwise. 56447852bffSJohn Scipione 56547852bffSJohn Scipione \since BeOS R3 5664cbcabffSJohn Scipione*/ 5674cbcabffSJohn Scipione 5684cbcabffSJohn Scipione 5694cbcabffSJohn Scipione/*! 5704cbcabffSJohn Scipione \fn bool BListView::RemoveItem(BListItem* item) 5714cbcabffSJohn Scipione \brief Remove the specified list item. 5724cbcabffSJohn Scipione 5734cbcabffSJohn Scipione \param item The list item to remove. 5744cbcabffSJohn Scipione 5754cbcabffSJohn Scipione \return \c true if the \a item was removed, \c false otherwise. 57647852bffSJohn Scipione 57747852bffSJohn Scipione \since BeOS R3 5784cbcabffSJohn Scipione*/ 5794cbcabffSJohn Scipione 5804cbcabffSJohn Scipione 5814cbcabffSJohn Scipione/*! 5824cbcabffSJohn Scipione \fn bool BListView::RemoveItems(int32 index, int32 count) 5834cbcabffSJohn Scipione \brief Removes the items from \a index and the next \a count items. 5844cbcabffSJohn Scipione 5854cbcabffSJohn Scipione \param index The location to start removing items from. 5864cbcabffSJohn Scipione \param count The number of items past \a index to remove. 5874cbcabffSJohn Scipione 5884cbcabffSJohn Scipione return \c true if the \a items were removed, \c false otherwise. 58947852bffSJohn Scipione 59047852bffSJohn Scipione \since BeOS R3 5914cbcabffSJohn Scipione*/ 5924cbcabffSJohn Scipione 5934cbcabffSJohn Scipione 5944cbcabffSJohn Scipione//! @} 5954cbcabffSJohn Scipione 5964cbcabffSJohn Scipione 5974cbcabffSJohn Scipione/*! 59847852bffSJohn Scipione \name Selection and Invocation Message Methods 5994cbcabffSJohn Scipione*/ 6004cbcabffSJohn Scipione 6014cbcabffSJohn Scipione 6024cbcabffSJohn Scipione//! @{ 6034cbcabffSJohn Scipione 6044cbcabffSJohn Scipione 6054cbcabffSJohn Scipione/*! 6064cbcabffSJohn Scipione \fn void BListView::SetSelectionMessage(BMessage* message) 607853f7246SJohn Scipione \brief Sets the \a message that the list view sends when a new item 608853f7246SJohn Scipione is selected. 6094cbcabffSJohn Scipione 6104cbcabffSJohn Scipione \param message The selection \a message to set. 61147852bffSJohn Scipione 61247852bffSJohn Scipione \since BeOS R3 6134cbcabffSJohn Scipione*/ 6144cbcabffSJohn Scipione 6154cbcabffSJohn Scipione 6164cbcabffSJohn Scipione/*! 6174cbcabffSJohn Scipione \fn void BListView::SetInvocationMessage(BMessage* message) 6184cbcabffSJohn Scipione Sets the \a message that the list view sends when an item is invoked. 6194cbcabffSJohn Scipione 6204cbcabffSJohn Scipione \param message The invocation \a message to set. 6214cbcabffSJohn Scipione 6224cbcabffSJohn Scipione \see BInvoker::SetMessage() 62347852bffSJohn Scipione 62447852bffSJohn Scipione \since BeOS R3 6254cbcabffSJohn Scipione*/ 6264cbcabffSJohn Scipione 6274cbcabffSJohn Scipione 6284cbcabffSJohn Scipione/*! 6294cbcabffSJohn Scipione \fn BMessage* BListView::InvocationMessage() const 6304cbcabffSJohn Scipione \brief Returns the message that is send when an item is invoked. 6314cbcabffSJohn Scipione 6324cbcabffSJohn Scipione \return The current invocation method as a BMessage. 6334cbcabffSJohn Scipione 6344cbcabffSJohn Scipione \see BInvoker::Message() 63547852bffSJohn Scipione 63647852bffSJohn Scipione \since BeOS R3 6374cbcabffSJohn Scipione*/ 6384cbcabffSJohn Scipione 6394cbcabffSJohn Scipione 6404cbcabffSJohn Scipione/*! 6414cbcabffSJohn Scipione \fn uint32 BListView::InvocationCommand() const 6424cbcabffSJohn Scipione \brief Returns the what parameter of the current invocation method. 6434cbcabffSJohn Scipione 6444cbcabffSJohn Scipione \returns The what parameter of the currently set invocation method. 6454cbcabffSJohn Scipione 6464cbcabffSJohn Scipione \see BInvoker::Command() 64747852bffSJohn Scipione 64847852bffSJohn Scipione \since BeOS R3 6494cbcabffSJohn Scipione*/ 6504cbcabffSJohn Scipione 6514cbcabffSJohn Scipione 6524cbcabffSJohn Scipione/*! 6534cbcabffSJohn Scipione \fn BMessage* BListView::SelectionMessage() const 6544cbcabffSJohn Scipione \brief Returns the message that is send when an item is selected. 6554cbcabffSJohn Scipione 6564cbcabffSJohn Scipione \return The current selection message as a BMessage. 65747852bffSJohn Scipione 65847852bffSJohn Scipione \since BeOS R3 6594cbcabffSJohn Scipione*/ 6604cbcabffSJohn Scipione 6614cbcabffSJohn Scipione 6624cbcabffSJohn Scipione/*! 6634cbcabffSJohn Scipione \fn uint32 BListView::SelectionCommand() const 6644cbcabffSJohn Scipione \brief Returns the what parameter of the message that is send when an item is 6654cbcabffSJohn Scipione selected. 6664cbcabffSJohn Scipione 6674cbcabffSJohn Scipione \return The what parameter of the current selection message. 66847852bffSJohn Scipione 66947852bffSJohn Scipione \since BeOS R3 6704cbcabffSJohn Scipione*/ 6714cbcabffSJohn Scipione 6724cbcabffSJohn Scipione 6734cbcabffSJohn Scipione//! @} 6744cbcabffSJohn Scipione 6754cbcabffSJohn Scipione 6764cbcabffSJohn Scipione/*! 67747852bffSJohn Scipione \name List Type Methods 6784cbcabffSJohn Scipione*/ 6794cbcabffSJohn Scipione 6804cbcabffSJohn Scipione 6814cbcabffSJohn Scipione//! @{ 6824cbcabffSJohn Scipione 6834cbcabffSJohn Scipione 6844cbcabffSJohn Scipione/*! 6854cbcabffSJohn Scipione \fn void BListView::SetListType(list_view_type type) 6864cbcabffSJohn Scipione \brief Sets the list view \a type. 6874cbcabffSJohn Scipione 68847852bffSJohn Scipione 68947852bffSJohn Scipione \since BeOS R3 6904cbcabffSJohn Scipione \param type The list view \a type to set. 6914cbcabffSJohn Scipione*/ 6924cbcabffSJohn Scipione 6934cbcabffSJohn Scipione 6944cbcabffSJohn Scipione/*! 6954cbcabffSJohn Scipione \fn list_view_type BListView::ListType() const 6964cbcabffSJohn Scipione \brief Returns the current list view type. 6974cbcabffSJohn Scipione 6984cbcabffSJohn Scipione \return The list view type. 69947852bffSJohn Scipione 70047852bffSJohn Scipione \since BeOS R3 7014cbcabffSJohn Scipione*/ 7024cbcabffSJohn Scipione 7034cbcabffSJohn Scipione 7044cbcabffSJohn Scipione//! @} 7054cbcabffSJohn Scipione 7064cbcabffSJohn Scipione 7074cbcabffSJohn Scipione/*! 70847852bffSJohn Scipione \name List Methods 7094cbcabffSJohn Scipione*/ 7104cbcabffSJohn Scipione 7114cbcabffSJohn Scipione 7124cbcabffSJohn Scipione//! @{ 7134cbcabffSJohn Scipione 7144cbcabffSJohn Scipione 7154cbcabffSJohn Scipione/*! 7164cbcabffSJohn Scipione \fn BListItem* BListView::ItemAt(int32 index) const 7174cbcabffSJohn Scipione \brief Returns the list item at the specified \a index. 7184cbcabffSJohn Scipione 7194cbcabffSJohn Scipione \param index 7204cbcabffSJohn Scipione 7214cbcabffSJohn Scipione \return The list item at the specified \a index. 72247852bffSJohn Scipione 72347852bffSJohn Scipione \since BeOS R3 7244cbcabffSJohn Scipione*/ 7254cbcabffSJohn Scipione 7264cbcabffSJohn Scipione 7274cbcabffSJohn Scipione/*! 7284cbcabffSJohn Scipione \fn int32 BListView::IndexOf(BListItem* item) const 7294cbcabffSJohn Scipione \brief Returns the index of the specified \a item. 7304cbcabffSJohn Scipione 7314cbcabffSJohn Scipione \param item The list item to get the index of. 7324cbcabffSJohn Scipione 7334cbcabffSJohn Scipione \return The index of the specified \a item. 73447852bffSJohn Scipione 73547852bffSJohn Scipione \since BeOS R3 7364cbcabffSJohn Scipione*/ 7374cbcabffSJohn Scipione 7384cbcabffSJohn Scipione 7394cbcabffSJohn Scipione/*! 7404cbcabffSJohn Scipione \fn int32 BListView::IndexOf(BPoint point) const 7414cbcabffSJohn Scipione \brief Returns the index of the item at the specified \a point. 7424cbcabffSJohn Scipione 7434cbcabffSJohn Scipione \param point The location of the list item to get the index of. 7444cbcabffSJohn Scipione 7454cbcabffSJohn Scipione \return The index of the list item at the specified \a point. 74647852bffSJohn Scipione 74747852bffSJohn Scipione \since BeOS R3 7484cbcabffSJohn Scipione*/ 7494cbcabffSJohn Scipione 7504cbcabffSJohn Scipione 7514cbcabffSJohn Scipione/*! 7524cbcabffSJohn Scipione \fn BListItem* BListView::FirstItem() const 753853f7246SJohn Scipione \brief Returns a pointer to the first list item. 7544cbcabffSJohn Scipione 755*d579eb9eSMáximo Castañeda \return A pointer to the first item in the list or \c NULL if there are no items. 75647852bffSJohn Scipione 75747852bffSJohn Scipione \since BeOS R3 7584cbcabffSJohn Scipione*/ 7594cbcabffSJohn Scipione 7604cbcabffSJohn Scipione 7614cbcabffSJohn Scipione/*! 7624cbcabffSJohn Scipione \fn BListItem* BListView::LastItem() const 763853f7246SJohn Scipione \brief Returns a pointer to the last list item. 7644cbcabffSJohn Scipione 765*d579eb9eSMáximo Castañeda \return A pointer to the last item in the list or \c NULL if there are no items. 76647852bffSJohn Scipione 76747852bffSJohn Scipione \since BeOS R3 7684cbcabffSJohn Scipione*/ 7694cbcabffSJohn Scipione 7704cbcabffSJohn Scipione 7714cbcabffSJohn Scipione/*! 7724cbcabffSJohn Scipione \fn bool BListView::HasItem(BListItem* item) const 7734cbcabffSJohn Scipione \brief Returns whether or not the list contains the specified \a item. 7744cbcabffSJohn Scipione 7754cbcabffSJohn Scipione \param item The list item to check. 7764cbcabffSJohn Scipione 777853f7246SJohn Scipione \return \c true if \a item is in the list, \c false otherwise. 77847852bffSJohn Scipione 77947852bffSJohn Scipione \since BeOS R3 7804cbcabffSJohn Scipione*/ 7814cbcabffSJohn Scipione 7824cbcabffSJohn Scipione 7834cbcabffSJohn Scipione/*! 7844cbcabffSJohn Scipione \fn int32 BListView::CountItems() const 785853f7246SJohn Scipione \brief Returns the number of items contained in the list view. 7864cbcabffSJohn Scipione 787853f7246SJohn Scipione \return The number of items. 78847852bffSJohn Scipione 78947852bffSJohn Scipione \since BeOS R3 7904cbcabffSJohn Scipione*/ 7914cbcabffSJohn Scipione 7924cbcabffSJohn Scipione 7934cbcabffSJohn Scipione/*! 7944cbcabffSJohn Scipione \fn void BListView::MakeEmpty() 795853f7246SJohn Scipione \brief Empties the list view of all items. 79647852bffSJohn Scipione 79747852bffSJohn Scipione \since BeOS R3 7984cbcabffSJohn Scipione*/ 7994cbcabffSJohn Scipione 8004cbcabffSJohn Scipione 8014cbcabffSJohn Scipione/*! 8024cbcabffSJohn Scipione \fn bool BListView::IsEmpty() const 803853f7246SJohn Scipione \brief Returns whether or not the list view is empty. 8044cbcabffSJohn Scipione 805853f7246SJohn Scipione \return \c true if the list view is empty, \c false otherwise. 80647852bffSJohn Scipione 80747852bffSJohn Scipione \since BeOS R3 8084cbcabffSJohn Scipione*/ 8094cbcabffSJohn Scipione 8104cbcabffSJohn Scipione 8114cbcabffSJohn Scipione/*! 812080bf8feSJohn Scipione \fn void BListView::DoForEach(bool (*func)(BListItem* item)) 8134cbcabffSJohn Scipione \brief Calls the specified function on each item in the list. 8144cbcabffSJohn Scipione 815853f7246SJohn Scipione The \a func is called on the items in order starting with the item at 816853f7246SJohn Scipione index 0 and ending at the last item in the list. This method stops 817853f7246SJohn Scipione calling the \a func once it returns \a true or the end of the list 818853f7246SJohn Scipione is reached. 8194cbcabffSJohn Scipione 8204cbcabffSJohn Scipione The first argument of \a func is a pointer to the list item. 8214cbcabffSJohn Scipione 8224cbcabffSJohn Scipione \param func The function to call on each item. 82347852bffSJohn Scipione 82447852bffSJohn Scipione \since BeOS R3 8254cbcabffSJohn Scipione*/ 8264cbcabffSJohn Scipione 8274cbcabffSJohn Scipione 8284cbcabffSJohn Scipione/*! 829080bf8feSJohn Scipione \fn void BListView::DoForEach(bool (*func)(BListItem* item, void* arg), 830080bf8feSJohn Scipione void* arg) 8314cbcabffSJohn Scipione \brief Calls the specified function on each item in the list. 8324cbcabffSJohn Scipione 833853f7246SJohn Scipione The \a func is called on the items in order starting with the item at 834853f7246SJohn Scipione index 0 and ending at the last item in the list. This method stops 835853f7246SJohn Scipione calling the \a func once it returns \a true or the end of the list 836853f7246SJohn Scipione is reached. 8374cbcabffSJohn Scipione 838853f7246SJohn Scipione The first argument of \a func is a pointer to the list item, \a arg is 839853f7246SJohn Scipione passed in as the second argument. 8404cbcabffSJohn Scipione 8414cbcabffSJohn Scipione \param func The function to call on each item. 842080bf8feSJohn Scipione \param arg The second argument of the function. 84347852bffSJohn Scipione 84447852bffSJohn Scipione \since BeOS R3 8454cbcabffSJohn Scipione*/ 8464cbcabffSJohn Scipione 8474cbcabffSJohn Scipione 8484cbcabffSJohn Scipione/*! 8494cbcabffSJohn Scipione \fn const BListItem** BListView::Items() const 8504cbcabffSJohn Scipione \brief Returns a pointer to the list of list items. 8514cbcabffSJohn Scipione 8524cbcabffSJohn Scipione \returns a pointer to the list of list items. 85347852bffSJohn Scipione 85447852bffSJohn Scipione \since BeOS R3 8554cbcabffSJohn Scipione*/ 8564cbcabffSJohn Scipione 8574cbcabffSJohn Scipione 8584cbcabffSJohn Scipione//! @} 8594cbcabffSJohn Scipione 8604cbcabffSJohn Scipione 8614cbcabffSJohn Scipione/*! 8624cbcabffSJohn Scipione \fn void BListView::InvalidateItem(int32 index) 8634cbcabffSJohn Scipione \brief Draws the list item at the specified \a index. 8644cbcabffSJohn Scipione 8654cbcabffSJohn Scipione \param index The \a index of the list item to draw. 86647852bffSJohn Scipione 86747852bffSJohn Scipione \since Haiku R1 8684cbcabffSJohn Scipione*/ 8694cbcabffSJohn Scipione 8704cbcabffSJohn Scipione 8714cbcabffSJohn Scipione/*! 87247852bffSJohn Scipione \name Selection 8734cbcabffSJohn Scipione*/ 8744cbcabffSJohn Scipione 8754cbcabffSJohn Scipione 8764cbcabffSJohn Scipione//! @{ 8774cbcabffSJohn Scipione 8784cbcabffSJohn Scipione 8794cbcabffSJohn Scipione/*! 8804cbcabffSJohn Scipione \fn void BListView::Select(int32 index, bool extend) 8814cbcabffSJohn Scipione \brief Selects the list item at the specified \a index. 8824cbcabffSJohn Scipione 8834cbcabffSJohn Scipione \param index The \a index of the item to select. 8844cbcabffSJohn Scipione \param extend Whether or not to also select child items. 88547852bffSJohn Scipione 88647852bffSJohn Scipione \since BeOS R3 8874cbcabffSJohn Scipione*/ 8884cbcabffSJohn Scipione 8894cbcabffSJohn Scipione 8904cbcabffSJohn Scipione/*! 8914cbcabffSJohn Scipione \fn void BListView::Select(int32 start, int32 finish, bool extend) 8924cbcabffSJohn Scipione \brief Select items from \a start to \a finish. 8934cbcabffSJohn Scipione 8944cbcabffSJohn Scipione \param start The index of the item to start the selection. 8954cbcabffSJohn Scipione \param finish The index of the item to end the selection. 8964cbcabffSJohn Scipione \param extend Whether or not to also select child items. 89747852bffSJohn Scipione 89847852bffSJohn Scipione \since BeOS R3 8994cbcabffSJohn Scipione*/ 9004cbcabffSJohn Scipione 9014cbcabffSJohn Scipione 9024cbcabffSJohn Scipione/*! 9034cbcabffSJohn Scipione \fn bool BListView::IsItemSelected(int32 index) const 9044cbcabffSJohn Scipione \brief Returns whether or not the item at \a index is selected. 9054cbcabffSJohn Scipione 9064cbcabffSJohn Scipione \return \c true if the item was selected, \c false otherwise. 90747852bffSJohn Scipione 90847852bffSJohn Scipione \since BeOS R3 9094cbcabffSJohn Scipione*/ 9104cbcabffSJohn Scipione 9114cbcabffSJohn Scipione 9124cbcabffSJohn Scipione/*! 9134cbcabffSJohn Scipione \fn int32 BListView::CurrentSelection(int32 index) const 9144cbcabffSJohn Scipione \brief Returns the index of a currently selected item relative to the passed 9154cbcabffSJohn Scipione in \a index. 9164cbcabffSJohn Scipione 9174cbcabffSJohn Scipione If the index of the selected item is lower than \a index the value returned 9184cbcabffSJohn Scipione is negative, if the index of the selected item is greater than \a index the 9194cbcabffSJohn Scipione value returned is positive. If the index of the selected item is equal to 9204cbcabffSJohn Scipione \a index then 0 is returned. 9214cbcabffSJohn Scipione 922853f7246SJohn Scipione \param index The \a index of the item to get relative to the selected item's 9234cbcabffSJohn Scipione index. 92447852bffSJohn Scipione 92547852bffSJohn Scipione \since BeOS R3 9264cbcabffSJohn Scipione*/ 9274cbcabffSJohn Scipione 9284cbcabffSJohn Scipione 9294cbcabffSJohn Scipione//! @} 9304cbcabffSJohn Scipione 9314cbcabffSJohn Scipione 9324cbcabffSJohn Scipione/*! 9334cbcabffSJohn Scipione \fn status_t BListView::Invoke(BMessage* message) 9344cbcabffSJohn Scipione \brief Invoke the list view, either with the current invocation message or 9354cbcabffSJohn Scipione \a message if it is specified. 9364cbcabffSJohn Scipione 9374cbcabffSJohn Scipione \param message The message to send or \c NULL to send the current invocation 9384cbcabffSJohn Scipione message. 9394cbcabffSJohn Scipione 9404cbcabffSJohn Scipione \see BControl::Invoke() 94147852bffSJohn Scipione 94247852bffSJohn Scipione \since BeOS R3 9434cbcabffSJohn Scipione*/ 9444cbcabffSJohn Scipione 9454cbcabffSJohn Scipione 9464cbcabffSJohn Scipione/*! 94747852bffSJohn Scipione \name Deselection 9484cbcabffSJohn Scipione*/ 9494cbcabffSJohn Scipione 9504cbcabffSJohn Scipione 9514cbcabffSJohn Scipione//! @{ 9524cbcabffSJohn Scipione 9534cbcabffSJohn Scipione 9544cbcabffSJohn Scipione/*! 9554cbcabffSJohn Scipione \fn void BListView::DeselectAll() 9564cbcabffSJohn Scipione \brief Deselect all items. 95747852bffSJohn Scipione 95847852bffSJohn Scipione \since BeOS R3 9594cbcabffSJohn Scipione*/ 9604cbcabffSJohn Scipione 9614cbcabffSJohn Scipione 9624cbcabffSJohn Scipione/*! 9634cbcabffSJohn Scipione \fn void BListView::DeselectExcept(int32 exceptFrom, int32 exceptTo) 9644cbcabffSJohn Scipione \brief Deselect all items except the items with index in the range of 9654cbcabffSJohn Scipione \a exceptFrom to \a exceptTo. 9664cbcabffSJohn Scipione 9674cbcabffSJohn Scipione \param exceptFrom The index of the start of the exception list. 9684cbcabffSJohn Scipione \param exceptTo The index of the end of the exception list. 96947852bffSJohn Scipione 97047852bffSJohn Scipione \since BeOS R3 9714cbcabffSJohn Scipione*/ 9724cbcabffSJohn Scipione 9734cbcabffSJohn Scipione 9744cbcabffSJohn Scipione/*! 9754cbcabffSJohn Scipione \fn void BListView::Deselect(int32 index) 9764cbcabffSJohn Scipione \brief Deselect the item at \a index. 9774cbcabffSJohn Scipione 9784cbcabffSJohn Scipione \param index The \a index of the item to deselect. 97947852bffSJohn Scipione 98047852bffSJohn Scipione \since BeOS R3 9814cbcabffSJohn Scipione*/ 9824cbcabffSJohn Scipione 9834cbcabffSJohn Scipione 9844cbcabffSJohn Scipione//! @} 9854cbcabffSJohn Scipione 9864cbcabffSJohn Scipione 9874cbcabffSJohn Scipione/*! 9884cbcabffSJohn Scipione \fn void BListView::SortItems(int (*cmp)(const void *, const void *)) 989853f7246SJohn Scipione \brief Sort the items according the the passed in \a cmp function. 9904cbcabffSJohn Scipione 9914cbcabffSJohn Scipione \param cmp The compare function to use to sort the items. 99247852bffSJohn Scipione 99347852bffSJohn Scipione \since BeOS R3 9944cbcabffSJohn Scipione*/ 9954cbcabffSJohn Scipione 9964cbcabffSJohn Scipione 9974cbcabffSJohn Scipione/*! 9984cbcabffSJohn Scipione \fn bool BListView::SwapItems(int32 a, int32 b) 9994cbcabffSJohn Scipione \brief Swap item \a a with item \a b. 10004cbcabffSJohn Scipione 10014cbcabffSJohn Scipione \param a The index of the first item to swap. 10024cbcabffSJohn Scipione \param b The index of the second item to swap. 10034cbcabffSJohn Scipione 10044cbcabffSJohn Scipione \return \c true if the items were swapped, \c false otherwise. 100547852bffSJohn Scipione 100647852bffSJohn Scipione \since BeOS R3 10074cbcabffSJohn Scipione*/ 10084cbcabffSJohn Scipione 10094cbcabffSJohn Scipione 10104cbcabffSJohn Scipione/*! 10114cbcabffSJohn Scipione \fn bool BListView::MoveItem(int32 from, int32 to) 10124cbcabffSJohn Scipione \brief Move the item at index \a from to the position in the list at index \a to. 10134cbcabffSJohn Scipione 10144cbcabffSJohn Scipione \param from The index of the item to move. 10154cbcabffSJohn Scipione \param to The index to move the item to. 10164cbcabffSJohn Scipione 10174cbcabffSJohn Scipione \return \c true if the item was moved, \c false otherwise. 101847852bffSJohn Scipione 101947852bffSJohn Scipione \since BeOS R3 10204cbcabffSJohn Scipione*/ 10214cbcabffSJohn Scipione 10224cbcabffSJohn Scipione 10234cbcabffSJohn Scipione/*! 10244cbcabffSJohn Scipione \fn bool BListView::ReplaceItem(int32 index, BListItem* item) 10254cbcabffSJohn Scipione \brief Replace the item at index \a index with \a item. 10264cbcabffSJohn Scipione 10274cbcabffSJohn Scipione \param index The \a index of the item to replace. 10284cbcabffSJohn Scipione \param item The \a item to replace the item at \a index with. 10294cbcabffSJohn Scipione 10304cbcabffSJohn Scipione \return \c true if the item was replaced, \c false otherwise. 103147852bffSJohn Scipione 103247852bffSJohn Scipione \since BeOS R3 10334cbcabffSJohn Scipione*/ 10344cbcabffSJohn Scipione 10354cbcabffSJohn Scipione 10364cbcabffSJohn Scipione/*! 10374cbcabffSJohn Scipione \fn BRect BListView::ItemFrame(int32 index) 10384cbcabffSJohn Scipione \brief Return the frame of the item at the specified \a index. 10394cbcabffSJohn Scipione 10404cbcabffSJohn Scipione \param index The \a index of the item to get the frame of. 10414cbcabffSJohn Scipione 10424cbcabffSJohn Scipione \returns The frame of the item at \a index. 104347852bffSJohn Scipione 104447852bffSJohn Scipione \since BeOS R3 10454cbcabffSJohn Scipione*/ 10464cbcabffSJohn Scipione 10474cbcabffSJohn Scipione 10484cbcabffSJohn Scipione/*! 10494cbcabffSJohn Scipione \fn BHandler* BListView::ResolveSpecifier(BMessage* message, int32 index, 105047852bffSJohn Scipione BMessage* specifier, int32 what, const char* property); 105147852bffSJohn Scipione \brief Determines the proper handler for the passed in scripting \a message. 10524cbcabffSJohn Scipione 105347852bffSJohn Scipione \copydetails BView::ResolveSpecifier() 10544cbcabffSJohn Scipione*/ 10554cbcabffSJohn Scipione 10564cbcabffSJohn Scipione 10574cbcabffSJohn Scipione/*! 10584cbcabffSJohn Scipione \fn status_t BListView::GetSupportedSuites(BMessage* data) 10594cbcabffSJohn Scipione \brief Reports the suites of messages and specifiers that derived classes 10604cbcabffSJohn Scipione understand. 10614cbcabffSJohn Scipione 106247852bffSJohn Scipione \copydetails BView::GetSupportedSuites() 10634cbcabffSJohn Scipione*/ 10644cbcabffSJohn Scipione 10654cbcabffSJohn Scipione 10664cbcabffSJohn Scipione/*! 10674cbcabffSJohn Scipione \fn status_t BListView::Perform(perform_code code, void* _data) 10684cbcabffSJohn Scipione \brief Performs an action give a perform_code and data. (Internal Method) 10694cbcabffSJohn Scipione 107047852bffSJohn Scipione \copydetails BHandler::Perform() 107147852bffSJohn Scipione*/ 10724cbcabffSJohn Scipione 10734cbcabffSJohn Scipione 107447852bffSJohn Scipione/*! 107547852bffSJohn Scipione \fn bool BListView::DoMiscellaneous(MiscCode code, MiscData* data) 107647852bffSJohn Scipione \brief Do a miscellaneous action. 107747852bffSJohn Scipione 107847852bffSJohn Scipione \param code The action \a code to use. 107947852bffSJohn Scipione - \c B_NO_OP: Do nothing 108047852bffSJohn Scipione - \c B_REPLACE_OP: Replace the item in \a data 108147852bffSJohn Scipione - \c B_MOVE_OP: Move the item in \a data. 108247852bffSJohn Scipione - \c B_SWAP_OP: Swap the items in \a data. 108347852bffSJohn Scipione \param data The \a data to act on. 108447852bffSJohn Scipione 108547852bffSJohn Scipione \since Haiku R1 10864cbcabffSJohn Scipione*/ 1087