UIMLView.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. #pragma once
  2. #include "Array.h"
  3. #include "Trie.h"
  4. #include "UIInitialization.h"
  5. #include "Zeichnung.h"
  6. namespace Framework
  7. {
  8. class Text;
  9. class ObjTabelle;
  10. class Schrift;
  11. class Bildschirm;
  12. class UIMLContainer;
  13. namespace XML
  14. {
  15. class Element;
  16. }
  17. /**
  18. creates a Zeichnung that views an element of the uiml
  19. tag: defined by subclasses;
  20. basic attributes:
  21. - (__int64) style: sets the style. Default: TextField::Style::TextField
  22. + 0x...: will be interpreted as hex
  23. # ...: will be interpreted as normal __int64
  24. - (string) text-align-horizontal:
  25. + center: adds the style TextFeld::Style::HCenter
  26. - (string) text-align-vertical:
  27. + center: adds the style TextFeld::Style::VCenter
  28. - (int) font-size: sets the font size
  29. - (int) text-color: sets the text color format: 0xAARRGGBB
  30. - disabled: removes the style TextFeld::Style::Editierbar
  31. - (string) width: sets the with
  32. + (int)%: specifies the width in % of the parent element
  33. + (int): specifies the width in pixel
  34. + (expression): calculates the width from an expression that contains
  35. values concatenated by the operators +, -, / or *
  36. + auto: attribute will be ignored here and may be handled by the
  37. subclasses
  38. - (string) height: sets the with
  39. + (int)%: specifies the width in % of the parent element
  40. + (int): specifies the width in pixel
  41. + (expression): calculates the width from an expression that contains
  42. values concatenated by the operators +, -, / or *
  43. + auto: attribute will be ignored here and may be handled by the
  44. subclasses
  45. - (string) align-left: sets the x coordinate of the view. The value of
  46. margin-left will be added
  47. + start: 0
  48. + end: parentWidth
  49. + center: parentWidth / 2 - width / 2
  50. + id of other element: other element x + other element width
  51. - (string) margin-left: only available if align-left is specified.
  52. + (int)%: specifies the distance to its left aligned coordinate in
  53. percentage of parentWidth
  54. + (int): specifies the distance to its left aligned coordinate in
  55. pixel
  56. + (expression): calculates the width from an expression that contains
  57. - (string) align-right: sets the x coordinate of the view. The value of
  58. margin-right will be subtracted. Will be ignored when align-left is
  59. present.
  60. + start: -width
  61. + end: parentWidth - width
  62. + center: parentWidth / 2 - width / 2
  63. + id of other element: other element x - width
  64. - (string) margin-right: only available if align-right is specified.
  65. + (int)%: specifies the distance to its right aligned coordinate in
  66. percentage of parentWidth
  67. + (int): specifies the distance to its right aligned coordinate in
  68. pixel
  69. + (expression): calculates the width from an expression that contains
  70. values concatenated by the operators +, -, / or *
  71. - (string) align-top: sets the y coordinate of the view. The value of
  72. margin-top will be added
  73. + start: 0
  74. + end: parentHeight
  75. + center: parentHeight / 2 - height / 2
  76. + id of other element: other element y + other element height
  77. - (string) margin-top: only available if align-top is specified.
  78. + (int)%: specifies the distance to its top aligned coordinate in
  79. percentage of parentHeight
  80. + (int): specifies the distance to its top aligned coordinate in pixel
  81. + (expression): calculates the width from an expression that contains
  82. values concatenated by the operators +, -, / or *
  83. - (string) align-bottom: sets the y coordinate of the view. The value of
  84. margin-bottom will be subtracted. Will be ignored when align-top is
  85. present.
  86. + start: -height
  87. + end: parentHeight - height
  88. + center: parentHeight / 2 - height / 2
  89. + id of other element: other element y - height
  90. - (string) margin-bottom: only available if align-bottom is specified.
  91. + (int)%: specifies the distance to its bottom aligned coordinate in
  92. percentage of parentHeight
  93. + (int): specifies the distance to its bottom aligned coordinate in
  94. pixel
  95. + (expression): calculates the width from an expression that contains
  96. values concatenated by the operators +, -, / or *
  97. - (string) x: sets the x coordinate of the view. overwrites align-left
  98. and align-right
  99. + (int)%: specifies the x coordinate in percentage of parentWidth
  100. + (int): specifies the x coordinate in pixel
  101. + (expression): calculates the width from an expression that contains
  102. - (string) y: sets the y coordinate of the view. overwrites align-top
  103. and align-bottom
  104. + (int)%: specifies the y coordinate in percentage of parentHeight
  105. + (int): specifies the y coordinate in pixel
  106. + (expression): calculates the width from an expression that contains
  107. values concatenated by the operators +, -, / or *
  108. */
  109. class UIMLElement : public virtual ReferenceCounter
  110. {
  111. public:
  112. DLLEXPORT UIMLElement();
  113. DLLEXPORT virtual ~UIMLElement();
  114. //! prüft, ob dieses UIML Element für ein bestimmtes xml Element
  115. //! zuständig ist
  116. virtual bool isApplicableFor(XML::Element& element) = 0;
  117. //! erstellt eine neue Zeichnung zu einem gegebenen xml Element
  118. virtual Zeichnung* parseElement(
  119. XML::Element& element, UIMLContainer& generalFactory)
  120. = 0;
  121. //! aktualisiert eine Zeichnung mit den Daten eines xml Elements. Gibt
  122. //! false zurück, wenn die Zeichnung nicht aktualisiert werden konnte
  123. //! und neu erstellt werden muss
  124. virtual bool updateElement(
  125. XML::Element& element, Zeichnung& z, UIMLContainer& generalFactory)
  126. = 0;
  127. //! wendet die layout parameter zu einer Zeichnung an
  128. DLLEXPORT virtual void layout(XML::Element& element,
  129. Zeichnung& z,
  130. int pWidth,
  131. int pHeight,
  132. UIMLContainer& generalLayouter);
  133. /// <summary>
  134. /// calculates the size based on a given attribute value. Allowed values
  135. /// are expression with +, -, * or / operators and percentages of
  136. /// parentSize. uses 0 for each invalid part of the expression
  137. /// </summary>
  138. /// <param name="attributeValue">the expression that should be
  139. /// evaluated</param> <param name="parentSize">the size of the parent in
  140. /// pixel</param> <returns>the resulting size in pixel</returns>
  141. DLLEXPORT int calculateSize(Text attributeValue, int parentSize);
  142. };
  143. class UIMLContainer : public UIMLElement
  144. {
  145. public:
  146. DLLEXPORT UIMLContainer();
  147. DLLEXPORT virtual ~UIMLContainer();
  148. virtual Zeichnung* zZeichnungById(const char* id) = 0;
  149. virtual Zeichnung* getZeichnungById(const char* id) = 0;
  150. virtual Text getZeichnungId(Zeichnung& z) = 0;
  151. virtual void removeZeichnung(Zeichnung& z) = 0;
  152. virtual bool registerZeichnung(const char* id, Zeichnung* z) = 0;
  153. virtual const UIInit& getFactory() = 0;
  154. };
  155. /**
  156. creates a TextFeld instance with style TextField::Style::TextField
  157. tag: &lt;textfield&gt;
  158. additional attributes to UIMLElement:
  159. - (__int64) style: sets the style. Default: TextField::Style::TextField
  160. - (string) text-align-horizontal:
  161. + center: adds the style TextFeld::Style::HCenter
  162. - (string) text-align-vertical:
  163. + center: adds the style TextFeld::Style::VCenter
  164. - (int) font-size: sets the font size
  165. - (int) text-color: sets the text color. format: 0xAARRGGBB
  166. - disabled: removes the style TextFeld::Style::Editierbar
  167. - (string) width: sets the with
  168. + auto: setzt the width to the calculated needed width
  169. - (string) height: sets the with
  170. + auto: setzt the width to the calculated needed width
  171. - (string) vScroll: adds a vertical scroll bar
  172. + auto: the max vertical scroll size is set to the needed text height
  173. and the click scroll per pixel will be set to font size
  174. - (int) hScroll: adds a hotizontal scroll bar
  175. + auto: the max horizontal scroll size is set to the needed text width
  176. and the click scroll per pixel will be set to font size
  177. */
  178. class UIMLTextField : public UIMLElement
  179. {
  180. public:
  181. DLLEXPORT UIMLTextField();
  182. DLLEXPORT bool isApplicableFor(XML::Element& element) override;
  183. DLLEXPORT Zeichnung* parseElement(
  184. XML::Element& element, UIMLContainer& generalFactory) override;
  185. DLLEXPORT bool updateElement(XML::Element& element,
  186. Zeichnung& z,
  187. UIMLContainer& generalFactory) override;
  188. DLLEXPORT void layout(XML::Element& element,
  189. Zeichnung& z,
  190. int pWidth,
  191. int pHeight,
  192. UIMLContainer& generalLayouter) override;
  193. };
  194. class UIMLButton : public UIMLElement
  195. {
  196. public:
  197. DLLEXPORT UIMLButton();
  198. DLLEXPORT bool isApplicableFor(XML::Element& element) override;
  199. DLLEXPORT Zeichnung* parseElement(
  200. XML::Element& element, UIMLContainer& generalFactory) override;
  201. DLLEXPORT bool updateElement(XML::Element& element,
  202. Zeichnung& z,
  203. UIMLContainer& generalFactory) override;
  204. DLLEXPORT void layout(XML::Element& element,
  205. Zeichnung& z,
  206. int pWidth,
  207. int pHeight,
  208. UIMLContainer& generalLayouter) override;
  209. };
  210. class UIMLCheck : public UIMLElement
  211. {
  212. public:
  213. DLLEXPORT UIMLCheck();
  214. DLLEXPORT bool isApplicableFor(XML::Element& element) override;
  215. DLLEXPORT Zeichnung* parseElement(
  216. XML::Element& element, UIMLContainer& generalFactory) override;
  217. DLLEXPORT bool updateElement(XML::Element& element,
  218. Zeichnung& z,
  219. UIMLContainer& generalFactory) override;
  220. DLLEXPORT void layout(XML::Element& element,
  221. Zeichnung& z,
  222. int pWidth,
  223. int pHeight,
  224. UIMLContainer& generalLayouter) override;
  225. };
  226. /**
  227. creates a TextFeld instance with style TextField::Style::Text
  228. tag: &lt;text&gt;
  229. additional attributes to UIMLElement:
  230. - (__int64) style: sets the style. Default: TextField::Style::Text
  231. - (string) text-align-horizontal:
  232. + center: adds the style TextFeld::Style::HCenter
  233. - (string) text-align-vertical:
  234. + center: adds the style TextFeld::Style::VCenter
  235. - (int) font-size: sets the font size
  236. - (int) text-color: sets the text color. format: 0xAARRGGBB
  237. - disabled: removes the style TextFeld::Style::Editierbar
  238. - (string) width: sets the with
  239. + auto: setzt the width to the calculated needed width
  240. - (string) height: sets the with
  241. + auto: setzt the width to the calculated needed width
  242. - (string) vScroll: adds a vertical scroll bar
  243. + auto: the max vertical scroll size is set to the needed text height
  244. and the click scroll per pixel will be set to font size
  245. - (int) hScroll: adds a hotizontal scroll bar
  246. + auto: the max horizontal scroll size is set to the needed text width
  247. and the click scroll per pixel will be set to font size
  248. */
  249. class UIMLText : public UIMLElement
  250. {
  251. public:
  252. DLLEXPORT UIMLText();
  253. DLLEXPORT bool isApplicableFor(XML::Element& element) override;
  254. DLLEXPORT Zeichnung* parseElement(
  255. XML::Element& element, UIMLContainer& generalFactory) override;
  256. DLLEXPORT bool updateElement(XML::Element& element,
  257. Zeichnung& z,
  258. UIMLContainer& generalFactory) override;
  259. DLLEXPORT void layout(XML::Element& element,
  260. Zeichnung& z,
  261. int pWidth,
  262. int pHeight,
  263. UIMLContainer& generalLayouter) override;
  264. };
  265. /**
  266. creates a TextFeld instance with style TextField::Style::TextGebiet
  267. tag: &lt;textarea&gt;
  268. additional attributes to UIMLElement:
  269. - (__int64) style: sets the style. Default: TextField::Style::TextGebiet
  270. - (string) text-align-horizontal:
  271. + center: adds the style TextFeld::Style::HCenter
  272. - (string) text-align-vertical:
  273. + center: adds the style TextFeld::Style::VCenter
  274. - (int) font-size: sets the font size
  275. - (int) text-color: sets the text color. format: 0xAARRGGBB
  276. - disabled: removes the style TextFeld::Style::Editierbar
  277. - (string) width: sets the with
  278. + auto: setzt the width to the calculated needed width
  279. - (string) height: sets the with
  280. + auto: setzt the width to the calculated needed width
  281. - (string) vScroll: adds a vertical scroll bar
  282. + auto: the max vertical scroll size is set to the needed text height
  283. and the click scroll per pixel will be set to font size
  284. - (int) hScroll: adds a hotizontal scroll bar
  285. + auto: the max horizontal scroll size is set to the needed text width
  286. and the click scroll per pixel will be set to font size
  287. */
  288. class UIMLTextArea : public UIMLElement
  289. {
  290. public:
  291. DLLEXPORT UIMLTextArea();
  292. DLLEXPORT bool isApplicableFor(XML::Element& element) override;
  293. DLLEXPORT Zeichnung* parseElement(
  294. XML::Element& element, UIMLContainer& generalFactory) override;
  295. DLLEXPORT bool updateElement(XML::Element& element,
  296. Zeichnung& z,
  297. UIMLContainer& generalFactory) override;
  298. DLLEXPORT void layout(XML::Element& element,
  299. Zeichnung& z,
  300. int pWidth,
  301. int pHeight,
  302. UIMLContainer& generalLayouter) override;
  303. };
  304. class UIMLTable : public UIMLElement
  305. {
  306. public:
  307. DLLEXPORT UIMLTable();
  308. DLLEXPORT bool isApplicableFor(XML::Element& element) override;
  309. DLLEXPORT Zeichnung* parseElement(
  310. XML::Element& element, UIMLContainer& generalFactory) override;
  311. DLLEXPORT bool updateElement(XML::Element& element,
  312. Zeichnung& z,
  313. UIMLContainer& generalFactory) override;
  314. DLLEXPORT void layout(XML::Element& element,
  315. Zeichnung& z,
  316. int pWidth,
  317. int pHeight,
  318. UIMLContainer& generalLayouter) override;
  319. };
  320. /**
  321. creates a Fenster instance
  322. tag: &lt;frame&gt;
  323. additional attributes to UIMLElement:
  324. - (string) title: the title of the window
  325. - (int) title-height: sets the height of the title
  326. - (int) title-font-size: sets the font size of the title
  327. - (int) title-text-color: sets the color of the title. format:
  328. 0xAARRGGBB
  329. - (string) display: specifies the position of child elements
  330. + column: sets the position of child elements vertically below each
  331. other. any align attribute will overwrite this behaviour.
  332. + row: sets the position of the child elements horizontally beneath
  333. each other. any align attribute will overwrite this behaviour.
  334. - (int) gap: the space between each child element. Only valid if display
  335. is specified.
  336. + (int)%: specifies the y coordinate in percentage of parentHeight
  337. + (int): specifies the y coordinate in pixel
  338. + (expression): calculates the width from an expression that contains
  339. values concatenated by the operators +, -, / or *
  340. - (string) vScroll: adds a vertical scroll bar
  341. + auto: the max vertical scroll size is set to the needed child elements height
  342. - (int) hScroll: adds a hotizontal scroll bar
  343. + auto: the max horizontal scroll size is set to the needed child elements width
  344. */
  345. class UIMLFrame : public UIMLElement
  346. {
  347. public:
  348. DLLEXPORT UIMLFrame();
  349. DLLEXPORT bool isApplicableFor(XML::Element& element) override;
  350. DLLEXPORT Zeichnung* parseElement(
  351. XML::Element& element, UIMLContainer& generalFactory) override;
  352. DLLEXPORT bool updateElement(XML::Element& element,
  353. Zeichnung& z,
  354. UIMLContainer& generalFactory) override;
  355. DLLEXPORT void layout(XML::Element& element,
  356. Zeichnung& z,
  357. int pWidth,
  358. int pHeight,
  359. UIMLContainer& generalLayouter) override;
  360. };
  361. /**
  362. Converts uiml views to Zeichnung implementations and renders them.
  363. The attribute id of each element has to be unique or absent.
  364. All implementations of UIMLElement in the framework are supported by
  365. default. Custom elements can be added by calling addKnownElement with a
  366. custom UIMLElement implementation. Look at the documentation of specific
  367. UIMLElement implementations to view all supported attributes.
  368. example:
  369. \code
  370. <view>
  371. <textfield id="element_at_top_left" align-left="start",
  372. align-top="start", margin-left="5", margin-top="5" width="90%"
  373. height="30"/>
  374. <table id="element_below_textfield" align-left="start",
  375. aliign-top="element_at_top_left", margin-left="5", margin-top="5"
  376. width="90%" height="300">
  377. <tr>
  378. <button id="a_button_in_a_table"/>
  379. <textfield id="a_textfield_in_a_table"/>
  380. </tr>
  381. </table>
  382. </view>
  383. \endcode
  384. */
  385. class UIMLView : public ZeichnungHintergrund,
  386. public UIMLContainer
  387. {
  388. public:
  389. class Style : public ZeichnungHintergrund::Style
  390. {
  391. public:
  392. /// <summary>
  393. /// if this style is set, then the mause event action will be
  394. /// overwritten for all member views. The onMemberMouseEvent
  395. /// function will be executed instead. The style needs to be set
  396. /// before the uiml is parsed
  397. /// </summary>
  398. static const int GlobalMouseEvent = 0x01000;
  399. /// <summary>
  400. /// if this style is set, then the keyvord event action will be
  401. /// overwritten for all member views. The onMemberKeybordEvent
  402. /// function will be executed instead. The style needs to be set
  403. /// before the uiml is parsed
  404. /// </summary>
  405. static const int GlobalTastaturEvent = 0x01000;
  406. };
  407. private:
  408. RCArray<UIMLElement> knownElements;
  409. UIInit init;
  410. RCTrie<Zeichnung>* members;
  411. Array<Zeichnung*> memberList;
  412. RCArray<Text> idList;
  413. XML::Element* dom;
  414. int nextId;
  415. std::function<bool(
  416. XML::Element& element, Zeichnung& member, MausEreignis me)>
  417. onMemberMouseEvent;
  418. std::function<bool(
  419. XML::Element& element, Zeichnung& member, TastaturEreignis te)>
  420. onMemberKeyboardEvent;
  421. //! Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch
  422. //! aufgerufen. \param me Das Ereignis
  423. DLLEXPORT virtual void doMausEreignis(
  424. MausEreignis& me, bool userRet) override;
  425. public:
  426. //! Erstellt eine UIML View
  427. DLLEXPORT UIMLView();
  428. //! Erstellt eine UIML View zu einem UIML Text
  429. //! \param uiml Ein xml element gemät des KSG UIML standarts
  430. //! \param screen Ein zeiger für den Belschirm auf dem die tooltips
  431. //! angezeigt werden sollen \param schrift Die schrift mit der der Text
  432. //! gezeichnet werden soll
  433. DLLEXPORT UIMLView(XML::Element* uiml, UIInit& init);
  434. //! Erstellt eine UIML View zu einem UIML Text
  435. //! \param uiml Ein xml text gemät des KSG UIML standarts
  436. //! \param screen Ein zeiger für den Belschirm auf dem die tooltips
  437. //! angezeigt werden sollen \param schrift Die schrift mit der der Text
  438. //! gezeichnet werden soll
  439. DLLEXPORT UIMLView(Text uiml, UIInit& init);
  440. DLLEXPORT ~UIMLView();
  441. /// <summary>
  442. /// sets a function that is executed if a mouse event on a member view
  443. /// occures and the style Style::GlobalMouseEvent is set.
  444. /// The mouse event will be ignored by the view if false is returned.
  445. /// </summary>
  446. /// <param name="onEventAction">the function to execute if a mouse event
  447. /// occures</param>
  448. DLLEXPORT void setOnMemberMouseEvent(std::function<bool(
  449. XML::Element& element, Zeichnung& member, MausEreignis me)>
  450. onEventAction);
  451. /// <summary>
  452. /// sets a function that is executed if a mouse event on a member view
  453. /// occures and the style Style::GlobalTastaturEvent is set.
  454. /// The mouse event will be ignored by the view if false is returned.
  455. /// </summary>
  456. /// <param name="onEventAction">the function to execute if a mouse event
  457. /// occures</param>
  458. DLLEXPORT void setOnMemberKeyboardEvent(std::function<bool(
  459. XML::Element& element, Zeichnung& member, TastaturEreignis te)>
  460. onEventAction);
  461. //! entfernt alle bekannten elemente, die im uiml verwendet werden
  462. //! können
  463. DLLEXPORT void removeAllKnownElements();
  464. //! fügt ein neues bekanntes element hinzu, dass danach im uiml
  465. //! verwendet werden kann.
  466. DLLEXPORT void addKnownElement(UIMLElement* element);
  467. //! prüft, ob ein xml Element ein bekanntes uiml Element ist;
  468. DLLEXPORT bool isKnownElement(XML::Element* zElement);
  469. //! setzt den inhalt der view
  470. //! \param uiml Ein xml element gemät des KSG UIML standarts
  471. DLLEXPORT void setUIML(XML::Element* uiml);
  472. //! setzt den inhalt der view
  473. //! \param uiml Ein xml text gemät des KSG UIML standarts
  474. DLLEXPORT void setUIML(Text uiml);
  475. //! aktualisiert alles zeichnungen gemäß den spezifikationen in UIML.
  476. //! Zeichnungen von entfernten elementen werden entfernt und neue
  477. //! Zeichnungen für neue Elemente werden erstellt
  478. DLLEXPORT void update();
  479. //! aktualisiert größe und position aller Zeichnungen gemäß den
  480. //! spezifikationen in UIML
  481. DLLEXPORT void layout();
  482. //! fügt ein element hinzu
  483. //! \param uiml Ein xml text gemät des KSG UIML standarts, welcher das
  484. //! neue Objekt darstellt \return id des neuen Elements
  485. DLLEXPORT Text addMember(Text uiml);
  486. //! fügt ein element zu einem Elternelement hinzu (funktioniert momentan
  487. //! nur mit frame Objekten) \param uiml Ein xml text gemät des KSG UIML
  488. //! standarts, welcher das neue Objekt darstellt \return id des neuen
  489. //! Elements
  490. DLLEXPORT Text addMember(Text uiml, Text parentId);
  491. //! entfernt ein element
  492. //! \param id id des Elements
  493. DLLEXPORT void removeMember(Text id);
  494. //! Gibt eine zeichnung zurück, welche in uiml eine bestimmte id hat
  495. //! \param id die id der Zeichnung
  496. DLLEXPORT Zeichnung* zZeichnungById(const char* id) override;
  497. //! Gibt eine zeichnung zurück, welche in uiml eine bestimmte id hat
  498. //! \param id die id der Zeichnung
  499. DLLEXPORT Zeichnung* getZeichnungById(const char* id) override;
  500. //! Verarbeitet ein Tastatur Ereignis. Wird vom Framework automatisch
  501. //! aufgerufen \param te Das Ereignis
  502. DLLEXPORT virtual void doTastaturEreignis(TastaturEreignis& te);
  503. //! Updated den Zeichenhintergrund
  504. //! \param tickVal Die vergangene Zeit in Sekunden, die seit dem Letzten
  505. //! Aufruf dieser Funktion verstrichen ist \return 1, wenn das Bild neu
  506. //! gezeichnet werden muss. 0 sonnst
  507. DLLEXPORT bool tick(double tickVal) override;
  508. //! Zeichnet den Hintergrund eines Zeichnunges nach rObj
  509. DLLEXPORT void render(Bild& rObj) override;
  510. //! Gibt den Dom Tree ohne erhöhten reference counter zurück
  511. //! Änderungen am Dom Tree sollten vermieden werden (nur änderungen von
  512. //! attributen einzelner elemente sind erlaubt)
  513. DLLEXPORT XML::Element* zDom() const;
  514. //! Gibt den Dom Tree zurück
  515. //! Änderungen am Dom Tree sollten vermieden werden (nur änderungen von
  516. //! attributen einzelner elemente sind erlaubt)
  517. DLLEXPORT XML::Element* getDom() const;
  518. DLLEXPORT bool isApplicableFor(XML::Element& element) override;
  519. DLLEXPORT Zeichnung* parseElement(
  520. XML::Element& element, UIMLContainer& generalFactory) override;
  521. DLLEXPORT bool updateElement(XML::Element& element,
  522. Zeichnung& z,
  523. UIMLContainer& generalFactory) override;
  524. DLLEXPORT void layout(XML::Element& element,
  525. Zeichnung& z,
  526. int pWidth,
  527. int pHeight,
  528. UIMLContainer& generalLayouter) override;
  529. DLLEXPORT Text getZeichnungId(Zeichnung& z) override;
  530. DLLEXPORT void removeZeichnung(Zeichnung& z) override;
  531. DLLEXPORT bool registerZeichnung(const char* id, Zeichnung* z) override;
  532. DLLEXPORT const UIInit& getFactory() override;
  533. //! calculates the needed size for all content elements to be visible
  534. DLLEXPORT Punkt calculateContentSize();
  535. };
  536. } // namespace Framework