InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IListBoxController Class Referenceabstract

#include <IListBoxController.h>

Inheritance diagram for IListBoxController:
IPMUnknown

Public Types

enum  { kNoSelection = -1 }
 
enum  { kDefaultIID = IID_ILISTBOXCONTROLLER }
 

Public Member Functions

Item selection
virtual void Select (int32 index, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual void SelectAll (bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual void Deselect (int32 index=-1, bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual void DeselectAll (bool16 invalidate=kTrue, bool16 notifyOfChange=kTrue)=0
 
virtual bool16 IsSelected (int32 index) const =0
 
virtual int32 GetSelected () const =0
 
virtual void GetSelected (K2Vector< int32 > &multipleSelection) const =0
 
virtual void GetCheckedItems (K2Vector< int32 > &checkedItems) const =0
 
virtual void SetCheckedItems (const K2Vector< int32 > &vecIndices, bool16 bInvalidate=kTrue, bool16 bNotify=kTrue)=0
 
virtual void SetMasterItem (int32 itemNumber)=0
 
virtual int32 GetMasterItem () const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

ListBox Use

enum  eListBoxPart {
  kInNothing = 0, kInScrollbar, kInList, kInListBelowItems,
  kInTopAutoScrollArea
}
 
enum  eScrollDirection {
  kNoScroll = 0, kScrollUp, kScrollUpSlow, kScrollDown,
  kScrollDownSlow, kScrollLeft, kScrollLeftSlow, kScrollRight,
  kScrollRightSlow, kInsideDoNothing
}
 
virtual void SetClickItem (int32 itemNumber)=0
 
virtual int32 GetClickItem () const =0
 
virtual int32 FindRowHit (const PMPoint &clickPoint)=0
 
virtual eListBoxPart ClickedWhichPart (const PMPoint &clickPoint)=0
 
virtual void ScrollList (const eScrollDirection direction)=0
 
virtual void ScrollItemIntoView (int32 itemNumber)=0
 
virtual int32 GetFirstVisibleItem () const =0
 
virtual int32 GetMaximumVisibleItems () const =0
 
virtual int32 Search (const PMString &subString) const =0
 
virtual PMString GetNthItemString (int32 n) const =0
 
virtual void GetVisibleItemBounds (int32 item, PMRect &newBounds)=0
 
virtual eScrollDirection CheckScrollDirection (eScrollDirection direction)=0
 
virtual eScrollDirection CheckDragScroll (const PMPoint &where)=0
 
virtual void SetSelected (const K2Vector< int32 > &vecIndices, bool16 bInvalidate=kTrue, bool16 bNotify=kTrue)=0
 
virtual void ProcessSelectionRules (IEvent *event, int32 index)=0
 

Detailed Description

Interface to access/set list-box selection and other state. There may be cases where you want to override this to provide a custom search; see the Search() method on this interface for more detail.

Member Enumeration Documentation

Identify part of list box clicked
Enumerator
kInNothing 

no part of the list was clicked

kInScrollbar 

the scrollbar was clicked

kInList 

a listitem was clicked

kInListBelowItems 

the user clicked in the empty area in the list but below any list items

kInTopAutoScrollArea 

the user clicked in a small area at the top of the list (part of the first visible item)

Identify scrolling state

Member Function Documentation

virtual eScrollDirection IListBoxController::CheckDragScroll (const PMPointwhere)
pure virtual

Internal use.

virtual eScrollDirection IListBoxController::CheckScrollDirection (eScrollDirection direction)
pure virtual

Internal use.

virtual eListBoxPart IListBoxController::ClickedWhichPart (const PMPointclickPoint)
pure virtual

Given a point, ClickedWhichPart will tell you what part of the list was clicked on.

virtual void IListBoxController::Deselect (int32 index = -1,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
pure virtual

Deselect the element at the given position in the list.

Parameters
indexposition of item to unselect
invalidatewhether control should be invalidated
notifyOfChangespecify whether registered observers should be notified of this change
virtual void IListBoxController::DeselectAll (bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
pure virtual

Deselect all elements.

Parameters
invalidatewhether control should be invalidated
notifyOfChangespecify whether registered observers should be notified of this change
virtual int32 IListBoxController::FindRowHit (const PMPointclickPoint)
pure virtual

Given a point, FindRowHit returns the list row under the point

virtual void IListBoxController::GetCheckedItems (K2Vector< int32 > & checkedItems) const
pure virtual

Fills in collection with indices of elements from the list with checkbox value ticked. Checked item list is different from the selected items The elements are in the order the user checked items.

Parameters
checkedItemsOUT parameter, holds indices of cheched items
virtual int32 IListBoxController::GetClickItem () const
pure virtual

Return the item number of the last item clicked, or -1 for no item

virtual int32 IListBoxController::GetFirstVisibleItem () const
pure virtual

returns the zero based index of the first visible item at the top of the list box

virtual int32 IListBoxController::GetMasterItem () const
pure virtual

Determine the index of master item in the listbox, if it exists

Returns
index of master item or -1 if there's no master item
virtual int32 IListBoxController::GetMaximumVisibleItems () const
pure virtual

returns the numbers of "slots" completely visible in the list box

virtual PMString IListBoxController::GetNthItemString (int32 n) const
pure virtual

Given a list index, return the name of it. Used by Search() function for typeahead. By default returns empty string, so typeahead if off by default.

virtual int32 IListBoxController::GetSelected () const
pure virtual

Get index of the currently selected element.

Returns
index of currently selected element
virtual void IListBoxController::GetSelected (K2Vector< int32 > & multipleSelection) const
pure virtual

Fills in collection with indexes of selected elements. The elements are in the order the user selected the items.

Parameters
multipleSelectionOUT parameter, holds indices of selected elements
virtual void IListBoxController::GetVisibleItemBounds (int32 item,
PMRectnewBounds 
)
pure virtual

Internal use.

virtual bool16 IListBoxController::IsSelected (int32 index) const
pure virtual

Return true if the item with index is selected.

Returns
kTrue if item at given position is selected, kFalse otherwise
virtual void IListBoxController::ProcessSelectionRules (IEventevent,
int32 index 
)
pure virtual

Let the underlying tree control process the selection rules for a mouse event. This is only supported in list controls that are based on the tree control.

virtual void IListBoxController::ScrollItemIntoView (int32 itemNumber)
pure virtual

automatically scroll the list so that item "itemNumber" is visible

virtual void IListBoxController::ScrollList (const eScrollDirection direction)
pure virtual

depending upon "direction", the list is scrolled one way or the other

virtual int32 IListBoxController::Search (const PMStringsubString) const
pure virtual

Used when a listbox has focus and user types: Search first looks through all the items of the list looking for an item that has a name that begins with "subString."

If such an item is found, the index of the item is returned. If no item is found, this function then looks for an item that has a name that contains "subString." If such an item is found, the index of the item is returned. If no item is found, Search returns -1.

Typically, subclassers will override GetNthItemString because only they know how to interpret their list control data or widget hierarchy stored in the list. But Search can also be overridden if default search algorithm described above doesn't meet your needs.

By default, this function always returns -1 unless the GetNthItemString function is provided.

virtual void IListBoxController::Select (int32 index,
bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
pure virtual

Select the element at the given position in the list.

Parameters
indexspecifies position of item to select
invalidatewhether control should be invalidated
notifyOfChangespecify whether registered observers should be notified of this change
virtual void IListBoxController::SelectAll (bool16 invalidate = kTrue,
bool16 notifyOfChange = kTrue 
)
pure virtual

Select all elements of the list.

Parameters
invalidatewhether control should be invalidated
notifyOfChangespecify whether registered observers should be notified of this change
virtual void IListBoxController::SetCheckedItems (const K2Vector< int32 > & vecIndices,
bool16 bInvalidate = kTrue,
bool16 bNotify = kTrue 
)
pure virtual

Sets the checkbox values of the items with indexes matching from vecIndices Do it only, when the dropdown list has checkboxes in it (would be the case if multiple selection with checkboxes enabled) The elements are in the order the user checked items.

Parameters
vecIndiceslist of items of the dropdown, whose checkbox values needs to be ticked
invalidatewhether control should be invalidated
bNotifyspecify whether registered observers should be notified of this change
virtual void IListBoxController::SetClickItem (int32 itemNumber)
pure virtual

Set the item number of the last item clicked on

virtual void IListBoxController::SetMasterItem (int32 itemNumber)
pure virtual

Item can never be deselected, -1 for no item

Parameters
itemNumberspecifies an item that is always to be selected
virtual void IListBoxController::SetSelected (const K2Vector< int32 > & vecIndices,
bool16 bInvalidate = kTrue,
bool16 bNotify = kTrue 
)
pure virtual

Select the set of indices in the specified vector. Generally faster than writing the loop yourself for reasonably large selections (>25).