NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
CSelListModelImpl< Item > Class Template Referenceabstract

Search Toolkit Book for CSelListModelImpl

CSelListModelImpl provides a defult implementation of ISelListModel. More...

#include <gui/widgets/aln_multiple/sel_list_model_impl.hpp>

+ Inheritance diagram for CSelListModelImpl< Item >:
+ Collaboration diagram for CSelListModelImpl< Item >:

Public Types

typedef ISelListModel< Item >::TItem TItem
 
typedef ISelListModel< Item >::TIndex TIndex
 
typedef ISelListModel< Item >::TIndexVector TIndexVector
 
typedef vector< TItemTItemVector
 
typedef ISelListView< TItemTSelListView
 related interfaces More...
 
typedef ISelListModel< TItemTSelListModel
 
- Public Types inherited from ISelListModel< Item >
typedef Item TItem
 
typedef int TIndex
 
typedef vector< TIndexTIndexVector
 

Public Member Functions

virtual TIndex SLM_GetItemsCount () const
 
virtual TItem SLM_GetItem (TIndex index) const
 
virtual TIndex SLM_GetFocusedItemIndex () const
 
virtual bool SLM_IsItemSelected (TIndex index) const
 
virtual TIndex SLM_GetSelectedCount () const
 
virtual void SLM_GetSelectedIndices (TIndexVector &vIndices) const
 
virtual void SLM_GetSelectedItems (TItemVector &items) const
 
virtual void SLM_FocusItem (TIndex index)
 
virtual void SLM_SelectSingleItem (TIndex index)
 
virtual void SLM_InvertSingleItem (TIndex index)
 
virtual void SLM_SelectItems (const TIndexVector &vIndeces, bool b_reset_others=false)
 Select items with given indices. More...
 
virtual void SLM_SelectAll (bool bSelect=true)
 
virtual void SLM_SelectTo (TIndex index)
 
virtual void SLM_AddSLView (TSelListView *pView)
 
virtual void SLM_RemoveSLView (TSelListView *pView)
 
- Public Member Functions inherited from ISelListModel< Item >
virtual ~ISelListModel ()
 
virtual void SLM_AddSLView (ISelListView< Item > *pView)=0
 
virtual void SLM_RemoveSLView (ISelListView< Item > *pView)=0
 

Protected Types

typedef pair< TItem, boolTItemEntry
 
typedef vector< TItemEntryTEntryVector
 
typedef map< TItem, intTItemToIndexMap
 
typedef list< TSelListView * > TViewList
 

Protected Member Functions

 CSelListModelImpl ()
 class CSelListModelImpl More...
 
void SetItems (const TItemVector &vItems, bool b_update, bool b_keep_selection=false)
 
bool InsertItem (TIndex index, const TItem &item, bool b_update)
 
void InsertItems (const TItemVector &v_items, const TIndexVector &v_indices, bool b_update)
 
bool DeleteItem (TIndex index, bool bUpdate=true)
 
void DeleteItems (const TIndexVector &vIndices, bool b_update)
 
void DeleteAllItems ()
 
virtual void x_SelectItem (TIndex index, bool b_sel)=0
 
virtual bool x_IsItemSelected (TIndex index) const =0
 
virtual TIndex x_GetItemsCount () const =0
 
virtual TItem x_GetItem (TIndex index) const =0
 
virtual void x_SetEntries (const TEntryVector &v_entries)=0
 
virtual TIndex x_GetItemIndex (const TItem &item)=0
 
virtual void x_InsertItem (TIndex index, const TItemEntry &entry)=0
 inserts item, but does not updates all data structures More...
 
virtual void x_CompleteInsertion ()=0
 performs update after all items have been inserted More...
 
virtual void x_MarkItemForErase (TIndex index)=0
 mark item for deletion More...
 
virtual void x_EraseMarkedItems ()=0
 deletes all marked items in a single pass, performs neccessary updates More...
 
virtual void x_ClearItems ()=0
 
void x_EraseItem (TIndex index)
 TODO. More...
 
void x_Clear ()
 
void x_GetSelectedItems (TIndexVector &vIndices)
 
void x_ViewsUpdateItems (TIndexVector &vIndices)
 
void x_ViewsUpdateItemRange (int iStart, int iEnd)
 

Protected Attributes

int m_SelectedCount
 
int m_iFocusedItem
 
int m_iAnchorItem
 
TViewList m_lsViews
 

Detailed Description

template<class Item>
class CSelListModelImpl< Item >

CSelListModelImpl provides a defult implementation of ISelListModel.

m_iFocusedItem and m_iAnchor item are not updated automatically.

Definition at line 48 of file sel_list_model_impl.hpp.

Member Typedef Documentation

◆ TEntryVector

template<class Item >
typedef vector<TItemEntry> CSelListModelImpl< Item >::TEntryVector
protected

Definition at line 101 of file sel_list_model_impl.hpp.

◆ TIndex

template<class Item >
typedef ISelListModel<Item>::TIndex CSelListModelImpl< Item >::TIndex

Definition at line 52 of file sel_list_model_impl.hpp.

◆ TIndexVector

template<class Item >
typedef ISelListModel<Item>::TIndexVector CSelListModelImpl< Item >::TIndexVector

Definition at line 53 of file sel_list_model_impl.hpp.

◆ TItem

template<class Item >
typedef ISelListModel<Item>::TItem CSelListModelImpl< Item >::TItem

Definition at line 51 of file sel_list_model_impl.hpp.

◆ TItemEntry

template<class Item >
typedef pair<TItem, bool> CSelListModelImpl< Item >::TItemEntry
protected

Definition at line 100 of file sel_list_model_impl.hpp.

◆ TItemToIndexMap

template<class Item >
typedef map<TItem, int> CSelListModelImpl< Item >::TItemToIndexMap
protected

Definition at line 102 of file sel_list_model_impl.hpp.

◆ TItemVector

template<class Item >
typedef vector<TItem> CSelListModelImpl< Item >::TItemVector

Definition at line 55 of file sel_list_model_impl.hpp.

◆ TSelListModel

template<class Item >
typedef ISelListModel<TItem> CSelListModelImpl< Item >::TSelListModel

Definition at line 61 of file sel_list_model_impl.hpp.

◆ TSelListView

template<class Item >
typedef ISelListView<TItem> CSelListModelImpl< Item >::TSelListView

related interfaces

Definition at line 60 of file sel_list_model_impl.hpp.

◆ TViewList

template<class Item >
typedef list<TSelListView*> CSelListModelImpl< Item >::TViewList
protected

Definition at line 103 of file sel_list_model_impl.hpp.

Constructor & Destructor Documentation

◆ CSelListModelImpl()

template<class Item >
CSelListModelImpl< Item >::CSelListModelImpl
protected

class CSelListModelImpl

Definition at line 152 of file sel_list_model_impl.hpp.

Member Function Documentation

◆ DeleteAllItems()

template<class Item >
void CSelListModelImpl< Item >::DeleteAllItems
protected

Definition at line 522 of file sel_list_model_impl.hpp.

Referenced by CAlnMultiModel::ClearRows().

◆ DeleteItem()

template<class Item >
bool CSelListModelImpl< Item >::DeleteItem ( TIndex  index,
bool  bUpdate = true 
)
protected

Definition at line 497 of file sel_list_model_impl.hpp.

References max().

◆ DeleteItems()

template<class Item >
void CSelListModelImpl< Item >::DeleteItems ( const TIndexVector vIndices,
bool  b_update 
)
protected

Definition at line 464 of file sel_list_model_impl.hpp.

References ITERATE, and min().

Referenced by CAlnMultiModel::SetMasterRow(), and CAlnMultiModel::SetVisible().

◆ InsertItem()

template<class Item >
bool CSelListModelImpl< Item >::InsertItem ( TIndex  index,
const TItem item,
bool  b_update 
)
protected

Definition at line 446 of file sel_list_model_impl.hpp.

References max().

Referenced by CAlnMultiModel::SetMasterRow().

◆ InsertItems()

template<class Item >
void CSelListModelImpl< Item >::InsertItems ( const TItemVector v_items,
const TIndexVector v_indices,
bool  b_update 
)
protected

Definition at line 421 of file sel_list_model_impl.hpp.

References _ASSERT, i, max(), and min().

Referenced by CAlnMultiModel::SetVisible().

◆ SetItems()

template<class Item >
void CSelListModelImpl< Item >::SetItems ( const TItemVector vItems,
bool  b_update,
bool  b_keep_selection = false 
)
protected

Definition at line 386 of file sel_list_model_impl.hpp.

References i, max(), and n.

Referenced by CAlnMultiModel::CreateRows(), and CAlnMultiModel::SetVisible().

◆ SLM_AddSLView()

template<class Item >
void CSelListModelImpl< Item >::SLM_AddSLView ( TSelListView pView)
virtual

◆ SLM_FocusItem()

template<class Item >
void CSelListModelImpl< Item >::SLM_FocusItem ( TIndex  index)
virtual

Implements ISelListModel< Item >.

Definition at line 213 of file sel_list_model_impl.hpp.

Referenced by CAlnMultiModel::x_DoUpdateRowsOrder().

◆ SLM_GetFocusedItemIndex()

template<class Item >
CSelListModelImpl< Item >::TIndex CSelListModelImpl< Item >::SLM_GetFocusedItemIndex
virtual

◆ SLM_GetItem()

template<class Item >
CSelListModelImpl< Item >::TItem CSelListModelImpl< Item >::SLM_GetItem ( TIndex  index) const
virtual

Implements ISelListModel< Item >.

Definition at line 166 of file sel_list_model_impl.hpp.

◆ SLM_GetItemsCount()

template<class Item >
CSelListModelImpl< Item >::TIndex CSelListModelImpl< Item >::SLM_GetItemsCount
virtual

Implements ISelListModel< Item >.

Definition at line 160 of file sel_list_model_impl.hpp.

◆ SLM_GetSelectedCount()

template<class Item >
CSelListModelImpl< Item >::TIndex CSelListModelImpl< Item >::SLM_GetSelectedCount
virtual

◆ SLM_GetSelectedIndices()

template<class Item >
void CSelListModelImpl< Item >::SLM_GetSelectedIndices ( TIndexVector vIndices) const
virtual

◆ SLM_GetSelectedItems()

template<class Item >
void CSelListModelImpl< Item >::SLM_GetSelectedItems ( TItemVector items) const
virtual

◆ SLM_InvertSingleItem()

template<class Item >
void CSelListModelImpl< Item >::SLM_InvertSingleItem ( TIndex  index)
virtual

Implements ISelListModel< Item >.

Reimplemented in CAlnMultiModel.

Definition at line 253 of file sel_list_model_impl.hpp.

Referenced by CAlnMultiModel::SLM_InvertSingleItem().

◆ SLM_IsItemSelected()

template<class Item >
bool CSelListModelImpl< Item >::SLM_IsItemSelected ( TIndex  index) const
virtual

Implements ISelListModel< Item >.

Definition at line 178 of file sel_list_model_impl.hpp.

Referenced by CAlnMultiModel::IsItemSelected().

◆ SLM_RemoveSLView()

template<class Item >
void CSelListModelImpl< Item >::SLM_RemoveSLView ( TSelListView pView)
virtual

Definition at line 374 of file sel_list_model_impl.hpp.

References NULL, and ISelListView< Item >::SLV_SetModel().

◆ SLM_SelectAll()

template<class Item >
void CSelListModelImpl< Item >::SLM_SelectAll ( bool  bSelect = true)
virtual

Implements ISelListModel< Item >.

Reimplemented in CAlnMultiModel.

Definition at line 313 of file sel_list_model_impl.hpp.

References i.

Referenced by CAlnMultiModel::SLM_SelectAll().

◆ SLM_SelectItems()

template<class Item >
void CSelListModelImpl< Item >::SLM_SelectItems ( const TIndexVector vIndices,
bool  b_reset_others = false 
)
virtual

Select items with given indices.

If "b_invert_others" == "true" - deselects all other items.

Implements ISelListModel< Item >.

Definition at line 275 of file sel_list_model_impl.hpp.

References i, int, and ITERATE.

Referenced by CAlnMultiWidget::Select().

◆ SLM_SelectSingleItem()

template<class Item >
void CSelListModelImpl< Item >::SLM_SelectSingleItem ( TIndex  index)
virtual

Implements ISelListModel< Item >.

Reimplemented in CAlnMultiModel.

Definition at line 226 of file sel_list_model_impl.hpp.

References i.

Referenced by CAlnMultiModel::SLM_SelectSingleItem().

◆ SLM_SelectTo()

template<class Item >
void CSelListModelImpl< Item >::SLM_SelectTo ( TIndex  index)
virtual

Implements ISelListModel< Item >.

Definition at line 327 of file sel_list_model_impl.hpp.

References i, max(), and min().

◆ x_Clear()

template<class Item >
void CSelListModelImpl< Item >::x_Clear ( void  )
protected

Definition at line 530 of file sel_list_model_impl.hpp.

◆ x_ClearItems()

template<class Item >
virtual void CSelListModelImpl< Item >::x_ClearItems ( )
protectedpure virtual

Implemented in CAlnMultiModel.

◆ x_CompleteInsertion()

template<class Item >
virtual void CSelListModelImpl< Item >::x_CompleteInsertion ( )
protectedpure virtual

performs update after all items have been inserted

Implemented in CAlnMultiModel.

◆ x_EraseItem()

template<class Item >
void CSelListModelImpl< Item >::x_EraseItem ( TIndex  index)
inlineprotected

TODO.

Definition at line 126 of file sel_list_model_impl.hpp.

References _ASSERT.

◆ x_EraseMarkedItems()

template<class Item >
virtual void CSelListModelImpl< Item >::x_EraseMarkedItems ( )
protectedpure virtual

deletes all marked items in a single pass, performs neccessary updates

Implemented in CAlnMultiModel.

◆ x_GetItem()

template<class Item >
virtual TItem CSelListModelImpl< Item >::x_GetItem ( TIndex  index) const
protectedpure virtual

Implemented in CAlnMultiModel.

◆ x_GetItemIndex()

template<class Item >
virtual TIndex CSelListModelImpl< Item >::x_GetItemIndex ( const TItem item)
protectedpure virtual

Implemented in CAlnMultiModel.

◆ x_GetItemsCount()

template<class Item >
virtual TIndex CSelListModelImpl< Item >::x_GetItemsCount ( ) const
protectedpure virtual

Implemented in CAlnMultiModel.

◆ x_GetSelectedItems()

template<class Item >
void CSelListModelImpl< Item >::x_GetSelectedItems ( TIndexVector vIndices)
protected

Definition at line 540 of file sel_list_model_impl.hpp.

References _ASSERT, and i.

◆ x_InsertItem()

template<class Item >
virtual void CSelListModelImpl< Item >::x_InsertItem ( TIndex  index,
const TItemEntry entry 
)
protectedpure virtual

inserts item, but does not updates all data structures

Implemented in CAlnMultiModel.

◆ x_IsItemSelected()

template<class Item >
virtual bool CSelListModelImpl< Item >::x_IsItemSelected ( TIndex  index) const
protectedpure virtual

Implemented in CAlnMultiModel.

◆ x_MarkItemForErase()

template<class Item >
virtual void CSelListModelImpl< Item >::x_MarkItemForErase ( TIndex  index)
protectedpure virtual

mark item for deletion

Implemented in CAlnMultiModel.

◆ x_SelectItem()

template<class Item >
virtual void CSelListModelImpl< Item >::x_SelectItem ( TIndex  index,
bool  b_sel 
)
protectedpure virtual

Implemented in CAlnMultiModel.

◆ x_SetEntries()

template<class Item >
virtual void CSelListModelImpl< Item >::x_SetEntries ( const TEntryVector v_entries)
protectedpure virtual

Implemented in CAlnMultiModel.

◆ x_ViewsUpdateItemRange()

template<class Item >
void CSelListModelImpl< Item >::x_ViewsUpdateItemRange ( int  iStart,
int  iEnd 
)
protected

Definition at line 561 of file sel_list_model_impl.hpp.

References NON_CONST_ITERATE.

◆ x_ViewsUpdateItems()

template<class Item >
void CSelListModelImpl< Item >::x_ViewsUpdateItems ( TIndexVector vIndices)
protected

Definition at line 553 of file sel_list_model_impl.hpp.

References NON_CONST_ITERATE.

Member Data Documentation

◆ m_iAnchorItem

template<class Item >
int CSelListModelImpl< Item >::m_iAnchorItem
protected

Definition at line 143 of file sel_list_model_impl.hpp.

◆ m_iFocusedItem

template<class Item >
int CSelListModelImpl< Item >::m_iFocusedItem
protected

Definition at line 142 of file sel_list_model_impl.hpp.

◆ m_lsViews

template<class Item >
TViewList CSelListModelImpl< Item >::m_lsViews
protected

Definition at line 145 of file sel_list_model_impl.hpp.

◆ m_SelectedCount

template<class Item >
int CSelListModelImpl< Item >::m_SelectedCount
protected

Definition at line 141 of file sel_list_model_impl.hpp.


The documentation for this class was generated from the following file:
Modified on Mon Jul 22 05:07:32 2024 by modify_doxy.py rev. 669887