PageRenderTime 45ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/Externals/wxWidgets3/include/wx/osx/core/dataview.h

https://gitlab.com/Hexexpeck/dolphin-emulator
C Header | 113 lines | 55 code | 15 blank | 43 comment | 0 complexity | 532e7b3adb1715f76ba6da1de9f818e9 MD5 | raw file
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/core/dataview.h
  3. // Purpose: wxDataViewCtrl native implementation header for OSX
  4. // Author:
  5. // Copyright: (c) 2009
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef _WX_DATAVIEWCTRL_CORE_H_
  9. #define _WX_DATAVIEWCTRL_CORE_H_
  10. #include "wx/dataview.h"
  11. typedef wxWidgetImpl wxWidgetImplType;
  12. // ---------------------------------------------------------
  13. // Helper functions for dataview implementation on OSX
  14. // ---------------------------------------------------------
  15. wxWidgetImplType* CreateDataView(wxWindowMac* wxpeer, wxWindowMac* parent, wxWindowID id,
  16. wxPoint const& pos, wxSize const& size,
  17. long style, long extraStyle);
  18. wxString ConcatenateDataViewItemValues(wxDataViewCtrl const* dataViewCtrlPtr, wxDataViewItem const& dataViewItem); // concatenates all data of the visible columns of the passed control
  19. // and item TAB separated into a string and returns it
  20. // ---------------------------------------------------------
  21. // wxDataViewWidgetImpl
  22. // Common interface of the native dataview implementation
  23. // for the carbon and cocoa environment.
  24. // ATTENTION
  25. // All methods assume that the passed column pointers are
  26. // valid (unless a NULL pointer is explicitly allowed
  27. // to be passed)!
  28. // ATTENTION
  29. // ---------------------------------------------------------
  30. class WXDLLIMPEXP_CORE wxDataViewWidgetImpl
  31. {
  32. public:
  33. //
  34. // constructors / destructor
  35. //
  36. virtual ~wxDataViewWidgetImpl(void)
  37. {
  38. }
  39. //
  40. // column related methods
  41. //
  42. virtual bool ClearColumns (void) = 0; // deletes all columns in the native control
  43. virtual bool DeleteColumn (wxDataViewColumn* columnPtr) = 0; // deletes the column in the native control
  44. virtual void DoSetExpanderColumn(wxDataViewColumn const* columnPtr) = 0; // sets the disclosure column in the native control
  45. virtual wxDataViewColumn* GetColumn (unsigned int pos) const = 0; // returns the column belonging to 'pos' in the native control
  46. virtual int GetColumnPosition (wxDataViewColumn const* columnPtr) const = 0; // returns the position of the passed column in the native control
  47. virtual bool InsertColumn (unsigned int pos, wxDataViewColumn* columnPtr) = 0; // inserts a column at pos in the native control;
  48. // the method can assume that the column's owner is already set
  49. virtual void FitColumnWidthToContent(unsigned int pos) = 0; // resizes column to fit its content
  50. //
  51. // item related methods
  52. //
  53. virtual bool Add (wxDataViewItem const& parent, wxDataViewItem const& item) = 0; // adds an item to the native control
  54. virtual bool Add (wxDataViewItem const& parent, wxDataViewItemArray const& itesm) = 0; // adds a items to the native control
  55. virtual void Collapse (wxDataViewItem const& item) = 0; // collapses the passed item in the native control
  56. virtual void EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) = 0; // ensures that the passed item's value in the passed column is visible (column pointer can be NULL)
  57. virtual void Expand (wxDataViewItem const& item) = 0; // expands the passed item in the native control
  58. virtual unsigned int GetCount (void) const = 0; // returns the number of items in the native control
  59. virtual wxRect GetRectangle (wxDataViewItem const& item, wxDataViewColumn const* columnPtr) = 0; // returns the rectangle that is used by the passed item and column in the native control
  60. virtual bool IsExpanded (wxDataViewItem const& item) const = 0; // checks if the passed item is expanded in the native control
  61. virtual bool Reload (void) = 0; // clears the native control and reloads all data
  62. virtual bool Remove (wxDataViewItem const& parent, wxDataViewItem const& item) = 0; // removes an item from the native control
  63. virtual bool Remove (wxDataViewItem const& parent, wxDataViewItemArray const& item) = 0; // removes items from the native control
  64. virtual bool Update (wxDataViewColumn const* columnPtr) = 0; // updates the items in the passed column of the native control
  65. virtual bool Update (wxDataViewItem const& parent, wxDataViewItem const& item) = 0; // updates the passed item in the native control
  66. virtual bool Update (wxDataViewItem const& parent, wxDataViewItemArray const& items) = 0; // updates the passed items in the native control
  67. //
  68. // model related methods
  69. //
  70. virtual bool AssociateModel(wxDataViewModel* model) = 0; // informs the native control that a model is present
  71. //
  72. // selection related methods
  73. //
  74. virtual wxDataViewItem GetCurrentItem() const = 0;
  75. virtual void SetCurrentItem(const wxDataViewItem& item) = 0;
  76. virtual wxDataViewColumn *GetCurrentColumn() const = 0;
  77. virtual int GetSelectedItemsCount() const = 0;
  78. virtual int GetSelections(wxDataViewItemArray& sel) const = 0; // returns all selected items in the native control
  79. virtual bool IsSelected (wxDataViewItem const& item) const = 0; // checks if the passed item is selected in the native control
  80. virtual void Select (wxDataViewItem const& item) = 0; // selects the passed item in the native control
  81. virtual void SelectAll (void) = 0; // selects all items in the native control
  82. virtual void Unselect (wxDataViewItem const& item) = 0; // unselects the passed item in the native control
  83. virtual void UnselectAll (void) = 0; // unselects all items in the native control
  84. //
  85. // sorting related methods
  86. //
  87. virtual wxDataViewColumn* GetSortingColumn (void) const = 0; // returns the column that is primarily responsible for sorting in the native control
  88. virtual void Resort (void) = 0; // asks the native control to start a resorting process
  89. //
  90. // other methods
  91. //
  92. virtual void DoSetIndent (int indent) = 0; // sets the indention in the native control
  93. virtual void HitTest (wxPoint const& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const = 0; // return the item and column pointer that contains with the passed point
  94. virtual void SetRowHeight(wxDataViewItem const& item, unsigned int height) = 0; // sets the height of the row containg the passed item in the native control
  95. virtual void OnSize (void) = 0; // updates the layout of the native control after a size event
  96. virtual void StartEditor( const wxDataViewItem & item, unsigned int column ) = 0; // starts editing the passed in item and column
  97. };
  98. #endif // _WX_DATAVIEWCTRL_CORE_H_