+// ---------------------------------------------------------
+// wxDataViewSortedListModel
+// ---------------------------------------------------------
+
+typedef int (wxCALLBACK *wxDataViewListModelCompare)
+ (size_t row1, size_t row2, size_t col, wxDataViewListModel* model );
+
+WX_DEFINE_SORTED_EXPORTED_ARRAY_SIZE_T(size_t, wxDataViewSortedIndexArray );
+
+class wxDataViewSortedListModel: public wxDataViewListModel
+{
+public:
+ wxDataViewSortedListModel( wxDataViewListModel *child );
+ virtual ~wxDataViewSortedListModel();
+
+ virtual size_t GetNumberOfRows();
+ virtual size_t GetNumberOfCols();
+ // return type as reported by wxVariant
+ virtual wxString GetColType( size_t col );
+ // get value into a wxVariant
+ virtual void GetValue( wxVariant &variant, size_t col, size_t row );
+ // set value, call ValueChanged() afterwards!
+ virtual bool SetValue( wxVariant &variant, size_t col, size_t row );
+
+ // delegated notifiers
+ virtual bool RowAppended();
+ virtual bool RowPrepended();
+ virtual bool RowInserted( size_t before );
+ virtual bool RowDeleted( size_t row );
+ virtual bool RowChanged( size_t row );
+ virtual bool ValueChanged( size_t col, size_t row );
+ virtual bool RowsReordered( size_t *new_order );
+ virtual bool Cleared();
+
+ bool ChildValueChanged( size_t col, size_t row );
+
+ virtual void Resort();
+
+private:
+ wxDataViewListModel *m_child;
+ wxDataViewSortedIndexArray m_array;
+ wxDataViewListModelNotifier *m_notifierOnChild;
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewSortedListModel)
+};
+
+// ---------------------------------------------------------
+// wxDataViewCellBase
+// ---------------------------------------------------------
+
+enum wxDataViewCellMode
+{
+ wxDATAVIEW_CELL_INERT,
+ wxDATAVIEW_CELL_ACTIVATABLE,
+ wxDATAVIEW_CELL_EDITABLE
+};
+
+enum wxDataViewCellRenderState
+{
+ wxDATAVIEW_CELL_SELECTED = 1,
+ wxDATAVIEW_CELL_PRELIT = 2,
+ wxDATAVIEW_CELL_INSENSITIVE = 4,
+ wxDATAVIEW_CELL_FOCUSED = 8
+};
+
+class wxDataViewCellBase: public wxObject
+{
+public:
+ wxDataViewCellBase( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+
+ virtual bool SetValue( const wxVariant &value ) { return true; }
+ virtual bool GetValue( wxVariant &value ) { return true; }
+ virtual bool Validate( wxVariant &value ) { return true; }
+
+ wxString GetVariantType() { return m_variantType; }
+ wxDataViewCellMode GetMode() { return m_mode; }
+
+ void SetOwner( wxDataViewColumn *owner ) { m_owner = owner; }
+ wxDataViewColumn* GetOwner() { return m_owner; }
+
+protected:
+ wxDataViewCellMode m_mode;
+ wxString m_variantType;
+ wxDataViewColumn *m_owner;
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCellBase)
+};
+
+// ---------------------------------------------------------
+// wxDataViewColumnBase
+// ---------------------------------------------------------
+
+enum wxDataViewColumnFlags
+{
+ wxDATAVIEW_COL_RESIZABLE = 1,
+ wxDATAVIEW_COL_SORTABLE = 2,
+ wxDATAVIEW_COL_HIDDEN = 4
+};
+
+class wxDataViewColumnBase: public wxObject
+{
+public:
+ wxDataViewColumnBase( const wxString &title, wxDataViewCell *cell, size_t model_column, int flags = 0 );
+ ~wxDataViewColumnBase();
+
+ virtual void SetTitle( const wxString &title );
+ virtual wxString GetTitle();
+
+ wxDataViewCell* GetCell() { return m_cell; }
+
+ size_t GetModelColumn() { return m_model_column; }
+
+ void SetOwner( wxDataViewCtrl *owner ) { m_owner = owner; }
+ wxDataViewCtrl *GetOwner() { return m_owner; }
+
+private:
+ wxDataViewCtrl *m_ctrl;
+ wxDataViewCell *m_cell;
+ int m_model_column;
+ int m_flags;
+ wxString m_title;
+ wxDataViewCtrl *m_owner;
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumnBase)
+};
+