xmlres.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: xrc/xmlres.h
  3. // Purpose: interface of wxXmlResource
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. Flags which can be used with wxXmlResource::wxXmlResource.
  9. */
  10. enum wxXmlResourceFlags
  11. {
  12. /** Translatable strings will be translated via _(). */
  13. wxXRC_USE_LOCALE = 1,
  14. /** Subclass property of object nodes will be ignored (useful for previews in XRC editors). */
  15. wxXRC_NO_SUBCLASSING = 2,
  16. /** Prevent the XRC files from being reloaded from disk in case they have been modified there
  17. since being last loaded (may slightly speed up loading them). */
  18. wxXRC_NO_RELOADING = 4
  19. };
  20. /**
  21. @class wxXmlResource
  22. This is the main class for interacting with the XML-based resource system.
  23. The class holds XML resources from one or more .xml files, binary files or zip
  24. archive files.
  25. Note that this is a singleton class and you'll never allocate/deallocate it.
  26. Just use the static wxXmlResource::Get() getter.
  27. @see @ref overview_xrc, @ref overview_xrcformat
  28. @library{wxxrc}
  29. @category{xrc}
  30. */
  31. class wxXmlResource : public wxObject
  32. {
  33. public:
  34. /**
  35. Constructor.
  36. @param filemask
  37. The XRC file, archive file, or wildcard specification that will be
  38. used to load all resource files inside a zip archive.
  39. @param flags
  40. One or more value of the ::wxXmlResourceFlags enumeration.
  41. @param domain
  42. The name of the gettext catalog to search for translatable strings.
  43. By default all loaded catalogs will be searched.
  44. This provides a way to allow the strings to only come from a specific catalog.
  45. */
  46. wxXmlResource(const wxString& filemask,
  47. int flags = wxXRC_USE_LOCALE,
  48. const wxString& domain = wxEmptyString);
  49. /**
  50. Constructor.
  51. @param flags
  52. One or more value of the ::wxXmlResourceFlags enumeration.
  53. @param domain
  54. The name of the gettext catalog to search for translatable strings.
  55. By default all loaded catalogs will be searched.
  56. This provides a way to allow the strings to only come from a specific catalog.
  57. */
  58. wxXmlResource(int flags = wxXRC_USE_LOCALE,
  59. const wxString& domain = wxEmptyString);
  60. /**
  61. Destructor.
  62. */
  63. virtual ~wxXmlResource();
  64. /**
  65. Initializes only a specific handler (or custom handler).
  66. Convention says that the handler name is equal to the control's name plus
  67. 'XmlHandler', for example wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler.
  68. The XML resource compiler (wxxrc) can create include file that contains
  69. initialization code for all controls used within the resource.
  70. Note that this handler must be allocated on the heap, since it will be
  71. deleted by ClearHandlers() later.
  72. */
  73. void AddHandler(wxXmlResourceHandler* handler);
  74. /**
  75. Add a new handler at the begining of the handler list.
  76. */
  77. void InsertHandler(wxXmlResourceHandler *handler);
  78. /**
  79. Attaches an unknown control to the given panel/window/dialog.
  80. Unknown controls are used in conjunction with \<object class="unknown"\>.
  81. */
  82. bool AttachUnknownControl(const wxString& name,
  83. wxWindow* control,
  84. wxWindow* parent = NULL);
  85. /**
  86. Removes all handlers and deletes them (this means that any handlers
  87. added using AddHandler() must be allocated on the heap).
  88. */
  89. void ClearHandlers();
  90. /**
  91. Registers subclasses factory for use in XRC. This is useful only for
  92. language bindings developers who need a way to implement subclassing in
  93. wxWidgets ports that don't support wxRTTI (e.g. wxPython).
  94. */
  95. static void AddSubclassFactory(wxXmlSubclassFactory *factory);
  96. /**
  97. Compares the XRC version to the argument.
  98. Returns -1 if the XRC version is less than the argument,
  99. +1 if greater, and 0 if they are equal.
  100. */
  101. int CompareVersion(int major, int minor, int release, int revision) const;
  102. /**
  103. Returns a string ID corresponding to the given numeric ID.
  104. The string returned is such that calling GetXRCID() with it as
  105. parameter yields @a numId. If there is no string identifier
  106. corresponding to the given numeric one, an empty string is returned.
  107. Notice that, unlike GetXRCID(), this function is slow as it checks all
  108. of the identifiers used in XRC.
  109. @since 2.9.0
  110. */
  111. static wxString FindXRCIDById(int numId);
  112. /**
  113. Gets the global resources object or creates one if none exists.
  114. */
  115. static wxXmlResource* Get();
  116. /**
  117. Returns the domain (message catalog) that will be used to load
  118. translatable strings in the XRC.
  119. */
  120. const wxString& GetDomain() const;
  121. /**
  122. Returns flags, which may be a bitlist of ::wxXmlResourceFlags
  123. enumeration values.
  124. */
  125. int GetFlags() const;
  126. /**
  127. Returns the wxXmlNode containing the definition of the object with the
  128. given name or @NULL.
  129. This function recursively searches all the loaded XRC files for an
  130. object with the specified @a name. If the object is found, the
  131. wxXmlNode corresponding to it is returned, so this function can be used
  132. to access additional information defined in the XRC file and not used
  133. by wxXmlResource itself, e.g. contents of application-specific XML
  134. tags.
  135. @param name
  136. The name of the resource which must be unique for this function to
  137. work correctly, if there is more than one resource with the given
  138. name the choice of the one returned by this function is undefined.
  139. @return
  140. The node corresponding to the resource with the given name or @NULL.
  141. */
  142. const wxXmlNode *GetResourceNode(const wxString& name) const;
  143. /**
  144. Returns version information (a.b.c.d = d + 256*c + 2562*b + 2563*a).
  145. */
  146. long GetVersion() const;
  147. /**
  148. Returns a numeric ID that is equivalent to the string ID used in an XML resource.
  149. If an unknown @a str_id is requested (i.e. other than wxID_XXX or integer),
  150. a new record is created which associates the given string with a number.
  151. If @a value_if_not_found is @c wxID_NONE, the number is obtained via
  152. wxNewId(). Otherwise @a value_if_not_found is used.
  153. Macro @c XRCID(name) is provided for convenient use in event tables.
  154. @note IDs returned by XRCID() cannot be used with the <tt>EVT_*_RANGE</tt>
  155. macros, because the order in which they are assigned to symbolic @a name
  156. values is not guaranteed.
  157. */
  158. static int GetXRCID(const wxString& str_id, int value_if_not_found = wxID_NONE);
  159. /**
  160. Initializes handlers for all supported controls/windows.
  161. This will make the executable quite big because it forces linking against
  162. most of the wxWidgets library.
  163. */
  164. void InitAllHandlers();
  165. /**
  166. Loads resources from XML files that match given filemask.
  167. Example:
  168. @code
  169. if (!wxXmlResource::Get()->Load("rc/*.xrc"))
  170. wxLogError("Couldn't load resources!");
  171. @endcode
  172. @note
  173. If wxUSE_FILESYS is enabled, this method understands wxFileSystem URLs
  174. (see wxFileSystem::FindFirst()).
  175. @note
  176. If you are sure that the argument is name of single XRC file (rather
  177. than an URL or a wildcard), use LoadFile() instead.
  178. @see LoadFile(), LoadAllFiles()
  179. */
  180. bool Load(const wxString& filemask);
  181. /**
  182. Simpler form of Load() for loading a single XRC file.
  183. @since 2.9.0
  184. @see Load(), LoadAllFiles()
  185. */
  186. bool LoadFile(const wxFileName& file);
  187. /**
  188. Loads all .xrc files from directory @a dirname.
  189. Tries to load as many files as possible; if there's an error while
  190. loading one file, it still attempts to load other files.
  191. @since 2.9.0
  192. @see LoadFile(), Load()
  193. */
  194. bool LoadAllFiles(const wxString& dirname);
  195. /**
  196. Loads a bitmap resource from a file.
  197. */
  198. wxBitmap LoadBitmap(const wxString& name);
  199. /**
  200. Loads a dialog. @a parent points to parent window (if any).
  201. */
  202. wxDialog* LoadDialog(wxWindow* parent, const wxString& name);
  203. /**
  204. Loads a dialog. @a parent points to parent window (if any).
  205. This form is used to finish creation of an already existing instance (the main
  206. reason for this is that you may want to use derived class with a new event table).
  207. Example:
  208. @code
  209. MyDialog dlg;
  210. wxXmlResource::Get()->LoadDialog(&dlg, mainFrame, "my_dialog");
  211. dlg.ShowModal();
  212. @endcode
  213. */
  214. bool LoadDialog(wxDialog* dlg, wxWindow* parent, const wxString& name);
  215. /**
  216. Loads a frame from the resource. @a parent points to parent window (if any).
  217. */
  218. wxFrame *LoadFrame(wxWindow* parent, const wxString& name);
  219. /**
  220. Loads the contents of a frame onto an existing wxFrame.
  221. This form is used to finish creation of an already existing instance
  222. (the main reason for this is that you may want to use derived class
  223. with a new event table).
  224. */
  225. bool LoadFrame(wxFrame* frame, wxWindow* parent,
  226. const wxString& name);
  227. /**
  228. Loads an icon resource from a file.
  229. */
  230. wxIcon LoadIcon(const wxString& name);
  231. /**
  232. Loads menu from resource. Returns @NULL on failure.
  233. */
  234. wxMenu* LoadMenu(const wxString& name);
  235. //@{
  236. /**
  237. Loads a menubar from resource. Returns @NULL on failure.
  238. */
  239. wxMenuBar* LoadMenuBar(wxWindow* parent, const wxString& name);
  240. wxMenuBar* LoadMenuBar(const wxString& name);
  241. //@}
  242. //@{
  243. /**
  244. Load an object from the resource specifying both the resource name and the
  245. class name.
  246. The first overload lets you load nonstandard container windows and returns
  247. @NULL on failure. The second one lets you finish the creation of an existing
  248. instance and returns @false on failure.
  249. In either case, only the resources defined at the top level of XRC
  250. files can be loaded by this function, use LoadObjectRecursively() if
  251. you need to load an object defined deeper in the hierarchy.
  252. */
  253. wxObject* LoadObject(wxWindow* parent, const wxString& name,
  254. const wxString& classname);
  255. bool LoadObject(wxObject* instance, wxWindow* parent,
  256. const wxString& name,
  257. const wxString& classname);
  258. //@}
  259. //@{
  260. /**
  261. Load an object from anywhere in the resource tree.
  262. These methods are similar to LoadObject() but may be used to load an
  263. object from anywhere in the resource tree and not only the top level.
  264. Note that you will very rarely need to do this as in normal use the
  265. entire container window (defined at the top level) is loaded and not
  266. its individual children but this method can be useful in some
  267. particular situations.
  268. @since 2.9.1
  269. */
  270. wxObject* LoadObjectRecursively(wxWindow* parent,
  271. const wxString& name,
  272. const wxString& classname);
  273. bool LoadObjectRecursively(wxObject* instance, wxWindow* parent,
  274. const wxString& name,
  275. const wxString& classname);
  276. //@}
  277. /**
  278. Loads a panel. @a parent points to the parent window.
  279. */
  280. wxPanel* LoadPanel(wxWindow* parent, const wxString& name);
  281. /**
  282. Loads a panel. @a parent points to the parent window.
  283. This form is used to finish creation of an already existing instance.
  284. */
  285. bool LoadPanel(wxPanel* panel, wxWindow* parent, const wxString& name);
  286. /**
  287. Loads a toolbar.
  288. */
  289. wxToolBar* LoadToolBar(wxWindow* parent, const wxString& name);
  290. /**
  291. Sets the global resources object and returns a pointer to the previous one
  292. (may be @NULL).
  293. */
  294. static wxXmlResource* Set(wxXmlResource* res);
  295. /**
  296. Sets the domain (message catalog) that will be used to load
  297. translatable strings in the XRC.
  298. */
  299. void SetDomain(const wxString& domain);
  300. /**
  301. Sets flags (bitlist of ::wxXmlResourceFlags enumeration values).
  302. */
  303. void SetFlags(int flags);
  304. /**
  305. This function unloads a resource previously loaded by Load().
  306. Returns @true if the resource was successfully unloaded and @false if it
  307. hasn't been found in the list of loaded resources.
  308. */
  309. bool Unload(const wxString& filename);
  310. protected:
  311. /**
  312. Reports error in XRC resources to the user.
  313. Any errors in XRC input files should be reported using this method
  314. (or its wxXmlResourceHandler::ReportError() equivalent). Unlike
  315. wxLogError(), this method presents the error to the user in a more
  316. usable form. In particular, the output is compiler-like and contains
  317. information about the exact location of the error.
  318. @param context XML node the error occurred in or relates to. This can
  319. be @NULL, but should be the most specific node possible,
  320. as its line number is what is reported to the user.
  321. @param message Text of the error message. This string should always
  322. be in English (i.e. not wrapped in _()). It shouldn't
  323. be a sentence -- it should start with lower-case letter
  324. and shouldn't have a trailing period or exclamation
  325. point.
  326. @since 2.9.0
  327. @see wxXmlResourceHandler::ReportError(), DoReportError()
  328. */
  329. void ReportError(const wxXmlNode *context, const wxString& message);
  330. /**
  331. Implementation of XRC resources errors reporting.
  332. This method is called by ReportError() and shouldn't be called
  333. directly; use ReportError() or wxXmlResourceHandler::ReportError()
  334. to log errors.
  335. Default implementation uses wxLogError().
  336. @param xrcFile File the error occurred in or empty string if it
  337. couldn't be determined.
  338. @param position XML node where the error occurred or @NULL if it
  339. couldn't be determined.
  340. @param message Text of the error message. See ReportError()
  341. documentation for details of the string's format.
  342. @note
  343. You may override this method in a derived class to customize errors
  344. reporting. If you do so, you'll need to either use the derived class
  345. in all your code or call wxXmlResource::Set() to change the global
  346. wxXmlResource instance to your class.
  347. @since 2.9.0
  348. @see ReportError()
  349. */
  350. virtual void DoReportError(const wxString& xrcFile, const wxXmlNode *position,
  351. const wxString& message);
  352. };
  353. /**
  354. @class wxXmlResourceHandler
  355. wxXmlResourceHandler is an abstract base class for resource handlers
  356. capable of creating a control from an XML node.
  357. See @ref overview_xrc for details.
  358. @library{wxxrc}
  359. @category{xrc}
  360. */
  361. class wxXmlResourceHandler : public wxObject
  362. {
  363. public:
  364. /**
  365. Default constructor.
  366. */
  367. wxXmlResourceHandler();
  368. /**
  369. Destructor.
  370. */
  371. virtual ~wxXmlResourceHandler();
  372. /**
  373. Creates an object (menu, dialog, control, ...) from an XML node.
  374. Should check for validity. @a parent is a higher-level object
  375. (usually window, dialog or panel) that is often necessary to
  376. create the resource.
  377. If @b instance is non-@NULL it should not create a new instance via
  378. 'new' but should rather use this one, and call its Create method.
  379. */
  380. wxObject* CreateResource(wxXmlNode* node, wxObject* parent,
  381. wxObject* instance);
  382. /**
  383. Called from CreateResource after variables were filled.
  384. */
  385. virtual wxObject* DoCreateResource() = 0;
  386. /**
  387. Returns @true if it understands this node and can create
  388. a resource from it, @false otherwise.
  389. @note
  390. You must not call any wxXmlResourceHandler methods except IsOfClass()
  391. from this method! The instance is not yet initialized with node data
  392. at the time CanHandle() is called and it is only safe to operate on
  393. node directly or to call IsOfClass().
  394. */
  395. virtual bool CanHandle(wxXmlNode* node) = 0;
  396. /**
  397. Sets the parent resource.
  398. */
  399. void SetParentResource(wxXmlResource* res);
  400. protected:
  401. /**
  402. Add a style flag (e.g. @c wxMB_DOCKABLE) to the list of flags
  403. understood by this handler.
  404. */
  405. void AddStyle(const wxString& name, int value);
  406. /**
  407. Add styles common to all wxWindow-derived classes.
  408. */
  409. void AddWindowStyles();
  410. /**
  411. Creates children.
  412. */
  413. void CreateChildren(wxObject* parent, bool this_hnd_only = false);
  414. /**
  415. Helper function.
  416. */
  417. void CreateChildrenPrivately(wxObject* parent,
  418. wxXmlNode* rootnode = NULL);
  419. /**
  420. Creates a resource from a node.
  421. */
  422. wxObject* CreateResFromNode(wxXmlNode* node, wxObject* parent,
  423. wxObject* instance = NULL);
  424. /**
  425. Creates an animation (see wxAnimation) from the filename specified in @a param.
  426. */
  427. wxAnimation* GetAnimation(const wxString& param = "animation");
  428. /**
  429. Gets a bitmap.
  430. */
  431. wxBitmap GetBitmap(const wxString& param = "bitmap",
  432. const wxArtClient& defaultArtClient = wxART_OTHER,
  433. wxSize size = wxDefaultSize);
  434. /**
  435. Gets a bitmap from an XmlNode.
  436. @since 2.9.1
  437. */
  438. wxBitmap GetBitmap(const wxXmlNode* node,
  439. const wxArtClient& defaultArtClient = wxART_OTHER,
  440. wxSize size = wxDefaultSize);
  441. /**
  442. Gets a bool flag (1, t, yes, on, true are @true, everything else is @false).
  443. */
  444. bool GetBool(const wxString& param, bool defaultv = false);
  445. /**
  446. Gets colour in HTML syntax (\#RRGGBB).
  447. */
  448. wxColour GetColour(const wxString& param,
  449. const wxColour& defaultColour = wxNullColour);
  450. /**
  451. Returns the current file system.
  452. */
  453. wxFileSystem& GetCurFileSystem();
  454. /**
  455. Gets a dimension (may be in dialog units).
  456. */
  457. wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0,
  458. wxWindow* windowToUse = 0);
  459. /**
  460. Gets a direction.
  461. If the given @a param is not present or has empty value, @a dirDefault is
  462. returned by default. Otherwise the value of the parameter is parsed and
  463. a warning is generated if it's not one of @c wxLEFT, @c wxTOP, @c
  464. wxRIGHT or @c wxBOTTOM.
  465. @since 2.9.3
  466. */
  467. wxDirection GetDirection(const wxString& param, wxDirection dirDefault = wxLEFT);
  468. /**
  469. Gets a font.
  470. */
  471. wxFont GetFont(const wxString& param = "font");
  472. /**
  473. Returns the XRCID.
  474. */
  475. int GetID();
  476. /**
  477. Returns an icon.
  478. */
  479. wxIcon GetIcon(const wxString& param = "icon",
  480. const wxArtClient& defaultArtClient = wxART_OTHER,
  481. wxSize size = wxDefaultSize);
  482. /**
  483. Gets an icon from an XmlNode.
  484. @since 2.9.1
  485. */
  486. wxIcon GetIcon(const wxXmlNode* node,
  487. const wxArtClient& defaultArtClient = wxART_OTHER,
  488. wxSize size = wxDefaultSize);
  489. /**
  490. Returns an icon bundle.
  491. @note
  492. Bundles can be loaded either with stock IDs or from files that contain
  493. more than one image (e.g. Windows icon files). If a file contains only
  494. single image, a bundle with only one icon will be created.
  495. @since 2.9.0
  496. */
  497. wxIconBundle GetIconBundle(const wxString& param,
  498. const wxArtClient& defaultArtClient = wxART_OTHER);
  499. /**
  500. Creates an image list from the @a param markup data.
  501. @return
  502. The new instance of wxImageList or @NULL if no data is found.
  503. @since 2.9.1
  504. */
  505. wxImageList *GetImageList(const wxString& param = "imagelist");
  506. /**
  507. Gets the integer value from the parameter.
  508. */
  509. long GetLong(const wxString& param, long defaultv = 0);
  510. /**
  511. Gets a float value from the parameter.
  512. */
  513. float GetFloat(const wxString& param, float defaultv = 0);
  514. /**
  515. Returns the resource name.
  516. */
  517. wxString GetName();
  518. /**
  519. Gets node content from wxXML_ENTITY_NODE.
  520. */
  521. wxString GetNodeContent(wxXmlNode* node);
  522. /**
  523. Finds the node or returns @NULL.
  524. */
  525. wxXmlNode* GetParamNode(const wxString& param);
  526. /**
  527. Finds the parameter value or returns the empty string.
  528. */
  529. wxString GetParamValue(const wxString& param);
  530. /**
  531. Returns the node parameter value.
  532. @since 2.9.1
  533. */
  534. wxString GetParamValue(const wxXmlNode* node);
  535. /**
  536. Gets the position (may be in dialog units).
  537. */
  538. wxPoint GetPosition(const wxString& param = "pos");
  539. /**
  540. Gets the size (may be in dialog units).
  541. */
  542. wxSize GetSize(const wxString& param = "size", wxWindow* windowToUse = 0);
  543. /**
  544. Gets style flags from text in form "flag | flag2| flag3 |..."
  545. Only understands flags added with AddStyle().
  546. */
  547. int GetStyle(const wxString& param = "style", int defaults = 0);
  548. /**
  549. Gets text from param and does some conversions:
  550. - replaces \\n, \\r, \\t by respective characters (according to C syntax)
  551. - replaces @c $ by @c and @c $$ by @c $ (needed for @c _File to @c File
  552. translation because of XML syntax)
  553. - calls wxGetTranslations (unless disabled in wxXmlResource)
  554. */
  555. wxString GetText(const wxString& param, bool translate = true);
  556. /**
  557. Check to see if a parameter exists.
  558. */
  559. bool HasParam(const wxString& param);
  560. /**
  561. Convenience function.
  562. Returns @true if the node has a property class equal to classname,
  563. e.g. object class="wxDialog".
  564. */
  565. bool IsOfClass(wxXmlNode* node, const wxString& classname);
  566. /**
  567. Sets common window options.
  568. */
  569. void SetupWindow(wxWindow* wnd);
  570. /**
  571. Reports error in XRC resources to the user.
  572. See wxXmlResource::ReportError() for more information.
  573. @since 2.9.0
  574. */
  575. void ReportError(wxXmlNode *context, const wxString& message);
  576. /**
  577. Like ReportError(wxXmlNode*, const wxString&), but uses the node
  578. of currently processed object (m_node) as the context.
  579. @since 2.9.0
  580. */
  581. void ReportError(const wxString& message);
  582. /**
  583. Like ReportError(wxXmlNode*, const wxString&), but uses the node
  584. of parameter @a param of the currently processed object as the context.
  585. This is convenience function for reporting errors in particular
  586. parameters.
  587. @since 2.9.0
  588. */
  589. void ReportParamError(const wxString& param, const wxString& message);
  590. /**
  591. After CreateResource has been called this will return the current
  592. wxXmlResource object.
  593. @since 2.9.5
  594. */
  595. wxXmlResource* GetResource() const;
  596. /**
  597. After CreateResource has been called this will return the XML node
  598. being processed.
  599. @since 2.9.5
  600. */
  601. wxXmlNode* GetNode() const;
  602. /**
  603. After CreateResource has been called this will return the class name of
  604. the XML resource node being processed.
  605. @since 2.9.5
  606. */
  607. wxString GetClass() const;
  608. /**
  609. After CreateResource has been called this will return the current
  610. item's parent, if any.
  611. @since 2.9.5
  612. */
  613. wxObject* GetParent() const;
  614. /**
  615. After CreateResource has been called this will return the instance that
  616. the XML resource content should be created upon, if it has already been
  617. created. If @NULL then the handler should create the object itself.
  618. @since 2.9.5
  619. */
  620. wxObject* GetInstance() const;
  621. /**
  622. After CreateResource has been called this will return the item's parent
  623. as a wxWindow.
  624. @since 2.9.5
  625. */
  626. wxWindow* GetParentAsWindow() const;
  627. };