aboutsummaryrefslogtreecommitdiff
path: root/src/base.h
diff options
context:
space:
mode:
authorYuqian Yang <crupest@outlook.com>2018-10-04 16:52:11 +0000
committerYuqian Yang <crupest@outlook.com>2018-10-04 16:52:11 +0000
commit7e870dd16e2f5b41fa6c6f687723aaa50c16274d (patch)
treebe2b26a42dc9fde97379f98f035113e08e0bc331 /src/base.h
parent30ecda8bb354d5982978af97aa90b5f49d9ea195 (diff)
parentc5384d496e9ed429ca2baa3ca5e586ff255235eb (diff)
downloadcru-7e870dd16e2f5b41fa6c6f687723aaa50c16274d.tar.gz
cru-7e870dd16e2f5b41fa6c6f687723aaa50c16274d.tar.bz2
cru-7e870dd16e2f5b41fa6c6f687723aaa50c16274d.zip
Merge branch '12-layout' into 'master'
Resolve "Add padding, margin, border to Control." Closes #12 See merge request crupest/CruUI!12
Diffstat (limited to 'src/base.h')
-rw-r--r--src/base.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/base.h b/src/base.h
index 18bf9cc5..0a77e5b9 100644
--- a/src/base.h
+++ b/src/base.h
@@ -116,6 +116,9 @@ namespace cru
class PropertyChangedNotifyObject : public Object
{
public:
+ using PropertyChangedHandler = Function<void(const StringView&)>;
+ using PropertyChangedHandlerPtr = FunctionPtr<void(const StringView&)>;
+
PropertyChangedNotifyObject() = default;
PropertyChangedNotifyObject(const PropertyChangedNotifyObject& other) = delete;
PropertyChangedNotifyObject(PropertyChangedNotifyObject&& other) = delete;
@@ -123,14 +126,14 @@ namespace cru
PropertyChangedNotifyObject& operator = (PropertyChangedNotifyObject&& other) = delete;
~PropertyChangedNotifyObject() override = default;
- void AddPropertyChangedListener(FunctionPtr<void(String)> listener);
+ void AddPropertyChangedListener(FunctionPtr<void(const StringView&)> listener);
- void RemovePropertyChangedListener(const FunctionPtr<void(String)>& listener);
+ void RemovePropertyChangedListener(const FunctionPtr<void(const StringView&)>& listener);
protected:
- void RaisePropertyChangedEvent(String property_name);
+ void RaisePropertyChangedEvent(const StringView& property_name);
private:
- std::list<FunctionPtr<void(String)>> listeners_;
+ std::list<FunctionPtr<void(const StringView&)>> listeners_;
};
}