7#ifndef MYGUI_WIDGET_USER_DATA_H_
8#define MYGUI_WIDGET_USER_DATA_H_
21 virtual ~UserData() =
default;
24 void setUserString(std::string_view _key, std::string_view _value);
27 std::string_view getUserString(std::string_view _key)
const;
33 bool clearUserString(std::string_view _key);
36 bool isUserString(std::string_view _key)
const;
39 void clearUserStrings();
42 void setUserData(Any _data);
45 template<
typename ValueType>
46 ValueType* getUserData(
bool _throw =
true)
48 return mUserData.castType<ValueType>(_throw);
51 template<
typename ValueType>
52 const ValueType* getUserData(
bool _throw =
true)
const
54 return mUserData.castType<ValueType>(_throw);
58 void _setInternalData(Any _data);
60 template<
typename ValueType>
61 ValueType* _getInternalData(
bool _throw =
true)
63 return mInternalData.castType<ValueType>(_throw);
66 template<
typename ValueType>
67 const ValueType* _getInternalData(
bool _throw =
true)
const
69 return mInternalData.castType<ValueType>(_throw);
std::map< std::string, std::string, std::less<> > MapString