#pragma once #include "Zeichnung.h" #include "Trie.h" #include "Array.h" #include "UIInitialization.h" /* KSG UIML Standart possible XML elements: uimlview (the root element of uiml), class (only as direct child of uimlview), textfield, button, check, (KontrollKnopf) text, textarea, table (allowed child elements: tr), tr (allowed child elements: textfield, button, table, text, textarea, frame), frame (allowed child elements: textfield, button, table, text, textarea, frame). possible global XML attributes: id (string should be unique), x (integer, optional % char at end), y (integer, optional % char at end), width (integer, optional % char at end), height (integer, optional % char at end), margin (integer, optional % char at end), margin-left (integer, optional % char at end), margin-top (integer, optional % char at end), margin-right (integer, optional % char at end), margin-bottom (integer, optional % char at end), align-left (string (id values of other elements or keywords: start, end)), align-top (string (id values of other elements or keywords: start, end)), align-bottom ((string (id values of other elements or keywords: start, end)), align-right (string (id values of other elements or keywords: start, end)), tooltip (string), style (hex __int64), class (string (id of class element)) attribute die sich gegenseitig ausschließen: align-left / align-right align-top / align-bottom spezific attributes: font-size (textfield, text, textarea, button) text-align (textfield, text, textarea) text-align-horizontal (textfield, text, textarea) text-align-vertical (textfield, text, textarea) example:
*/ namespace Framework { class Text; class ObjTabelle; class Schrift; class Bildschirm; namespace XML { class Element; } class UIMLView : public ZeichnungHintergrund { private: UIInit init; Trie< Zeichnung > *members; XML::Element *dom; int nextId; void parseTable( Iterator childs, ObjTabelle *table ); void parseFrame( Iterator childs, Fenster *frame ); Zeichnung *parseElement( XML::Element *e ); void layout( XML::Element *e, int pWidth, int pHeight ); // Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen. // me: Das Ereignis __declspec( dllexport ) virtual void doMausEreignis( MausEreignis &me, bool userRet ) override; public: // Erstellt eine UIML View __declspec( dllexport ) UIMLView(); // Erstellt eine UIML View zu einem UIML Text // uiml: Ein xml element gemät des KSG UIML standarts // screen: Ein zeiger für den Belschirm auf dem die tooltips angezeigt werden sollen // schrift: Die schrift mit der der Text gezeichnet werden soll __declspec( dllexport ) UIMLView( XML::Element *uiml, UIInit &init ); // Erstellt eine UIML View zu einem UIML Text // uiml: Ein xml text gemät des KSG UIML standarts // screen: Ein zeiger für den Belschirm auf dem die tooltips angezeigt werden sollen // schrift: Die schrift mit der der Text gezeichnet werden soll __declspec( dllexport ) UIMLView( Text uiml, UIInit &init ); __declspec( dllexport ) ~UIMLView(); // setzt den inhalt der view // uiml: Ein xml element gemät des KSG UIML standarts __declspec( dllexport ) void setUIML( XML::Element *uiml ); // setzt den inhalt der view // uiml: Ein xml text gemät des KSG UIML standarts __declspec( dllexport ) void setUIML( Text uiml ); // aktualisiert größe und position aller Zeichnungen gemäß den spezifikationen in UIML __declspec( dllexport ) void layout(); // fügt ein element hinzu // uiml: Ein xml text gemät des KSG UIML standarts, welcher das neue Objekt darstellt // return: id des neuen Elements __declspec( dllexport ) Text addMember( Text uiml ); // fügt ein element zu einem Elternelement hinzu (funktioniert momentan nur mit frame Objekten) // uiml: Ein xml text gemät des KSG UIML standarts, welcher das neue Objekt darstellt // return: id des neuen Elements __declspec( dllexport ) Text addMember( Text uiml, Text parentId ); // entfernt ein element // id: id des Elements __declspec( dllexport ) void removeMember( Text id ); // Gibt eine zeichnung zurück, welche in uiml eine bestimmte id hat // id: die id der Zeichnung __declspec( dllexport ) Zeichnung *zZeichnung( Text id ); // Verarbeitet ein Tastatur Ereignis. Wird vom Framework automatisch aufgerufen // te: Das Ereignis __declspec( dllexport ) virtual void doTastaturEreignis( TastaturEreignis &te ); // Updated den Zeichenhintergrund // tickVal: Die vergangene Zeit in Sekunden, die seit dem Letzten Aufruf dieser Funktion verstrichen ist // return: 1, wenn das Bild neu gezeichnet werden muss. 0 sonnst __declspec( dllexport ) bool tick( double tickVal ) override; // Zeichnet den Hintergrund eines Zeichnunges nach rObj __declspec( dllexport ) void render( Bild &rObj ) override; // Gibt den Dom Tree ohne erhöhten reference counter zurück // Änderungen am Dom Tree sollten vermieden werden (nur änderungen von attributen einzelner elemente sind erlaubt) __declspec( dllexport ) XML::Element *zDom() const; // Gibt den Dom Tree zurück // Änderungen am Dom Tree sollten vermieden werden (nur änderungen von attributen einzelner elemente sind erlaubt) __declspec( dllexport ) XML::Element *getDom() const; }; }