-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include "../Base.h" | ||
#include "DocumentElementType.h" | ||
|
||
namespace cru::ui::document { | ||
class CRU_UI_API DocumentElement : public Object { | ||
public: | ||
explicit DocumentElement(DocumentElementType* type); | ||
|
||
~DocumentElement() override; | ||
|
||
public: | ||
DocumentElementType* GetType() const { return type_; } | ||
|
||
private: | ||
DocumentElementType* type_; | ||
}; | ||
} // namespace cru::ui::document |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include "cru/common/String.h" | ||
|
||
#include "../Base.h" | ||
|
||
namespace cru::ui::document { | ||
class CRU_UI_API DocumentElementType : public Object { | ||
public: | ||
explicit DocumentElementType(String name); | ||
|
||
~DocumentElementType() override; | ||
|
||
public: | ||
String GetName() const { return name_; } | ||
|
||
private: | ||
String name_; | ||
}; | ||
|
||
struct CRU_UI_API DocumentElementTypes { | ||
static DocumentElementType* const kRootElementType; | ||
}; | ||
|
||
} // namespace cru::ui::document |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "cru/ui/document/DocumentElement.h" | ||
#include "cru/ui/document/DocumentElementType.h" | ||
|
||
namespace cru::ui::document { | ||
DocumentElement::DocumentElement(DocumentElementType* type) : type_(type) {} | ||
|
||
DocumentElement::~DocumentElement() {} | ||
} // namespace cru::ui::document |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "cru/ui/document/DocumentElementType.h" | ||
|
||
#include <utility> | ||
|
||
namespace cru::ui::document { | ||
DocumentElementType::DocumentElementType(String name) | ||
: name_(std::move(name)) {} | ||
|
||
DocumentElementType::~DocumentElementType() {} | ||
|
||
DocumentElementType* const DocumentElementTypes::kRootElementType = | ||
new DocumentElementType(u"Root"); | ||
} // namespace cru::ui::document |