123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601 |
- #pragma once
- #include "Array.h"
- #include "Trie.h"
- #include "UIInitialization.h"
- #include "XML.h"
- #include "Zeichnung.h"
- namespace Framework
- {
- class Text;
- class ObjTabelle;
- class Schrift;
- class Bildschirm;
- class UIMLContainer;
-
- class UIMLElement : public virtual ReferenceCounter
- {
- public:
- DLLEXPORT UIMLElement();
- DLLEXPORT virtual ~UIMLElement();
-
-
- virtual bool isApplicableFor(XML::Element& element) = 0;
-
- virtual Zeichnung* parseElement(
- XML::Element& element, UIMLContainer& generalFactory)
- = 0;
-
-
-
- virtual bool updateElement(
- XML::Element& element, Zeichnung& z, UIMLContainer& generalFactory)
- = 0;
-
- DLLEXPORT virtual void layout(XML::Element& element,
- Zeichnung& z,
- int pWidth,
- int pHeight,
- UIMLContainer& generalLayouter);
-
-
-
-
-
-
-
-
- DLLEXPORT int calculateSize(Text attributeValue, int parentSize);
-
-
-
- virtual XML::Editor getChildren(XML::Element& element);
- };
- class UIMLContainer : public UIMLElement
- {
- public:
- DLLEXPORT UIMLContainer();
- DLLEXPORT virtual ~UIMLContainer();
- virtual Zeichnung* zZeichnungById(const char* id) = 0;
- virtual Zeichnung* getZeichnungById(const char* id) = 0;
- virtual Text getZeichnungId(Zeichnung& z) = 0;
- virtual void removeZeichnung(Zeichnung& z) = 0;
- virtual bool registerZeichnung(const char* id, Zeichnung* z) = 0;
- virtual const UIInit& getFactory() = 0;
- };
-
- class UIMLTextField : public UIMLElement
- {
- public:
- DLLEXPORT UIMLTextField();
- DLLEXPORT bool isApplicableFor(XML::Element& element) override;
- DLLEXPORT Zeichnung* parseElement(
- XML::Element& element, UIMLContainer& generalFactory) override;
- DLLEXPORT bool updateElement(XML::Element& element,
- Zeichnung& z,
- UIMLContainer& generalFactory) override;
- DLLEXPORT void layout(XML::Element& element,
- Zeichnung& z,
- int pWidth,
- int pHeight,
- UIMLContainer& generalLayouter) override;
- };
- class UIMLButton : public UIMLElement
- {
- public:
- DLLEXPORT UIMLButton();
- DLLEXPORT bool isApplicableFor(XML::Element& element) override;
- DLLEXPORT Zeichnung* parseElement(
- XML::Element& element, UIMLContainer& generalFactory) override;
- DLLEXPORT bool updateElement(XML::Element& element,
- Zeichnung& z,
- UIMLContainer& generalFactory) override;
- DLLEXPORT void layout(XML::Element& element,
- Zeichnung& z,
- int pWidth,
- int pHeight,
- UIMLContainer& generalLayouter) override;
- };
- class UIMLCheck : public UIMLElement
- {
- public:
- DLLEXPORT UIMLCheck();
- DLLEXPORT bool isApplicableFor(XML::Element& element) override;
- DLLEXPORT Zeichnung* parseElement(
- XML::Element& element, UIMLContainer& generalFactory) override;
- DLLEXPORT bool updateElement(XML::Element& element,
- Zeichnung& z,
- UIMLContainer& generalFactory) override;
- DLLEXPORT void layout(XML::Element& element,
- Zeichnung& z,
- int pWidth,
- int pHeight,
- UIMLContainer& generalLayouter) override;
- };
-
- class UIMLText : public UIMLElement
- {
- public:
- DLLEXPORT UIMLText();
- DLLEXPORT bool isApplicableFor(XML::Element& element) override;
- DLLEXPORT Zeichnung* parseElement(
- XML::Element& element, UIMLContainer& generalFactory) override;
- DLLEXPORT bool updateElement(XML::Element& element,
- Zeichnung& z,
- UIMLContainer& generalFactory) override;
- DLLEXPORT void layout(XML::Element& element,
- Zeichnung& z,
- int pWidth,
- int pHeight,
- UIMLContainer& generalLayouter) override;
- };
-
- class UIMLTextArea : public UIMLElement
- {
- public:
- DLLEXPORT UIMLTextArea();
- DLLEXPORT bool isApplicableFor(XML::Element& element) override;
- DLLEXPORT Zeichnung* parseElement(
- XML::Element& element, UIMLContainer& generalFactory) override;
- DLLEXPORT bool updateElement(XML::Element& element,
- Zeichnung& z,
- UIMLContainer& generalFactory) override;
- DLLEXPORT void layout(XML::Element& element,
- Zeichnung& z,
- int pWidth,
- int pHeight,
- UIMLContainer& generalLayouter) override;
- };
- class UIMLTable : public UIMLElement
- {
- public:
- DLLEXPORT UIMLTable();
- DLLEXPORT bool isApplicableFor(XML::Element& element) override;
- DLLEXPORT Zeichnung* parseElement(
- XML::Element& element, UIMLContainer& generalFactory) override;
- DLLEXPORT bool updateElement(XML::Element& element,
- Zeichnung& z,
- UIMLContainer& generalFactory) override;
- DLLEXPORT void layout(XML::Element& element,
- Zeichnung& z,
- int pWidth,
- int pHeight,
- UIMLContainer& generalLayouter) override;
- virtual XML::Editor getChildren(XML::Element& element) override;
- };
-
- class UIMLFrame : public UIMLElement
- {
- public:
- DLLEXPORT UIMLFrame();
- DLLEXPORT bool isApplicableFor(XML::Element& element) override;
- DLLEXPORT Zeichnung* parseElement(
- XML::Element& element, UIMLContainer& generalFactory) override;
- DLLEXPORT bool updateElement(XML::Element& element,
- Zeichnung& z,
- UIMLContainer& generalFactory) override;
- DLLEXPORT void layout(XML::Element& element,
- Zeichnung& z,
- int pWidth,
- int pHeight,
- UIMLContainer& generalLayouter) override;
- };
-
- class UIMLView : public ZeichnungHintergrund,
- public UIMLContainer
- {
- public:
- class Style : public ZeichnungHintergrund::Style
- {
- public:
-
-
-
-
-
-
- static const int GlobalMouseEvent = 0x01000;
-
-
-
-
-
-
- static const int GlobalTastaturEvent = 0x01000;
- };
- private:
- RCArray<UIMLElement> knownElements;
- UIInit init;
- RCTrie<Zeichnung>* members;
- Array<Zeichnung*> memberList;
- RCArray<Text> idList;
- XML::Element* dom;
- int nextId;
- std::function<bool(
- XML::Element& element, Zeichnung& member, MausEreignis me)>
- onMemberMouseEvent;
- std::function<bool(
- XML::Element& element, Zeichnung& member, TastaturEreignis te)>
- onMemberKeyboardEvent;
-
-
- DLLEXPORT virtual void doMausEreignis(
- MausEreignis& me, bool userRet) override;
- public:
-
- DLLEXPORT UIMLView();
-
-
-
-
-
- DLLEXPORT UIMLView(XML::Element* uiml, UIInit& init);
-
-
-
-
-
- DLLEXPORT UIMLView(Text uiml, UIInit& init);
- DLLEXPORT ~UIMLView();
-
-
-
-
-
-
-
- DLLEXPORT void setOnMemberMouseEvent(std::function<bool(
- XML::Element& element, Zeichnung& member, MausEreignis me)>
- onEventAction);
-
-
-
-
-
-
-
- DLLEXPORT void setOnMemberKeyboardEvent(std::function<bool(
- XML::Element& element, Zeichnung& member, TastaturEreignis te)>
- onEventAction);
-
-
- DLLEXPORT void removeAllKnownElements();
-
-
- DLLEXPORT void addKnownElement(UIMLElement* element);
-
- DLLEXPORT bool isKnownElement(XML::Element* zElement);
-
-
- DLLEXPORT void setUIML(XML::Element* uiml);
-
-
- DLLEXPORT void setUIML(Text uiml);
-
-
-
- DLLEXPORT void update();
-
-
- DLLEXPORT void layout();
-
-
-
- DLLEXPORT Text addMember(Text uiml);
-
-
-
-
- DLLEXPORT Text addMember(Text uiml, Text parentId);
-
-
- DLLEXPORT void removeMember(Text id);
-
-
- DLLEXPORT Zeichnung* zZeichnungById(const char* id) override;
-
-
- DLLEXPORT Zeichnung* getZeichnungById(const char* id) override;
-
-
- DLLEXPORT virtual void doTastaturEreignis(TastaturEreignis& te);
-
-
-
-
- DLLEXPORT bool tick(double tickVal) override;
-
- DLLEXPORT void render(Bild& rObj) override;
-
-
-
- DLLEXPORT XML::Element* zDom() const;
-
-
-
- DLLEXPORT XML::Element* getDom() const;
- DLLEXPORT bool isApplicableFor(XML::Element& element) override;
- DLLEXPORT Zeichnung* parseElement(
- XML::Element& element, UIMLContainer& generalFactory) override;
- DLLEXPORT bool updateElement(XML::Element& element,
- Zeichnung& z,
- UIMLContainer& generalFactory) override;
- DLLEXPORT void layout(XML::Element& element,
- Zeichnung& z,
- int pWidth,
- int pHeight,
- UIMLContainer& generalLayouter) override;
- DLLEXPORT Text getZeichnungId(Zeichnung& z) override;
- DLLEXPORT void removeZeichnung(Zeichnung& z) override;
- DLLEXPORT bool registerZeichnung(const char* id, Zeichnung* z) override;
- DLLEXPORT const UIInit& getFactory() override;
-
- DLLEXPORT Punkt calculateContentSize();
- };
- }
|