1 #############################################################################
2 ## Name: ext/xrc/XS/XmlNode.xsp
3 ## Purpose: XS for Wx::XmlNode
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: XmlNode.xsp 2281 2007-11-11 13:46:12Z mbarbon $
8 ## Copyright: (c) 2003, 2007 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 #############################################################################
15 %typemap{wxXmlProperty*}{simple};
16 %typemap{wxXmlAttribute*}{simple};
17 %typemap{wxXmlNode*}{simple};
18 %typemap{wxXmlNodeType}{simple};
20 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
22 %name{Wx::XmlAttribute} class wxXmlAttribute
24 wxXmlAttribute(const wxString& name = wxEmptyString,
25 const wxString& value = wxEmptyString,
26 wxXmlAttribute* next = NULL);
28 wxString GetName() const;
29 wxString GetValue() const;
30 wxXmlAttribute* GetNext() const;
32 void SetName(const wxString& name);
33 void SetValue(const wxString& value);
34 void SetNext(wxXmlAttribute* next);
40 wxXmlAttribute::Destroy()
48 %name{Wx::XmlProperty} class wxXmlProperty
50 wxXmlProperty(const wxString& name = wxEmptyString,
51 const wxString& value = wxEmptyString,
52 wxXmlProperty* next = NULL);
54 wxString GetName() const;
55 wxString GetValue() const;
56 wxXmlProperty* GetNext() const;
58 void SetName(const wxString& name);
59 void SetValue(const wxString& value);
60 void SetNext(wxXmlProperty* next);
66 wxXmlProperty::Destroy()
74 %name{Wx::XmlNode} class wxXmlNode
76 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
77 wxXmlNode(wxXmlNode* parent = NULL, wxXmlNodeType type = wxXmlNodeType(0),
78 const wxString& name = wxEmptyString,
79 const wxString& content = wxEmptyString,
80 wxXmlAttribute* props = NULL, wxXmlNode* next = NULL);
82 wxXmlNode(wxXmlNode* parent = NULL, wxXmlNodeType type = wxXmlNodeType(0),
83 const wxString& name = wxEmptyString,
84 const wxString& content = wxEmptyString,
85 wxXmlProperty* props = NULL, wxXmlNode* next = NULL);
88 void AddChild(wxXmlNode* child);
89 void InsertChild(wxXmlNode *child, wxXmlNode *before_node);
90 bool RemoveChild(wxXmlNode *child);
91 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
92 void AddAttribute(const wxString& name, const wxString& value);
93 bool DeleteAttribute(const wxString& name);
95 void AddProperty(const wxString& name, const wxString& value);
96 bool DeleteProperty(const wxString& name);
99 wxXmlNodeType GetType() const;
100 wxString GetName() const;
101 wxString GetContent() const;
103 wxXmlNode *GetParent() const;
104 wxXmlNode *GetNext() const;
105 wxXmlNode *GetChildren() const;
107 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
108 wxXmlAttribute *GetAttributes() const;
110 wxXmlProperty *GetProperties() const;
112 ## bool GetPropVal(const wxString& propName, wxString *value) const;
113 ## wxString GetPropVal(const wxString& propName,
114 ## const wxString& defaultVal) const;
115 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
116 bool HasAttribute(const wxString& propName) const;
118 bool HasProp(const wxString& propName) const;
121 void SetType(wxXmlNodeType type);
122 void SetName(const wxString& name);
123 void SetContent(const wxString& con);
125 void SetParent(wxXmlNode *parent);
126 void SetNext(wxXmlNode *next);
127 void SetChildren(wxXmlNode *child);
129 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
130 void SetAttributes(wxXmlAttribute *prop);
132 void SetProperties(wxXmlProperty *prop);
134 ## void AddProperty(wxXmlProperty *prop);
144 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
147 wxXmlNode::GetAttribute(name, value = &PL_sv_undef)
152 bool ok = THIS->GetAttribute(name, &tmp);
154 RETVAL = wxPli_wxString_2_sv( aTHX_ tmp, NEWSV(0, 0) );
156 RETVAL = SvREFCNT_inc( value );
162 wxXmlNode::GetPropVal(name, value = &PL_sv_undef)
167 bool ok = THIS->GetPropVal(name, &tmp);
169 RETVAL = wxPli_wxString_2_sv( aTHX_ tmp, NEWSV(0, 0) );
171 RETVAL = SvREFCNT_inc( value );