Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / dataview / XS / DataViewIndexListModel.xsp
1 #############################################################################
2 ## Name:        ext/dataview/XS/DataViewIndexListModel.xsp
3 ## Purpose:     XS++ for Wx::DataViewIndexListModel
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     05/11/2007
7 ## RCS-ID:      $Id: DataViewIndexListModel.xsp 2523 2009-02-04 23:50:57Z mbarbon $
8 ## Copyright:   (c) 2007-2009 Mattia Barbon
9 ## Licence:     This program is free software; you can redistribute it and/or
10 ##              modify it under the same terms as Perl itself
11 #############################################################################
12
13 #if wxUSE_DATAVIEWCTRL
14
15 %module{Wx};
16
17 #include <wx/dataview.h>
18 #include "cpp/dataviewindexmodel.h"
19
20 %file{cpp/dataviewindexmodel.h};
21 %{
22 #include "cpp/v_cback.h"
23
24 class wxPlDataViewIndexListModel : public wxDataViewIndexListModel
25 {
26     WXPLI_DECLARE_V_CBACK();
27 public:
28     wxPlDataViewIndexListModel( const char* package, unsigned int initial_size )
29         : wxDataViewIndexListModel( initial_size ),
30           m_callback( "Wx::PlDataViewIndexListModel" )
31     {
32         m_callback.SetSelf( wxPli_make_object( this, package ), true );
33     }
34
35 //     DEC_V_CBACK_UINT__VOID( GetRowCount );
36     DEC_V_CBACK_UINT__VOID_const( GetColumnCount );
37     DEC_V_CBACK_WXSTRING__UINT_const( GetColumnType );
38     DEC_V_CBACK_VOID__mWXVARIANT_UINT_UINT_const( GetValueByRow );
39     DEC_V_CBACK_BOOL__WXVARIANT_UINT_UINT( SetValueByRow );
40 };
41
42 DEF_V_CBACK_UINT__VOID_const_pure( wxPlDataViewIndexListModel,
43                                    wxDataViewIndexListModel, GetColumnCount );
44 DEF_V_CBACK_WXSTRING__UINT_const_pure( wxPlDataViewIndexListModel,
45                                        wxDataViewIndexListModel, GetColumnType );
46 // DEF_V_CBACK_UINT__VOID_pure( wxPlDataViewIndexListModel,
47 //                              wxDataViewIndexListModel, GetRowCount );
48 DEF_V_CBACK_VOID__mWXVARIANT_UINT_UINT_const_pure( wxPlDataViewIndexListModel,
49                                                    wxDataViewIndexListModel,
50                                                    GetValueByRow );
51 DEF_V_CBACK_BOOL__WXVARIANT_UINT_UINT_pure( wxPlDataViewIndexListModel,
52                                             wxDataViewIndexListModel,
53                                             SetValueByRow );
54 %}
55 %file{-};
56
57 %name{Wx::DataViewIndexListModel} class wxDataViewIndexListModel
58 {
59 ##    unsigned int GetRowCount();
60
61     void GetValueByRow( wxVariant &variant,
62                         unsigned int row, unsigned int col ) const;
63
64     bool SetValueByRow( const wxVariant &variant,
65                         unsigned int row, unsigned int col );
66
67     void RowPrepended();
68     void RowInserted( unsigned int before );
69     void RowAppended();
70     void RowDeleted( unsigned int row );
71     void RowChanged( unsigned int row );
72     void RowValueChanged( unsigned int row, unsigned int col );
73
74     unsigned int GetRow( const wxDataViewItem &item ) const;
75     wxDataViewItem& GetItem( unsigned int row ) const;
76     void Reset( unsigned int new_size );
77 };
78
79 %name{Wx::PlDataViewIndexListModel} class wxPlDataViewIndexListModel
80 {
81     wxPlDataViewIndexListModel( unsigned int initial_size = 0 )
82         %code{% RETVAL = new wxPlDataViewIndexListModel( CLASS, initial_size ); %};
83 };
84
85 #endif