]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dataview.h
Revert inclusion of wx/dateevt.h for now, as it breaks linkage
[wxWidgets.git] / include / wx / dataview.h
CommitLineData
bcd846ea
RR
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/dataview.h
3// Purpose: wxDataViewCtrl base classes
4// Author: Robert Roebling
5// Modified by:
6// Created: 08.01.06
7// RCS-ID: $Id$
8// Copyright: (c) Robert Roebling
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_DATAVIEW_H_BASE_
13#define _WX_DATAVIEW_H_BASE_
14
15#include "wx/defs.h"
16
17#if wxUSE_DATAVIEWCTRL
18
239eaa41
RR
19#include "wx/control.h"
20#include "wx/textctrl.h"
21#include "wx/bitmap.h"
64ffb888 22#include "wx/variant.h"
239eaa41 23
bcd846ea
RR
24// ----------------------------------------------------------------------------
25// wxDataViewCtrl flags
26// ----------------------------------------------------------------------------
27
239eaa41
RR
28// ----------------------------------------------------------------------------
29// wxDataViewCtrl globals
30// ----------------------------------------------------------------------------
bcd846ea 31
63ec432b 32extern WXDLLEXPORT_DATA(const wxChar) wxDataViewCtrlNameStr[];
bcd846ea 33
239eaa41
RR
34// ---------------------------------------------------------
35// wxDataViewModel
36// ---------------------------------------------------------
37
38class wxDataViewModel: public wxObject
39{
40public:
41 wxDataViewModel() { }
42 virtual ~wxDataViewModel() { }
43
44protected:
260b9be7 45 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewModel)
239eaa41
RR
46};
47
48// ---------------------------------------------------------
49// wxDataViewListModelNotifier
50// ---------------------------------------------------------
51
52class wxDataViewListModelNotifier
53{
54public:
55 wxDataViewListModelNotifier() { }
56 virtual ~wxDataViewListModelNotifier() { }
57
58 virtual bool RowAppended() = 0;
59 virtual bool RowPrepended() = 0;
60 virtual bool RowInserted( size_t before ) = 0;
61 virtual bool RowDeleted( size_t row ) = 0;
62 virtual bool RowChanged( size_t row ) = 0;
63 virtual bool ValueChanged( size_t row, size_t col ) = 0;
64 virtual bool Cleared() = 0;
64ffb888 65};
239eaa41
RR
66
67// ---------------------------------------------------------
68// wxDataViewListModel
69// ---------------------------------------------------------
70
71class wxDataViewListModel: public wxDataViewModel
72{
73public:
74 wxDataViewListModel();
75 virtual ~wxDataViewListModel();
76
77 virtual size_t GetNumberOfRows() = 0;
78 virtual size_t GetNumberOfCols() = 0;
79 // as reported by wxVariant
80 virtual wxString GetColType( size_t col ) = 0;
81 virtual wxVariant GetValue( size_t col, size_t row ) = 0;
82
83 // delegated notifiers
84 bool RowAppended();
85 bool RowPrepended();
86 bool RowInserted( size_t before );
87 bool RowDeleted( size_t row );
88 bool RowChanged( size_t row );
89 bool ValueChanged( size_t row, size_t col );
90 bool Cleared();
91
92 void SetNotifier( wxDataViewListModelNotifier *notifier );
93 wxDataViewListModelNotifier* GetNotifier();
94
95private:
96 wxDataViewListModelNotifier *m_notifier;
97
98protected:
260b9be7 99 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewListModel)
239eaa41
RR
100};
101
102// ---------------------------------------------------------
103// wxDataViewCtrlBase
104// ---------------------------------------------------------
105
106class wxDataViewCtrlBase: public wxControl
107{
108public:
109 wxDataViewCtrlBase();
110 ~wxDataViewCtrlBase();
111
112 virtual bool AppendStringColumn( const wxString &label ) = 0;
113
6e2e590f
RR
114 virtual bool AssociateModel( wxDataViewListModel *model );
115 wxDataViewListModel* GetModel();
239eaa41
RR
116
117private:
6e2e590f 118 wxDataViewListModel *m_model;
bcd846ea 119
239eaa41 120protected:
260b9be7 121 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCtrlBase)
239eaa41 122};
bcd846ea
RR
123
124
125
126#if defined(__WXGTK20__)
127 #include "wx/gtk/dataview.h"
128#elif defined(__WXMAC__)
129 #include "wx/mac/dataview.h"
130#else
131 #include "wx/generic/dataview.h"
132#endif
133
134#endif // wxUSE_DATAVIEWCTRL
135
136#endif
137 // _WX_DATAVIEW_H_BASE_