X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bb9a404fbd035652906795c1cd83c743ea9041c..c9a199c6a6372374c49071197870324b6fbf5094:/include/wx/xrc/xmlres.h diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index c324aec930..97c1732d89 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -31,6 +31,10 @@ #include "wx/xml/xml.h" +class WXDLLIMPEXP_FWD_BASE wxFileName; + +class WXDLLIMPEXP_FWD_CORE wxIconBundle; +class WXDLLIMPEXP_FWD_CORE wxImageList; class WXDLLIMPEXP_FWD_CORE wxMenu; class WXDLLIMPEXP_FWD_CORE wxMenuBar; class WXDLLIMPEXP_FWD_CORE wxDialog; @@ -61,7 +65,7 @@ class wxXmlResourceDataRecords; #define WX_XMLRES_CURRENT_VERSION_MINOR 5 #define WX_XMLRES_CURRENT_VERSION_RELEASE 3 #define WX_XMLRES_CURRENT_VERSION_REVISION 0 -#define WX_XMLRES_CURRENT_VERSION_STRING _T("2.5.3.0") +#define WX_XMLRES_CURRENT_VERSION_STRING wxT("2.5.3.0") #define WX_XMLRES_CURRENT_VERSION \ (WX_XMLRES_CURRENT_VERSION_MAJOR * 256*256*256 + \ @@ -261,6 +265,13 @@ public: { return GetResourceNodeAndLocation(name, wxString(), true); } protected: + // reports input error at position 'context' + void ReportError(wxXmlNode *context, const wxString& message); + + // override this in derived class to customize errors reporting + virtual void DoReportError(const wxString& xrcFile, wxXmlNode *position, + const wxString& message); + // Scans the resources list for unloaded files and loads them. Also reloads // files that have been modified since last loading. bool UpdateResources(); @@ -432,7 +443,7 @@ protected: // wxXML_ENTITY_NODE name="tag", content="" // |-- wxXML_TEXT_NODE or // wxXML_CDATA_SECTION_NODE name="" content="content" - wxString GetNodeContent(wxXmlNode *node); + wxString GetNodeContent(const wxXmlNode *node); // Check to see if a parameter exists. bool HasParam(const wxString& param); @@ -443,6 +454,9 @@ protected: // Finds the parameter value or returns the empty string. wxString GetParamValue(const wxString& param); + // Returns the parameter value from given node. + wxString GetParamValue(const wxXmlNode* node); + // Add a style flag (e.g. wxMB_DOCKABLE) to the list of flags // understood by this handler. void AddStyle(const wxString& name, int value); @@ -494,11 +508,28 @@ protected: const wxArtClient& defaultArtClient = wxART_OTHER, wxSize size = wxDefaultSize); + // Gets a bitmap from an XmlNode. + wxBitmap GetBitmap(const wxXmlNode* node, + const wxArtClient& defaultArtClient = wxART_OTHER, + wxSize size = wxDefaultSize); + // Gets an icon. wxIcon GetIcon(const wxString& param = wxT("icon"), const wxArtClient& defaultArtClient = wxART_OTHER, wxSize size = wxDefaultSize); + // Gets an icon from an XmlNode. + wxIcon GetIcon(const wxXmlNode* node, + const wxArtClient& defaultArtClient = wxART_OTHER, + wxSize size = wxDefaultSize); + + // Gets an icon bundle. + wxIconBundle GetIconBundle(const wxString& param, + const wxArtClient& defaultArtClient = wxART_OTHER); + + // Gets an image list. + wxImageList *GetImageList(const wxString& param = wxT("imagelist")); + #if wxUSE_ANIMATIONCTRL // Gets an animation. wxAnimation GetAnimation(const wxString& param = wxT("animation")); @@ -529,6 +560,13 @@ protected: #if wxUSE_FILESYSTEM wxFileSystem& GetCurFileSystem() { return m_resource->GetCurFileSystem(); } #endif + + // reports input error at position 'context' + void ReportError(wxXmlNode *context, const wxString& message); + // reports input error at m_node + void ReportError(const wxString& message); + // reports input error when parsing parameter with given name + void ReportParamError(const wxString& param, const wxString& message); };