1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef META_INTERFACE_SERIALIZATION_IGLOBAL_SERIALISATION_DATA_H 17 #define META_INTERFACE_SERIALIZATION_IGLOBAL_SERIALISATION_DATA_H 18 19 #include <base/containers/unique_ptr.h> 20 #include <core/plugin/intf_interface.h> 21 22 #include <meta/base/interface_macros.h> 23 #include <meta/base/namespace.h> 24 #include <meta/interface/intf_any.h> 25 #include <meta/interface/intf_object.h> 26 #include <meta/interface/serialization/intf_value_serializer.h> 27 28 META_BEGIN_NAMESPACE() 29 30 struct SerializationSettings { 31 /** 32 * @brief Export property default value. 33 */ 34 /** 35 * @brief Do not export native properties which have default value set 36 */ 37 /** 38 * @brief Do not export native properties which value is set the same as the set default value (non-binding) 39 * (user can set the same value as default and this is not considered as default value). 40 */ 41 /** 42 * @brief Do not export native properties which have non-serializable binding set. 43 */ 44 }; 45 46 class IGlobalSerializationData : public CORE_NS::IInterface { 47 META_INTERFACE(CORE_NS::IInterface, IGlobalSerializationData, "f738d4d6-2575-4ae8-bb97-70a23bb6565a") 48 public: 49 virtual SerializationSettings GetDefaultSettings() const = 0; 50 virtual void SetDefaultSettings(const SerializationSettings& settings) = 0; 51 52 virtual void RegisterGlobalObject(const IObject::Ptr& object) = 0; 53 virtual void UnregisterGlobalObject(const IObject::Ptr& object) = 0; 54 virtual IObject::Ptr GetGlobalObject(const InstanceId& id) const = 0; 55 56 virtual void RegisterValueSerializer(const IValueSerializer::Ptr&) = 0; 57 virtual void UnregisterValueSerializer(const TypeId& id) = 0; 58 virtual IValueSerializer::Ptr GetValueSerializer(const TypeId& id) const = 0; 59 }; 60 61 META_INTERFACE_TYPE(META_NS::IGlobalSerializationData) 62 63 META_END_NAMESPACE() 64 65 #endif 66