1*4cbcabffSJohn Scipione/* 2*4cbcabffSJohn Scipione * Copyright 2013 Haiku Inc. All rights reserved. 3*4cbcabffSJohn Scipione * Distributed under the terms of the MIT License. 4*4cbcabffSJohn Scipione * 5*4cbcabffSJohn Scipione * Authors: 6*4cbcabffSJohn Scipione * John Scipione, jscipione@gmail.com 7*4cbcabffSJohn Scipione * 8*4cbcabffSJohn Scipione * Corresponds to: 9*4cbcabffSJohn Scipione * headers/os/interface/ListView.h hrev45555 10*4cbcabffSJohn Scipione * src/kits/interface/ListView.cpp hrev45555 11*4cbcabffSJohn Scipione */ 12*4cbcabffSJohn Scipione 13*4cbcabffSJohn Scipione 14*4cbcabffSJohn Scipione/*! 15*4cbcabffSJohn Scipione \file ListView.h 16*4cbcabffSJohn Scipione \ingroup interface 17*4cbcabffSJohn Scipione \ingroup libbe 18*4cbcabffSJohn Scipione \brief ListView class definition. 19*4cbcabffSJohn Scipione*/ 20*4cbcabffSJohn Scipione 21*4cbcabffSJohn Scipione 22*4cbcabffSJohn Scipione/*! 23*4cbcabffSJohn Scipione \class BListView 24*4cbcabffSJohn Scipione \ingroup interface 25*4cbcabffSJohn Scipione \ingroup libbe 26*4cbcabffSJohn Scipione \brief Displays a list of items that the user can select and invoke. 27*4cbcabffSJohn Scipione 28*4cbcabffSJohn Scipione BListView's can be one of two types set by the type parameter of the constructor: 29*4cbcabffSJohn Scipione - \c B_SINGLE_SELECTION_LIST Can select only one item in the list at a time. 30*4cbcabffSJohn Scipione This is the default. 31*4cbcabffSJohn Scipione - \c B_MULTIPLE_SELECTION_LIST Can select any number of items by holding down 32*4cbcabffSJohn Scipione Option for a discontinuous selection, or Shift for a contiguous selection. 33*4cbcabffSJohn Scipione 34*4cbcabffSJohn Scipione An example of a BListView looks like this: 35*4cbcabffSJohn Scipione \image html BListView_example.png 36*4cbcabffSJohn Scipione 37*4cbcabffSJohn Scipione Click on an item to select it and double-click an item to invoke it. The 38*4cbcabffSJohn Scipione BListView doesn't define what it means to "invoke" an item. See 39*4cbcabffSJohn Scipione BListView::SetSelectionMessage() and BListView::SetInvocationMessage() to set 40*4cbcabffSJohn Scipione a message to be set when these actions occur. You can also select and invoke 41*4cbcabffSJohn Scipione items with keyboard keys such as the up and down arrow keys, Page Up and Page 42*4cbcabffSJohn Scipione Down and the Enter key or Space key to invoke the item. 43*4cbcabffSJohn Scipione 44*4cbcabffSJohn Scipione This class is based on the BList class from the Support Kit and many of the 45*4cbcabffSJohn Scipione methods it uses behave similarly. 46*4cbcabffSJohn Scipione 47*4cbcabffSJohn Scipione Although a BListView is scrollable, it doesn't provide scroll bars by itself. 48*4cbcabffSJohn Scipione You should add the BListView as a child of a BScrollView to make it scrollable. 49*4cbcabffSJohn Scipione 50*4cbcabffSJohn Scipione The code to add a BListView to a BScrollView looks something like this: 51*4cbcabffSJohn Scipione 52*4cbcabffSJohn Scipione\code 53*4cbcabffSJohn Scipione BListView* list = new BListView(frame, "List", B_SINGLE_SELECTION_LIST); 54*4cbcabffSJohn Scipione list->AddItem(new BStringItem("Item 1")); 55*4cbcabffSJohn Scipione list->AddItem(new BStringItem("Item 2")); 56*4cbcabffSJohn Scipione ... 57*4cbcabffSJohn Scipione view->AddChild(new BScrollView("scroll_view", list, 58*4cbcabffSJohn Scipione B_FOLLOW_LEFT | B_FOLLOW_TOP, 0, false, true)); 59*4cbcabffSJohn Scipione\endcode 60*4cbcabffSJohn Scipione 61*4cbcabffSJohn Scipione \see BScrollView for more information on scrolling views. 62*4cbcabffSJohn Scipione \see BList in the Support Kit. 63*4cbcabffSJohn Scipione \see BOutlineListView 64*4cbcabffSJohn Scipione \see BListItem 65*4cbcabffSJohn Scipione*/ 66*4cbcabffSJohn Scipione 67*4cbcabffSJohn Scipione 68*4cbcabffSJohn Scipione/*! 69*4cbcabffSJohn Scipione \fn BListView::BListView(BRect frame, const char* name, list_view_type type, 70*4cbcabffSJohn Scipione uint32 resizingMode, uint32 flags) 71*4cbcabffSJohn Scipione \brief Creates a new list view. This is the non-layout constructor. 72*4cbcabffSJohn Scipione 73*4cbcabffSJohn Scipione \param frame The frame rectangle of the view. 74*4cbcabffSJohn Scipione \param name The name of the view. 75*4cbcabffSJohn Scipione \param type Whether the list view supports a single selection or multiple 76*4cbcabffSJohn Scipione selections. 77*4cbcabffSJohn Scipione \param resizingMode The resizing mode flags. 78*4cbcabffSJohn Scipione \param flags The view flags. 79*4cbcabffSJohn Scipione*/ 80*4cbcabffSJohn Scipione 81*4cbcabffSJohn Scipione 82*4cbcabffSJohn Scipione/*! 83*4cbcabffSJohn Scipione \fn BListView::BListView(const char* name, list_view_type type, uint32 flags) 84*4cbcabffSJohn Scipione \brief Creates a new list view suitable as part of a layout with the specified 85*4cbcabffSJohn Scipione \a name, \a type, and \a flags. 86*4cbcabffSJohn Scipione 87*4cbcabffSJohn Scipione \param name The name of the view. 88*4cbcabffSJohn Scipione \param type Whether the list view supports a single selection or multiple 89*4cbcabffSJohn Scipione selections. 90*4cbcabffSJohn Scipione \param flags The view flags. 91*4cbcabffSJohn Scipione*/ 92*4cbcabffSJohn Scipione 93*4cbcabffSJohn Scipione 94*4cbcabffSJohn Scipione/*! 95*4cbcabffSJohn Scipione \fn BListView::BListView(list_view_type type) 96*4cbcabffSJohn Scipione \brief Creates a new list view suitable as part of a layout. 97*4cbcabffSJohn Scipione 98*4cbcabffSJohn Scipione \param type Whether the list view supports a single selection or multiple 99*4cbcabffSJohn Scipione selections. 100*4cbcabffSJohn Scipione*/ 101*4cbcabffSJohn Scipione 102*4cbcabffSJohn Scipione 103*4cbcabffSJohn Scipione/*! 104*4cbcabffSJohn Scipione \fn BListView::BListView(BMessage* archive) 105*4cbcabffSJohn Scipione \brief Creates a list view from an \a archive message. 106*4cbcabffSJohn Scipione 107*4cbcabffSJohn Scipione \param archive The message to create the list view from. 108*4cbcabffSJohn Scipione*/ 109*4cbcabffSJohn Scipione 110*4cbcabffSJohn Scipione 111*4cbcabffSJohn Scipione/*! 112*4cbcabffSJohn Scipione \fn BListView::~BListView() 113*4cbcabffSJohn Scipione \brief Delete the list view and free the memory used. 114*4cbcabffSJohn Scipione 115*4cbcabffSJohn Scipione This method does not free the list items. 116*4cbcabffSJohn Scipione*/ 117*4cbcabffSJohn Scipione 118*4cbcabffSJohn Scipione 119*4cbcabffSJohn Scipione/*! 120*4cbcabffSJohn Scipione \name Archiving 121*4cbcabffSJohn Scipione*/ 122*4cbcabffSJohn Scipione 123*4cbcabffSJohn Scipione 124*4cbcabffSJohn Scipione//! @{ 125*4cbcabffSJohn Scipione 126*4cbcabffSJohn Scipione 127*4cbcabffSJohn Scipione/*! 128*4cbcabffSJohn Scipione \fn BArchivable* BListView::Instantiate(BMessage* archive) 129*4cbcabffSJohn Scipione \brief Create a new list view from the message \a archive. 130*4cbcabffSJohn Scipione 131*4cbcabffSJohn Scipione \param archive The message to create the list view from. 132*4cbcabffSJohn Scipione*/ 133*4cbcabffSJohn Scipione 134*4cbcabffSJohn Scipione 135*4cbcabffSJohn Scipione/*! 136*4cbcabffSJohn Scipione \fn status_t BListView::Archive(BMessage* archive, bool deep) const 137*4cbcabffSJohn Scipione \brief Archive the list view to a message. 138*4cbcabffSJohn Scipione 139*4cbcabffSJohn Scipione \param archive The message to archive the list view to. 140*4cbcabffSJohn Scipione \param deep \c true to archive child views. 141*4cbcabffSJohn Scipione*/ 142*4cbcabffSJohn Scipione 143*4cbcabffSJohn Scipione 144*4cbcabffSJohn Scipione//! @} 145*4cbcabffSJohn Scipione 146*4cbcabffSJohn Scipione 147*4cbcabffSJohn Scipione/*! 148*4cbcabffSJohn Scipione \name Hook methods 149*4cbcabffSJohn Scipione*/ 150*4cbcabffSJohn Scipione 151*4cbcabffSJohn Scipione 152*4cbcabffSJohn Scipione//! @{ 153*4cbcabffSJohn Scipione 154*4cbcabffSJohn Scipione 155*4cbcabffSJohn Scipione/*! 156*4cbcabffSJohn Scipione \fn void BListView::Draw(BRect updateRect) 157*4cbcabffSJohn Scipione \brief Hook method called to draw the contents of the text view. 158*4cbcabffSJohn Scipione 159*4cbcabffSJohn Scipione You should not have to call this method directly, use Invalidate() instead. 160*4cbcabffSJohn Scipione 161*4cbcabffSJohn Scipione \param updateRect The rectangular area to draw. 162*4cbcabffSJohn Scipione 163*4cbcabffSJohn Scipione \see BView::Draw() 164*4cbcabffSJohn Scipione*/ 165*4cbcabffSJohn Scipione 166*4cbcabffSJohn Scipione 167*4cbcabffSJohn Scipione/*! 168*4cbcabffSJohn Scipione \fn void BListView::AttachedToWindow() 169*4cbcabffSJohn Scipione \brief Hook method called when the list view is added to the view hierarchy. 170*4cbcabffSJohn Scipione 171*4cbcabffSJohn Scipione \see BView::AttachedToWindow() 172*4cbcabffSJohn Scipione*/ 173*4cbcabffSJohn Scipione 174*4cbcabffSJohn Scipione 175*4cbcabffSJohn Scipione/*! 176*4cbcabffSJohn Scipione \fn void BListView::DetachedFromWindow() 177*4cbcabffSJohn Scipione \brief Hook method that is called when the list view is removed from the 178*4cbcabffSJohn Scipione view hierarchy. 179*4cbcabffSJohn Scipione 180*4cbcabffSJohn Scipione \see BView::DetachedFromWindow() 181*4cbcabffSJohn Scipione*/ 182*4cbcabffSJohn Scipione 183*4cbcabffSJohn Scipione 184*4cbcabffSJohn Scipione/*! 185*4cbcabffSJohn Scipione \fn void BListView::AllAttached() 186*4cbcabffSJohn Scipione \brief Hook method called once all views are attached to the view. 187*4cbcabffSJohn Scipione 188*4cbcabffSJohn Scipione \see BView::AllAttached() 189*4cbcabffSJohn Scipione*/ 190*4cbcabffSJohn Scipione 191*4cbcabffSJohn Scipione 192*4cbcabffSJohn Scipione/*! 193*4cbcabffSJohn Scipione \fn void BListView::AllDetached() 194*4cbcabffSJohn Scipione \brief Hook method called once all views are detached from the view. 195*4cbcabffSJohn Scipione 196*4cbcabffSJohn Scipione \see BView::AllDetached() 197*4cbcabffSJohn Scipione*/ 198*4cbcabffSJohn Scipione 199*4cbcabffSJohn Scipione 200*4cbcabffSJohn Scipione/*! 201*4cbcabffSJohn Scipione \fn void BListView::FrameResized(float width, float height) 202*4cbcabffSJohn Scipione \brief Hook method called when the list view is resized. 203*4cbcabffSJohn Scipione 204*4cbcabffSJohn Scipione \param width The new \a width of the list view. 205*4cbcabffSJohn Scipione \param height The new \a height of the list view. 206*4cbcabffSJohn Scipione 207*4cbcabffSJohn Scipione \see BView::FrameResized() 208*4cbcabffSJohn Scipione*/ 209*4cbcabffSJohn Scipione 210*4cbcabffSJohn Scipione 211*4cbcabffSJohn Scipione/*! 212*4cbcabffSJohn Scipione \fn void BListView::FrameMoved(BPoint new_position) 213*4cbcabffSJohn Scipione \brief Hook method called when the list view is moved. 214*4cbcabffSJohn Scipione 215*4cbcabffSJohn Scipione \param new_position The list view's new position. 216*4cbcabffSJohn Scipione*/ 217*4cbcabffSJohn Scipione 218*4cbcabffSJohn Scipione 219*4cbcabffSJohn Scipione/*! 220*4cbcabffSJohn Scipione \fn void BListView::TargetedByScrollView(BScrollView *view) 221*4cbcabffSJohn Scipione \brief Hook method called when the list view is attached to a BScrollView. 222*4cbcabffSJohn Scipione 223*4cbcabffSJohn Scipione \param view The BScrollView the list view is attached to. 224*4cbcabffSJohn Scipione*/ 225*4cbcabffSJohn Scipione 226*4cbcabffSJohn Scipione 227*4cbcabffSJohn Scipione/*! 228*4cbcabffSJohn Scipione \fn void BListView::WindowActivated(bool state) 229*4cbcabffSJohn Scipione \brief Hook method that is called when the window becomes the active window 230*4cbcabffSJohn Scipione or gives up that status. 231*4cbcabffSJohn Scipione 232*4cbcabffSJohn Scipione \param state If \c true, window has just been activated. If \c false the 233*4cbcabffSJohn Scipione window has just been deactivated. 234*4cbcabffSJohn Scipione 235*4cbcabffSJohn Scipione \see BView::WindowActivated() 236*4cbcabffSJohn Scipione*/ 237*4cbcabffSJohn Scipione 238*4cbcabffSJohn Scipione 239*4cbcabffSJohn Scipione/*! 240*4cbcabffSJohn Scipione \fn void BListView::MessageReceived(BMessage* message) 241*4cbcabffSJohn Scipione \brief Hook method called with a message is received by the list view. 242*4cbcabffSJohn Scipione 243*4cbcabffSJohn Scipione \param message The message received by the list view. 244*4cbcabffSJohn Scipione 245*4cbcabffSJohn Scipione \see BView::MessageReceived() 246*4cbcabffSJohn Scipione*/ 247*4cbcabffSJohn Scipione 248*4cbcabffSJohn Scipione 249*4cbcabffSJohn Scipione/*! 250*4cbcabffSJohn Scipione \fn void BListView::KeyDown(const char* bytes, int32 numBytes) 251*4cbcabffSJohn Scipione \brief Hook method that is called when a key is pressed while the view is 252*4cbcabffSJohn Scipione the focus view of the active window. 253*4cbcabffSJohn Scipione 254*4cbcabffSJohn Scipione The following keys are used by the list view by default: 255*4cbcabffSJohn Scipione - Up Arrow Selects the previous item. 256*4cbcabffSJohn Scipione - Down Arrow Selects the next item. 257*4cbcabffSJohn Scipione - Page Up Selects the item one view height above the current item. 258*4cbcabffSJohn Scipione - Page Down Selects the item one view height below the current item. 259*4cbcabffSJohn Scipione - Home Selects the first item in the list. 260*4cbcabffSJohn Scipione - End Select the last item in the list. 261*4cbcabffSJohn Scipione - Enter and Spacebar Invokes the currently selected item. 262*4cbcabffSJohn Scipione 263*4cbcabffSJohn Scipione \param bytes The \a bytes representing the keys pushed down. 264*4cbcabffSJohn Scipione \param numBytes The size of \a bytes. 265*4cbcabffSJohn Scipione 266*4cbcabffSJohn Scipione \see BView::KeyDown() 267*4cbcabffSJohn Scipione*/ 268*4cbcabffSJohn Scipione 269*4cbcabffSJohn Scipione 270*4cbcabffSJohn Scipione/*! 271*4cbcabffSJohn Scipione \fn void BListView::KeyUp(const char* bytes, int32 numBytes) 272*4cbcabffSJohn Scipione \brief Hook method that is called when a keyboard key is released. 273*4cbcabffSJohn Scipione 274*4cbcabffSJohn Scipione \param bytes The \a bytes representing the keys released. 275*4cbcabffSJohn Scipione \param numBytes The size of \a bytes. 276*4cbcabffSJohn Scipione 277*4cbcabffSJohn Scipione \see BView::KeyUp() 278*4cbcabffSJohn Scipione*/ 279*4cbcabffSJohn Scipione 280*4cbcabffSJohn Scipione 281*4cbcabffSJohn Scipione/*! 282*4cbcabffSJohn Scipione \fn void BListView::MouseDown(BPoint point) 283*4cbcabffSJohn Scipione \brief Hook method that is called when a mouse button is pushed down while 284*4cbcabffSJohn Scipione the cursor is contained in the view. 285*4cbcabffSJohn Scipione 286*4cbcabffSJohn Scipione By default this method selects items on a single click, and invokes them on a 287*4cbcabffSJohn Scipione double click. This method calls InitiateDrag() to allow derived classes the 288*4cbcabffSJohn Scipione opportunity to drag and drop items from the list. 289*4cbcabffSJohn Scipione 290*4cbcabffSJohn Scipione \param point The \a point where the mouse button was pushed down. 291*4cbcabffSJohn Scipione 292*4cbcabffSJohn Scipione \see BView::MouseDown() 293*4cbcabffSJohn Scipione*/ 294*4cbcabffSJohn Scipione 295*4cbcabffSJohn Scipione 296*4cbcabffSJohn Scipione/*! 297*4cbcabffSJohn Scipione \fn void BListView::MouseUp(BPoint where) 298*4cbcabffSJohn Scipione \brief Hook method that is called when a mouse button is released while 299*4cbcabffSJohn Scipione the cursor is contained in the view. 300*4cbcabffSJohn Scipione 301*4cbcabffSJohn Scipione \param where The location that the mouse button was released. 302*4cbcabffSJohn Scipione 303*4cbcabffSJohn Scipione \see BView::MouseUp() 304*4cbcabffSJohn Scipione*/ 305*4cbcabffSJohn Scipione 306*4cbcabffSJohn Scipione 307*4cbcabffSJohn Scipione/*! 308*4cbcabffSJohn Scipione \fn void BListView::MouseMoved(BPoint where, uint32 code, 309*4cbcabffSJohn Scipione const BMessage* dragMessage) 310*4cbcabffSJohn Scipione \brief Hook method that is called whenever the mouse cursor enters, exits 311*4cbcabffSJohn Scipione or moves inside the list view. 312*4cbcabffSJohn Scipione 313*4cbcabffSJohn Scipione \param where The point where the mouse cursor has moved to. 314*4cbcabffSJohn Scipione \param code A code which indicating if the mouse entered or exited the view. 315*4cbcabffSJohn Scipione \param dragMessage A message containing drag and drop information. 316*4cbcabffSJohn Scipione 317*4cbcabffSJohn Scipione \see BView::MouseMoved() 318*4cbcabffSJohn Scipione*/ 319*4cbcabffSJohn Scipione 320*4cbcabffSJohn Scipione 321*4cbcabffSJohn Scipione/*! 322*4cbcabffSJohn Scipione \fn bool BListView::InitiateDrag(BPoint point, int32 index, bool wasSelected) 323*4cbcabffSJohn Scipione \brief Hook method called when a drag and drop operation is initiated. 324*4cbcabffSJohn Scipione 325*4cbcabffSJohn Scipione This method is used by derived classes to implement drag and drop. This method 326*4cbcabffSJohn Scipione is called by the MouseDown() method. If the derived class initiates the drag & 327*4cbcabffSJohn Scipione drop operation you should return \c true, otherwise return \c false. By default 328*4cbcabffSJohn Scipione this method returns \c false. 329*4cbcabffSJohn Scipione 330*4cbcabffSJohn Scipione \param point Where the drag & drop operation started. 331*4cbcabffSJohn Scipione \param index 332*4cbcabffSJohn Scipione \param wasSelected Indicates whether or not the item was selected. 333*4cbcabffSJohn Scipione 334*4cbcabffSJohn Scipione \returns \c true if a drag & drop operation was initiated, \c false if not. 335*4cbcabffSJohn Scipione*/ 336*4cbcabffSJohn Scipione 337*4cbcabffSJohn Scipione 338*4cbcabffSJohn Scipione/*! 339*4cbcabffSJohn Scipione \fn void BListView::SelectionChanged() 340*4cbcabffSJohn Scipione \brief Hook method that is called when the selection changes. 341*4cbcabffSJohn Scipione 342*4cbcabffSJohn Scipione This method should be implemented by derived classes, the default 343*4cbcabffSJohn Scipione implementation does nothing. 344*4cbcabffSJohn Scipione*/ 345*4cbcabffSJohn Scipione 346*4cbcabffSJohn Scipione 347*4cbcabffSJohn Scipione//! @} 348*4cbcabffSJohn Scipione 349*4cbcabffSJohn Scipione 350*4cbcabffSJohn Scipione/*! 351*4cbcabffSJohn Scipione \name Resize methods 352*4cbcabffSJohn Scipione*/ 353*4cbcabffSJohn Scipione 354*4cbcabffSJohn Scipione 355*4cbcabffSJohn Scipione//! @{ 356*4cbcabffSJohn Scipione 357*4cbcabffSJohn Scipione 358*4cbcabffSJohn Scipione/*! 359*4cbcabffSJohn Scipione \fn void BListView::ResizeToPreferred() 360*4cbcabffSJohn Scipione \brief Resize the view to it's preferred size. 361*4cbcabffSJohn Scipione 362*4cbcabffSJohn Scipione \see BView::ResizeToPreferred() 363*4cbcabffSJohn Scipione*/ 364*4cbcabffSJohn Scipione 365*4cbcabffSJohn Scipione 366*4cbcabffSJohn Scipione/*! 367*4cbcabffSJohn Scipione \fn void BListView::GetPreferredSize(float *_width, float *_height) 368*4cbcabffSJohn Scipione \brief Fill out the \a _width and \a _height parameters with the preferred 369*4cbcabffSJohn Scipione width and height of the list view. 370*4cbcabffSJohn Scipione 371*4cbcabffSJohn Scipione \param _width The list view's preferred width is written to \a _width. 372*4cbcabffSJohn Scipione \param _height The list view's preferred height is written to \a _height. 373*4cbcabffSJohn Scipione 374*4cbcabffSJohn Scipione \see BView::GetPreferredSize() 375*4cbcabffSJohn Scipione*/ 376*4cbcabffSJohn Scipione 377*4cbcabffSJohn Scipione 378*4cbcabffSJohn Scipione/*! 379*4cbcabffSJohn Scipione \fn BSize BListView::MinSize() 380*4cbcabffSJohn Scipione \brief Returns the minimum size of the list view. 381*4cbcabffSJohn Scipione 382*4cbcabffSJohn Scipione \return The minimum size of the list view as a BSize. 383*4cbcabffSJohn Scipione 384*4cbcabffSJohn Scipione \see BView::MinSize() 385*4cbcabffSJohn Scipione*/ 386*4cbcabffSJohn Scipione 387*4cbcabffSJohn Scipione 388*4cbcabffSJohn Scipione/*! 389*4cbcabffSJohn Scipione \fn BSize BListView::MaxSize() 390*4cbcabffSJohn Scipione \brief Returns the maximum size of the list view. 391*4cbcabffSJohn Scipione 392*4cbcabffSJohn Scipione \return The maximum size of the list view as a BSize. 393*4cbcabffSJohn Scipione 394*4cbcabffSJohn Scipione \see BView::MaxSize() 395*4cbcabffSJohn Scipione*/ 396*4cbcabffSJohn Scipione 397*4cbcabffSJohn Scipione 398*4cbcabffSJohn Scipione/*! 399*4cbcabffSJohn Scipione \fn BSize BListView::PreferredSize() 400*4cbcabffSJohn Scipione \brief Returns the preferred size of the list view. 401*4cbcabffSJohn Scipione 402*4cbcabffSJohn Scipione \return The preferred size of the list view as a BSize. 403*4cbcabffSJohn Scipione 404*4cbcabffSJohn Scipione \see BView::PreferredSize() 405*4cbcabffSJohn Scipione*/ 406*4cbcabffSJohn Scipione 407*4cbcabffSJohn Scipione 408*4cbcabffSJohn Scipione//! @} 409*4cbcabffSJohn Scipione 410*4cbcabffSJohn Scipione 411*4cbcabffSJohn Scipione/*! 412*4cbcabffSJohn Scipione \fn void BListView::MakeFocus(bool focused) 413*4cbcabffSJohn Scipione \brief Highlight or unhighlight the selection when the list view acquires 414*4cbcabffSJohn Scipione or loses its focus state. 415*4cbcabffSJohn Scipione 416*4cbcabffSJohn Scipione \param focused \c true to receive focus or \c false to lose it. 417*4cbcabffSJohn Scipione 418*4cbcabffSJohn Scipione \see BView::MakeFocus() 419*4cbcabffSJohn Scipione*/ 420*4cbcabffSJohn Scipione 421*4cbcabffSJohn Scipione 422*4cbcabffSJohn Scipione/*! 423*4cbcabffSJohn Scipione \fn void BListView::SetFont(const BFont* font, uint32 mask) 424*4cbcabffSJohn Scipione \brief Sets the font of the list view to \a font with the font parameters set 425*4cbcabffSJohn Scipione by \a mask. 426*4cbcabffSJohn Scipione 427*4cbcabffSJohn Scipione \param font The \a font to set the list view to. 428*4cbcabffSJohn Scipione \param mask A \a mask indicating which properties of \a font to set. 429*4cbcabffSJohn Scipione 430*4cbcabffSJohn Scipione \see BView::SetFont() 431*4cbcabffSJohn Scipione*/ 432*4cbcabffSJohn Scipione 433*4cbcabffSJohn Scipione 434*4cbcabffSJohn Scipione/*! 435*4cbcabffSJohn Scipione \fn void BListView::ScrollTo(BPoint point) 436*4cbcabffSJohn Scipione \brief Scroll the view to the specified \a point. 437*4cbcabffSJohn Scipione 438*4cbcabffSJohn Scipione \param point The location to scroll the list view to. 439*4cbcabffSJohn Scipione 440*4cbcabffSJohn Scipione \see BView::ScrollTo() 441*4cbcabffSJohn Scipione*/ 442*4cbcabffSJohn Scipione 443*4cbcabffSJohn Scipione 444*4cbcabffSJohn Scipione/*! 445*4cbcabffSJohn Scipione \name Add and remove item methods 446*4cbcabffSJohn Scipione*/ 447*4cbcabffSJohn Scipione 448*4cbcabffSJohn Scipione 449*4cbcabffSJohn Scipione//! @{ 450*4cbcabffSJohn Scipione 451*4cbcabffSJohn Scipione 452*4cbcabffSJohn Scipione/*! 453*4cbcabffSJohn Scipione \fn bool BListView::AddItem(BListItem *item, int32 index) 454*4cbcabffSJohn Scipione \brief Add an \a item to the list view at the specified \a index. 455*4cbcabffSJohn Scipione 456*4cbcabffSJohn Scipione \param item The list item to add. 457*4cbcabffSJohn Scipione \param index The \a index of where to add the list item, if not specified the 458*4cbcabffSJohn Scipione item is added to the end. 459*4cbcabffSJohn Scipione 460*4cbcabffSJohn Scipione \return \c true if the list item was added, \c false otherwise. 461*4cbcabffSJohn Scipione*/ 462*4cbcabffSJohn Scipione 463*4cbcabffSJohn Scipione 464*4cbcabffSJohn Scipione/*! 465*4cbcabffSJohn Scipione \fn bool BListView::AddList(BList* list, int32 index) 466*4cbcabffSJohn Scipione \brief Add a \a list of list items to the list view at the specified \a index. 467*4cbcabffSJohn Scipione 468*4cbcabffSJohn Scipione \param list The \a list of list items to add. 469*4cbcabffSJohn Scipione \param index The \a index of where to add the list, if not specified the 470*4cbcabffSJohn Scipione \a list is added to the end. 471*4cbcabffSJohn Scipione 472*4cbcabffSJohn Scipione \return \c true if the \a list was added, \c false otherwise. 473*4cbcabffSJohn Scipione*/ 474*4cbcabffSJohn Scipione 475*4cbcabffSJohn Scipione 476*4cbcabffSJohn Scipione/*! 477*4cbcabffSJohn Scipione \fn bool BListView::AddList(BList* list) 478*4cbcabffSJohn Scipione \fn Add a \a list of list items to the end of the list view. 479*4cbcabffSJohn Scipione 480*4cbcabffSJohn Scipione \param list The \a list of list items to add. 481*4cbcabffSJohn Scipione 482*4cbcabffSJohn Scipione \return \c true if the \a list was added, \c false otherwise. 483*4cbcabffSJohn Scipione*/ 484*4cbcabffSJohn Scipione 485*4cbcabffSJohn Scipione 486*4cbcabffSJohn Scipione/*! 487*4cbcabffSJohn Scipione \fn BListItem* BListView::RemoveItem(int32 index) 488*4cbcabffSJohn Scipione \brief Remove the item at \a index from the list. 489*4cbcabffSJohn Scipione 490*4cbcabffSJohn Scipione \param index The \a index of the item to remove. 491*4cbcabffSJohn Scipione 492*4cbcabffSJohn Scipione \return \c true if the item was removed, \c false otherwise. 493*4cbcabffSJohn Scipione*/ 494*4cbcabffSJohn Scipione 495*4cbcabffSJohn Scipione 496*4cbcabffSJohn Scipione/*! 497*4cbcabffSJohn Scipione \fn bool BListView::RemoveItem(BListItem* item) 498*4cbcabffSJohn Scipione \brief Remove the specified list item. 499*4cbcabffSJohn Scipione 500*4cbcabffSJohn Scipione \param item The list item to remove. 501*4cbcabffSJohn Scipione 502*4cbcabffSJohn Scipione \return \c true if the \a item was removed, \c false otherwise. 503*4cbcabffSJohn Scipione*/ 504*4cbcabffSJohn Scipione 505*4cbcabffSJohn Scipione 506*4cbcabffSJohn Scipione/*! 507*4cbcabffSJohn Scipione \fn bool BListView::RemoveItems(int32 index, int32 count) 508*4cbcabffSJohn Scipione \brief Removes the items from \a index and the next \a count items. 509*4cbcabffSJohn Scipione 510*4cbcabffSJohn Scipione \param index The location to start removing items from. 511*4cbcabffSJohn Scipione \param count The number of items past \a index to remove. 512*4cbcabffSJohn Scipione 513*4cbcabffSJohn Scipione return \c true if the \a items were removed, \c false otherwise. 514*4cbcabffSJohn Scipione*/ 515*4cbcabffSJohn Scipione 516*4cbcabffSJohn Scipione 517*4cbcabffSJohn Scipione//! @} 518*4cbcabffSJohn Scipione 519*4cbcabffSJohn Scipione 520*4cbcabffSJohn Scipione/*! 521*4cbcabffSJohn Scipione \name Selection and Invocation message methods 522*4cbcabffSJohn Scipione*/ 523*4cbcabffSJohn Scipione 524*4cbcabffSJohn Scipione 525*4cbcabffSJohn Scipione//! @{ 526*4cbcabffSJohn Scipione 527*4cbcabffSJohn Scipione 528*4cbcabffSJohn Scipione/*! 529*4cbcabffSJohn Scipione \fn void BListView::SetSelectionMessage(BMessage* message) 530*4cbcabffSJohn Scipione \brief Sets the \a message that the list view sends when a new item is selected. 531*4cbcabffSJohn Scipione 532*4cbcabffSJohn Scipione \param message The selection \a message to set. 533*4cbcabffSJohn Scipione*/ 534*4cbcabffSJohn Scipione 535*4cbcabffSJohn Scipione 536*4cbcabffSJohn Scipione/*! 537*4cbcabffSJohn Scipione \fn void BListView::SetInvocationMessage(BMessage* message) 538*4cbcabffSJohn Scipione Sets the \a message that the list view sends when an item is invoked. 539*4cbcabffSJohn Scipione 540*4cbcabffSJohn Scipione \param message The invocation \a message to set. 541*4cbcabffSJohn Scipione 542*4cbcabffSJohn Scipione \see BInvoker::SetMessage() 543*4cbcabffSJohn Scipione*/ 544*4cbcabffSJohn Scipione 545*4cbcabffSJohn Scipione 546*4cbcabffSJohn Scipione/*! 547*4cbcabffSJohn Scipione \fn BMessage* BListView::InvocationMessage() const 548*4cbcabffSJohn Scipione \brief Returns the message that is send when an item is invoked. 549*4cbcabffSJohn Scipione 550*4cbcabffSJohn Scipione \return The current invocation method as a BMessage. 551*4cbcabffSJohn Scipione 552*4cbcabffSJohn Scipione \see BInvoker::Message() 553*4cbcabffSJohn Scipione*/ 554*4cbcabffSJohn Scipione 555*4cbcabffSJohn Scipione 556*4cbcabffSJohn Scipione/*! 557*4cbcabffSJohn Scipione \fn uint32 BListView::InvocationCommand() const 558*4cbcabffSJohn Scipione \brief Returns the what parameter of the current invocation method. 559*4cbcabffSJohn Scipione 560*4cbcabffSJohn Scipione \returns The what parameter of the currently set invocation method. 561*4cbcabffSJohn Scipione 562*4cbcabffSJohn Scipione \see BInvoker::Command() 563*4cbcabffSJohn Scipione*/ 564*4cbcabffSJohn Scipione 565*4cbcabffSJohn Scipione 566*4cbcabffSJohn Scipione/*! 567*4cbcabffSJohn Scipione \fn BMessage* BListView::SelectionMessage() const 568*4cbcabffSJohn Scipione \brief Returns the message that is send when an item is selected. 569*4cbcabffSJohn Scipione 570*4cbcabffSJohn Scipione \return The current selection message as a BMessage. 571*4cbcabffSJohn Scipione*/ 572*4cbcabffSJohn Scipione 573*4cbcabffSJohn Scipione 574*4cbcabffSJohn Scipione/*! 575*4cbcabffSJohn Scipione \fn uint32 BListView::SelectionCommand() const 576*4cbcabffSJohn Scipione \brief Returns the what parameter of the message that is send when an item is 577*4cbcabffSJohn Scipione selected. 578*4cbcabffSJohn Scipione 579*4cbcabffSJohn Scipione \return The what parameter of the current selection message. 580*4cbcabffSJohn Scipione*/ 581*4cbcabffSJohn Scipione 582*4cbcabffSJohn Scipione 583*4cbcabffSJohn Scipione//! @} 584*4cbcabffSJohn Scipione 585*4cbcabffSJohn Scipione 586*4cbcabffSJohn Scipione/*! 587*4cbcabffSJohn Scipione \name List type methods 588*4cbcabffSJohn Scipione*/ 589*4cbcabffSJohn Scipione 590*4cbcabffSJohn Scipione 591*4cbcabffSJohn Scipione//! @{ 592*4cbcabffSJohn Scipione 593*4cbcabffSJohn Scipione 594*4cbcabffSJohn Scipione/*! 595*4cbcabffSJohn Scipione \fn void BListView::SetListType(list_view_type type) 596*4cbcabffSJohn Scipione \brief Sets the list view \a type. 597*4cbcabffSJohn Scipione 598*4cbcabffSJohn Scipione \param type The list view \a type to set. 599*4cbcabffSJohn Scipione*/ 600*4cbcabffSJohn Scipione 601*4cbcabffSJohn Scipione 602*4cbcabffSJohn Scipione/*! 603*4cbcabffSJohn Scipione \fn list_view_type BListView::ListType() const 604*4cbcabffSJohn Scipione \brief Returns the current list view type. 605*4cbcabffSJohn Scipione 606*4cbcabffSJohn Scipione \return The list view type. 607*4cbcabffSJohn Scipione*/ 608*4cbcabffSJohn Scipione 609*4cbcabffSJohn Scipione 610*4cbcabffSJohn Scipione//! @} 611*4cbcabffSJohn Scipione 612*4cbcabffSJohn Scipione 613*4cbcabffSJohn Scipione/*! 614*4cbcabffSJohn Scipione \name List methods 615*4cbcabffSJohn Scipione*/ 616*4cbcabffSJohn Scipione 617*4cbcabffSJohn Scipione 618*4cbcabffSJohn Scipione//! @{ 619*4cbcabffSJohn Scipione 620*4cbcabffSJohn Scipione 621*4cbcabffSJohn Scipione/*! 622*4cbcabffSJohn Scipione \fn BListItem* BListView::ItemAt(int32 index) const 623*4cbcabffSJohn Scipione \brief Returns the list item at the specified \a index. 624*4cbcabffSJohn Scipione 625*4cbcabffSJohn Scipione \param index 626*4cbcabffSJohn Scipione 627*4cbcabffSJohn Scipione \return The list item at the specified \a index. 628*4cbcabffSJohn Scipione*/ 629*4cbcabffSJohn Scipione 630*4cbcabffSJohn Scipione 631*4cbcabffSJohn Scipione/*! 632*4cbcabffSJohn Scipione \fn int32 BListView::IndexOf(BListItem* item) const 633*4cbcabffSJohn Scipione \brief Returns the index of the specified \a item. 634*4cbcabffSJohn Scipione 635*4cbcabffSJohn Scipione \param item The list item to get the index of. 636*4cbcabffSJohn Scipione 637*4cbcabffSJohn Scipione \return The index of the specified \a item. 638*4cbcabffSJohn Scipione*/ 639*4cbcabffSJohn Scipione 640*4cbcabffSJohn Scipione 641*4cbcabffSJohn Scipione/*! 642*4cbcabffSJohn Scipione \fn int32 BListView::IndexOf(BPoint point) const 643*4cbcabffSJohn Scipione \brief Returns the index of the item at the specified \a point. 644*4cbcabffSJohn Scipione 645*4cbcabffSJohn Scipione \param point The location of the list item to get the index of. 646*4cbcabffSJohn Scipione 647*4cbcabffSJohn Scipione \return The index of the list item at the specified \a point. 648*4cbcabffSJohn Scipione*/ 649*4cbcabffSJohn Scipione 650*4cbcabffSJohn Scipione 651*4cbcabffSJohn Scipione/*! 652*4cbcabffSJohn Scipione \fn BListItem* BListView::FirstItem() const 653*4cbcabffSJohn Scipione \brief Returns the first list item. 654*4cbcabffSJohn Scipione 655*4cbcabffSJohn Scipione \return The first item in the list. 656*4cbcabffSJohn Scipione*/ 657*4cbcabffSJohn Scipione 658*4cbcabffSJohn Scipione 659*4cbcabffSJohn Scipione/*! 660*4cbcabffSJohn Scipione \fn BListItem* BListView::LastItem() const 661*4cbcabffSJohn Scipione \brief Returns the last list item. 662*4cbcabffSJohn Scipione 663*4cbcabffSJohn Scipione \return The last item in the list. 664*4cbcabffSJohn Scipione*/ 665*4cbcabffSJohn Scipione 666*4cbcabffSJohn Scipione 667*4cbcabffSJohn Scipione/*! 668*4cbcabffSJohn Scipione \fn bool BListView::HasItem(BListItem *item) const 669*4cbcabffSJohn Scipione \brief Returns whether or not the list contains the specified \a item. 670*4cbcabffSJohn Scipione 671*4cbcabffSJohn Scipione \param item The list item to check. 672*4cbcabffSJohn Scipione 673*4cbcabffSJohn Scipione \return \c true if the list item is contained in the list view, \c false 674*4cbcabffSJohn Scipione otherwise. 675*4cbcabffSJohn Scipione*/ 676*4cbcabffSJohn Scipione 677*4cbcabffSJohn Scipione 678*4cbcabffSJohn Scipione/*! 679*4cbcabffSJohn Scipione \fn int32 BListView::CountItems() const 680*4cbcabffSJohn Scipione \brief Returns the number of list items contained in the list view. 681*4cbcabffSJohn Scipione 682*4cbcabffSJohn Scipione \return The number of list items. 683*4cbcabffSJohn Scipione*/ 684*4cbcabffSJohn Scipione 685*4cbcabffSJohn Scipione 686*4cbcabffSJohn Scipione/*! 687*4cbcabffSJohn Scipione \fn void BListView::MakeEmpty() 688*4cbcabffSJohn Scipione \brief Empties the list view of all list items. 689*4cbcabffSJohn Scipione*/ 690*4cbcabffSJohn Scipione 691*4cbcabffSJohn Scipione 692*4cbcabffSJohn Scipione/*! 693*4cbcabffSJohn Scipione \fn bool BListView::IsEmpty() const 694*4cbcabffSJohn Scipione \brief Returns whether or not the list view is empty or not. 695*4cbcabffSJohn Scipione 696*4cbcabffSJohn Scipione \return \c true if the list view was empty, \c false otherwize. 697*4cbcabffSJohn Scipione*/ 698*4cbcabffSJohn Scipione 699*4cbcabffSJohn Scipione 700*4cbcabffSJohn Scipione/*! 701*4cbcabffSJohn Scipione \fn void BListView::DoForEach(bool (*func)(BListItem*)) 702*4cbcabffSJohn Scipione \brief Calls the specified function on each item in the list. 703*4cbcabffSJohn Scipione 704*4cbcabffSJohn Scipione The \a func is called on the items in order starting with the item at index 0 705*4cbcabffSJohn Scipione and ending at the last item in the list. This method stops calling the \a func 706*4cbcabffSJohn Scipione once it returns \a true or the end of the list is reached. 707*4cbcabffSJohn Scipione 708*4cbcabffSJohn Scipione The first argument of \a func is a pointer to the list item. 709*4cbcabffSJohn Scipione 710*4cbcabffSJohn Scipione \param func The function to call on each item. 711*4cbcabffSJohn Scipione*/ 712*4cbcabffSJohn Scipione 713*4cbcabffSJohn Scipione 714*4cbcabffSJohn Scipione/*! 715*4cbcabffSJohn Scipione \fn void BListView::DoForEach(bool (*func)(BListItem*, void*), void* arg) 716*4cbcabffSJohn Scipione \brief Calls the specified function on each item in the list. 717*4cbcabffSJohn Scipione 718*4cbcabffSJohn Scipione The \a func is called on the items in order starting with the item at index 0 719*4cbcabffSJohn Scipione and ending at the last item in the list. This method stops calling the \a func 720*4cbcabffSJohn Scipione once it returns \a true or the end of the list is reached. 721*4cbcabffSJohn Scipione 722*4cbcabffSJohn Scipione The first argument of \a func is a pointer to the list item, \a arg is passed in 723*4cbcabffSJohn Scipione as the second argument. 724*4cbcabffSJohn Scipione 725*4cbcabffSJohn Scipione \param func The function to call on each item. 726*4cbcabffSJohn Scipione*/ 727*4cbcabffSJohn Scipione 728*4cbcabffSJohn Scipione 729*4cbcabffSJohn Scipione/*! 730*4cbcabffSJohn Scipione \fn const BListItem** BListView::Items() const 731*4cbcabffSJohn Scipione \brief Returns a pointer to the list of list items. 732*4cbcabffSJohn Scipione 733*4cbcabffSJohn Scipione \returns a pointer to the list of list items. 734*4cbcabffSJohn Scipione*/ 735*4cbcabffSJohn Scipione 736*4cbcabffSJohn Scipione 737*4cbcabffSJohn Scipione//! @} 738*4cbcabffSJohn Scipione 739*4cbcabffSJohn Scipione 740*4cbcabffSJohn Scipione/*! 741*4cbcabffSJohn Scipione \fn void BListView::InvalidateItem(int32 index) 742*4cbcabffSJohn Scipione \brief Draws the list item at the specified \a index. 743*4cbcabffSJohn Scipione 744*4cbcabffSJohn Scipione \param index The \a index of the list item to draw. 745*4cbcabffSJohn Scipione*/ 746*4cbcabffSJohn Scipione 747*4cbcabffSJohn Scipione 748*4cbcabffSJohn Scipione/*! 749*4cbcabffSJohn Scipione \name Selection methods 750*4cbcabffSJohn Scipione*/ 751*4cbcabffSJohn Scipione 752*4cbcabffSJohn Scipione 753*4cbcabffSJohn Scipione//! @{ 754*4cbcabffSJohn Scipione 755*4cbcabffSJohn Scipione 756*4cbcabffSJohn Scipione/*! 757*4cbcabffSJohn Scipione \fn void BListView::ScrollToSelection() 758*4cbcabffSJohn Scipione \brief Scrolls to selected list item. 759*4cbcabffSJohn Scipione*/ 760*4cbcabffSJohn Scipione 761*4cbcabffSJohn Scipione 762*4cbcabffSJohn Scipione/*! 763*4cbcabffSJohn Scipione \fn void BListView::Select(int32 index, bool extend) 764*4cbcabffSJohn Scipione \brief Selects the list item at the specified \a index. 765*4cbcabffSJohn Scipione 766*4cbcabffSJohn Scipione \param index The \a index of the item to select. 767*4cbcabffSJohn Scipione \param extend Whether or not to also select child items. 768*4cbcabffSJohn Scipione*/ 769*4cbcabffSJohn Scipione 770*4cbcabffSJohn Scipione 771*4cbcabffSJohn Scipione/*! 772*4cbcabffSJohn Scipione \fn void BListView::Select(int32 start, int32 finish, bool extend) 773*4cbcabffSJohn Scipione \brief Select items from \a start to \a finish. 774*4cbcabffSJohn Scipione 775*4cbcabffSJohn Scipione \param start The index of the item to start the selection. 776*4cbcabffSJohn Scipione \param finish The index of the item to end the selection. 777*4cbcabffSJohn Scipione \param extend Whether or not to also select child items. 778*4cbcabffSJohn Scipione*/ 779*4cbcabffSJohn Scipione 780*4cbcabffSJohn Scipione 781*4cbcabffSJohn Scipione/*! 782*4cbcabffSJohn Scipione \fn bool BListView::IsItemSelected(int32 index) const 783*4cbcabffSJohn Scipione \brief Returns whether or not the item at \a index is selected. 784*4cbcabffSJohn Scipione 785*4cbcabffSJohn Scipione \return \c true if the item was selected, \c false otherwise. 786*4cbcabffSJohn Scipione*/ 787*4cbcabffSJohn Scipione 788*4cbcabffSJohn Scipione 789*4cbcabffSJohn Scipione/*! 790*4cbcabffSJohn Scipione \fn int32 BListView::CurrentSelection(int32 index) const 791*4cbcabffSJohn Scipione \brief Returns the index of a currently selected item relative to the passed 792*4cbcabffSJohn Scipione in \a index. 793*4cbcabffSJohn Scipione 794*4cbcabffSJohn Scipione If the index of the selected item is lower than \a index the value returned 795*4cbcabffSJohn Scipione is negative, if the index of the selected item is greater than \a index the 796*4cbcabffSJohn Scipione value returned is positive. If the index of the selected item is equal to 797*4cbcabffSJohn Scipione \a index then 0 is returned. 798*4cbcabffSJohn Scipione 799*4cbcabffSJohn Scipione \brief index The \a index of the item to get relative to the selected item's 800*4cbcabffSJohn Scipione index. 801*4cbcabffSJohn Scipione*/ 802*4cbcabffSJohn Scipione 803*4cbcabffSJohn Scipione 804*4cbcabffSJohn Scipione//! @} 805*4cbcabffSJohn Scipione 806*4cbcabffSJohn Scipione 807*4cbcabffSJohn Scipione/*! 808*4cbcabffSJohn Scipione \fn status_t BListView::Invoke(BMessage* message) 809*4cbcabffSJohn Scipione \brief Invoke the list view, either with the current invocation message or 810*4cbcabffSJohn Scipione \a message if it is specified. 811*4cbcabffSJohn Scipione 812*4cbcabffSJohn Scipione \param message The message to send or \c NULL to send the current invocation 813*4cbcabffSJohn Scipione message. 814*4cbcabffSJohn Scipione 815*4cbcabffSJohn Scipione \see BControl::Invoke() 816*4cbcabffSJohn Scipione*/ 817*4cbcabffSJohn Scipione 818*4cbcabffSJohn Scipione 819*4cbcabffSJohn Scipione/*! 820*4cbcabffSJohn Scipione \name Deselection methods 821*4cbcabffSJohn Scipione*/ 822*4cbcabffSJohn Scipione 823*4cbcabffSJohn Scipione 824*4cbcabffSJohn Scipione//! @{ 825*4cbcabffSJohn Scipione 826*4cbcabffSJohn Scipione 827*4cbcabffSJohn Scipione/*! 828*4cbcabffSJohn Scipione \fn void BListView::DeselectAll() 829*4cbcabffSJohn Scipione \brief Deselect all items. 830*4cbcabffSJohn Scipione*/ 831*4cbcabffSJohn Scipione 832*4cbcabffSJohn Scipione 833*4cbcabffSJohn Scipione/*! 834*4cbcabffSJohn Scipione \fn void BListView::DeselectExcept(int32 exceptFrom, int32 exceptTo) 835*4cbcabffSJohn Scipione \brief Deselect all items except the items with index in the range of 836*4cbcabffSJohn Scipione \a exceptFrom to \a exceptTo. 837*4cbcabffSJohn Scipione 838*4cbcabffSJohn Scipione \param exceptFrom The index of the start of the exception list. 839*4cbcabffSJohn Scipione \param exceptTo The index of the end of the exception list. 840*4cbcabffSJohn Scipione*/ 841*4cbcabffSJohn Scipione 842*4cbcabffSJohn Scipione 843*4cbcabffSJohn Scipione/*! 844*4cbcabffSJohn Scipione \fn void BListView::Deselect(int32 index) 845*4cbcabffSJohn Scipione \brief Deselect the item at \a index. 846*4cbcabffSJohn Scipione 847*4cbcabffSJohn Scipione \param index The \a index of the item to deselect. 848*4cbcabffSJohn Scipione*/ 849*4cbcabffSJohn Scipione 850*4cbcabffSJohn Scipione 851*4cbcabffSJohn Scipione//! @} 852*4cbcabffSJohn Scipione 853*4cbcabffSJohn Scipione 854*4cbcabffSJohn Scipione/*! 855*4cbcabffSJohn Scipione \fn void BListView::SortItems(int (*cmp)(const void *, const void *)) 856*4cbcabffSJohn Scipione \brief sort the items according the the passed in \a cmp function. 857*4cbcabffSJohn Scipione 858*4cbcabffSJohn Scipione \param cmp The compare function to use to sort the items. 859*4cbcabffSJohn Scipione*/ 860*4cbcabffSJohn Scipione 861*4cbcabffSJohn Scipione 862*4cbcabffSJohn Scipione/*! 863*4cbcabffSJohn Scipione \fn bool BListView::SwapItems(int32 a, int32 b) 864*4cbcabffSJohn Scipione \brief Swap item \a a with item \a b. 865*4cbcabffSJohn Scipione 866*4cbcabffSJohn Scipione \param a The index of the first item to swap. 867*4cbcabffSJohn Scipione \param b The index of the second item to swap. 868*4cbcabffSJohn Scipione 869*4cbcabffSJohn Scipione \return \c true if the items were swapped, \c false otherwise. 870*4cbcabffSJohn Scipione*/ 871*4cbcabffSJohn Scipione 872*4cbcabffSJohn Scipione 873*4cbcabffSJohn Scipione/*! 874*4cbcabffSJohn Scipione \fn bool BListView::MoveItem(int32 from, int32 to) 875*4cbcabffSJohn Scipione \brief Move the item at index \a from to the position in the list at index \a to. 876*4cbcabffSJohn Scipione 877*4cbcabffSJohn Scipione \param from The index of the item to move. 878*4cbcabffSJohn Scipione \param to The index to move the item to. 879*4cbcabffSJohn Scipione 880*4cbcabffSJohn Scipione \return \c true if the item was moved, \c false otherwise. 881*4cbcabffSJohn Scipione*/ 882*4cbcabffSJohn Scipione 883*4cbcabffSJohn Scipione 884*4cbcabffSJohn Scipione/*! 885*4cbcabffSJohn Scipione \fn bool BListView::ReplaceItem(int32 index, BListItem* item) 886*4cbcabffSJohn Scipione \brief Replace the item at index \a index with \a item. 887*4cbcabffSJohn Scipione 888*4cbcabffSJohn Scipione \param index The \a index of the item to replace. 889*4cbcabffSJohn Scipione \param item The \a item to replace the item at \a index with. 890*4cbcabffSJohn Scipione 891*4cbcabffSJohn Scipione \return \c true if the item was replaced, \c false otherwise. 892*4cbcabffSJohn Scipione*/ 893*4cbcabffSJohn Scipione 894*4cbcabffSJohn Scipione 895*4cbcabffSJohn Scipione/*! 896*4cbcabffSJohn Scipione \fn BRect BListView::ItemFrame(int32 index) 897*4cbcabffSJohn Scipione \brief Return the frame of the item at the specified \a index. 898*4cbcabffSJohn Scipione 899*4cbcabffSJohn Scipione \param index The \a index of the item to get the frame of. 900*4cbcabffSJohn Scipione 901*4cbcabffSJohn Scipione \returns The frame of the item at \a index. 902*4cbcabffSJohn Scipione*/ 903*4cbcabffSJohn Scipione 904*4cbcabffSJohn Scipione 905*4cbcabffSJohn Scipione/*! 906*4cbcabffSJohn Scipione \fn BHandler* BListView::ResolveSpecifier(BMessage* message, int32 index, 907*4cbcabffSJohn Scipione BMessage* specifier, int32 form, const char* property); 908*4cbcabffSJohn Scipione \brief Returns the proper handler for the passed in scripting \a message. 909*4cbcabffSJohn Scipione 910*4cbcabffSJohn Scipione \param message The scripting message to determine the handler. 911*4cbcabffSJohn Scipione \param index The index of the specifier. 912*4cbcabffSJohn Scipione \param specifier The message which contains the specifier. 913*4cbcabffSJohn Scipione \param form The 'what' field of the specifier message. 914*4cbcabffSJohn Scipione \param property The name of the target property. 915*4cbcabffSJohn Scipione 916*4cbcabffSJohn Scipione \return The proper BHandler for the passed in scripting \a message. 917*4cbcabffSJohn Scipione 918*4cbcabffSJohn Scipione \see BView::ResolveSpecifier() 919*4cbcabffSJohn Scipione*/ 920*4cbcabffSJohn Scipione 921*4cbcabffSJohn Scipione 922*4cbcabffSJohn Scipione/*! 923*4cbcabffSJohn Scipione \fn status_t BListView::GetSupportedSuites(BMessage* data) 924*4cbcabffSJohn Scipione \brief Reports the suites of messages and specifiers that derived classes 925*4cbcabffSJohn Scipione understand. 926*4cbcabffSJohn Scipione 927*4cbcabffSJohn Scipione \param data The message to report the suite of messages and specifiers. 928*4cbcabffSJohn Scipione 929*4cbcabffSJohn Scipione \see BView::GetSupportedSuites() 930*4cbcabffSJohn Scipione*/ 931*4cbcabffSJohn Scipione 932*4cbcabffSJohn Scipione 933*4cbcabffSJohn Scipione/*! 934*4cbcabffSJohn Scipione \fn status_t BListView::Perform(perform_code code, void* _data) 935*4cbcabffSJohn Scipione \brief Performs an action give a perform_code and data. (Internal Method) 936*4cbcabffSJohn Scipione 937*4cbcabffSJohn Scipione \param code The perform code 938*4cbcabffSJohn Scipione \param _data A pointer to some data to perform on 939*4cbcabffSJohn Scipione 940*4cbcabffSJohn Scipione \return A status code. 941*4cbcabffSJohn Scipione 942*4cbcabffSJohn Scipione \see BView::Perform() 943*4cbcabffSJohn Scipione*/ 944