1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDataViewCtrl base classes
4 // Author: Robert Roebling
8 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DATAVIEW_H_BASE_
13 #define _WX_DATAVIEW_H_BASE_
17 #if wxUSE_DATAVIEWCTRL
19 #include "wx/control.h"
20 #include "wx/textctrl.h"
21 #include "wx/bitmap.h"
23 // ----------------------------------------------------------------------------
24 // wxDataViewCtrl flags
25 // ----------------------------------------------------------------------------
27 // ----------------------------------------------------------------------------
28 // wxDataViewCtrl globals
29 // ----------------------------------------------------------------------------
31 extern WXDLLEXPORT_DATA(const wxChar
) wxDataViewCtrlNameStr
[];
33 // ---------------------------------------------------------
35 // ---------------------------------------------------------
37 class wxDataViewModel
: public wxObject
41 virtual ~wxDataViewModel() { }
44 DECLARE_NO_COPY_CLASS(wxDataViewModel
)
47 // ---------------------------------------------------------
48 // wxDataViewListModelNotifier
49 // ---------------------------------------------------------
51 class wxDataViewListModelNotifier
54 wxDataViewListModelNotifier() { }
55 virtual ~wxDataViewListModelNotifier() { }
57 virtual bool RowAppended() = 0;
58 virtual bool RowPrepended() = 0;
59 virtual bool RowInserted( size_t before
) = 0;
60 virtual bool RowDeleted( size_t row
) = 0;
61 virtual bool RowChanged( size_t row
) = 0;
62 virtual bool ValueChanged( size_t row
, size_t col
) = 0;
63 virtual bool Cleared() = 0;
66 // ---------------------------------------------------------
67 // wxDataViewListModel
68 // ---------------------------------------------------------
70 class wxDataViewListModel
: public wxDataViewModel
73 wxDataViewListModel();
74 virtual ~wxDataViewListModel();
76 virtual size_t GetNumberOfRows() = 0;
77 virtual size_t GetNumberOfCols() = 0;
78 // as reported by wxVariant
79 virtual wxString
GetColType( size_t col
) = 0;
80 virtual wxVariant
GetValue( size_t col
, size_t row
) = 0;
82 // delegated notifiers
85 bool RowInserted( size_t before
);
86 bool RowDeleted( size_t row
);
87 bool RowChanged( size_t row
);
88 bool ValueChanged( size_t row
, size_t col
);
91 void SetNotifier( wxDataViewListModelNotifier
*notifier
);
92 wxDataViewListModelNotifier
* GetNotifier();
95 wxDataViewListModelNotifier
*m_notifier
;
98 DECLARE_NO_COPY_CLASS(wxDataViewListModel
)
101 // ---------------------------------------------------------
102 // wxDataViewCtrlBase
103 // ---------------------------------------------------------
105 class wxDataViewCtrlBase
: public wxControl
108 wxDataViewCtrlBase();
109 ~wxDataViewCtrlBase();
111 virtual bool AppendStringColumn( const wxString
&label
) = 0;
113 virtual bool AssociateModel( wxDataViewModel
*model
);
114 wxDataViewModel
* GetModel();
117 wxDataViewModel
*m_model
;
120 DECLARE_NO_COPY_CLASS(wxDataViewCtrlBase
)
125 #if defined(__WXGTK20__)
126 #include "wx/gtk/dataview.h"
127 #elif defined(__WXMAC__)
128 #include "wx/mac/dataview.h"
130 #include "wx/generic/dataview.h"
133 #endif // wxUSE_DATAVIEWCTRL
136 // _WX_DATAVIEW_H_BASE_