struct CCL::IItemView

Overview

View interface for list and tree controls. More…

#include <iitemmodel.h>

struct IItemView: public CCL::IItemDragTarget
{
    // methods

    virtual void CCL_API setModel (IItemModel* model) = 0;
    virtual IItemModel*CCL_API getModel () const = 0;
    virtual const IItemSelection&CCL_API getSelection () const = 0;
    virtual tbool CCL_API selectItem (ItemIndexRef index, tbool state) = 0;
    virtual tbool CCL_API selectAll (tbool state) = 0;
    virtual tbool CCL_API removeItem (ItemIndexRef index) = 0;
    virtual tbool CCL_API findItems (const Rect& rect, IItemSelection& items) const = 0;
    virtual tbool CCL_API findItem (ItemIndex& index, const Point& where) const = 0;

    virtual void CCL_API getItemRect (
        Rect& rect,
        ItemIndexRef index,
        int column = -1
    ) const = 0;

    virtual tbool CCL_API getFocusItem (ItemIndex& index) const = 0;

    virtual tbool CCL_API setFocusItem (
        ItemIndexRef index,
        tbool selectExclusive = true
    ) = 0;

    virtual tbool CCL_API invalidateItem (ItemIndexRef index) = 0;
    virtual void CCL_API makeItemVisible (ItemIndexRef index) = 0;
    virtual void CCL_API setEditControl (IView* view, tbool directed = true) = 0;
    virtual void CCL_API setEditModeParam (IParameter* parameter) = 0;

    virtual void CCL_API beginMouseHandler (
        IMouseHandler* handler,
        const MouseEvent& mouseEvent
    ) = 0;

    virtual tbool CCL_API findItemCell (
        ItemIndex& row,
        int& column,
        const Point& where
    ) const = 0;

    DECLARE_STRINGID_MEMBER (kSelectionChanged);
};

Inherited Members

public:
    // enums

    enum ItemDragFlags;

    // methods

    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;

    virtual IDragHandler*CCL_API createDragHandler (
        int flags = kCanDragBetweenItems,
        IItemDragVerifier* verifier = nullptr
    ) = 0;

Detailed Documentation

View interface for list and tree controls.

Methods

virtual void CCL_API setModel (IItemModel* model) = 0

Associate model with view (model is shared).

virtual IItemModel*CCL_API getModel () const = 0

Get associated model.

virtual const IItemSelection&CCL_API getSelection () const = 0

Get selection.

virtual tbool CCL_API selectItem (ItemIndexRef index, tbool state) = 0

Select or unselect an item.

virtual tbool CCL_API selectAll (tbool state) = 0

Select or unselect all items.

virtual tbool CCL_API removeItem (ItemIndexRef index) = 0

Remove an item.

virtual tbool CCL_API findItems (const Rect& rect, IItemSelection& items) const = 0

Find all items in a rectangle.

virtual tbool CCL_API findItem (ItemIndex& index, const Point& where) const = 0

Find an item at a position.

virtual void CCL_API getItemRect (
    Rect& rect,
    ItemIndexRef index,
    int column = -1
) const = 0

Get Rectangle of item.

virtual tbool CCL_API getFocusItem (ItemIndex& index) const = 0

Get selected item.

virtual tbool CCL_API setFocusItem (
    ItemIndexRef index,
    tbool selectExclusive = true
) = 0

Select specified item.

virtual tbool CCL_API invalidateItem (ItemIndexRef index) = 0

Invalidate specified item.

virtual void CCL_API makeItemVisible (ItemIndexRef index) = 0

Try to make an item visible by scrolling.

virtual void CCL_API setEditControl (IView* view, tbool directed = true) = 0

Set an edit control (owned by the item view).

virtual void CCL_API setEditModeParam (IParameter* parameter) = 0

Set a parameter that controls the items view’s edit mode.

virtual void CCL_API beginMouseHandler (
    IMouseHandler* handler,
    const MouseEvent& mouseEvent
) = 0

Begin mouse handler, can be called from IItemModel::editCell().

virtual tbool CCL_API findItemCell (
    ItemIndex& row,
    int& column,
    const Point& where
) const = 0

Find an item cell at a position.

DECLARE_STRINGID_MEMBER (kSelectionChanged)

< arg[0]: IDragSession

< arg[0]: IDragSession