1 /*
2  * Copyright (c) 2023 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 #ifndef UDMF_UTD_TYPE
16 #define UDMF_UTD_TYPE
17 #include <string>
18 #include <set>
19 #include <vector>
20 #include "error_code.h"
21 
22 namespace OHOS {
23 namespace UDMF {
24 struct TypeDescriptorCfg;
25 using CustomUtdCfgs = std::pair<std::vector<TypeDescriptorCfg>, std::vector<TypeDescriptorCfg>>;
26 struct TypeDescriptorCfg {
27     std::string typeId;
28     std::vector<std::string> belongingToTypes;
29     std::vector<std::string> filenameExtensions;
30     std::vector<std::string> mimeTypes;
31     std::string description;
32     std::string referenceURL;
33     std::string iconFile;
34     std::string ownerBundle;
35     std::set<std::string> installerBundles;
36 
37     bool operator==(const TypeDescriptorCfg &typeDescriptor) const
38     {
39         return typeDescriptor.typeId == typeId;
40     }
41 };
42 
43 // UTD data category
44 constexpr const char* UTD_CUSTOM_DECLAEEARION = "UniformDataTypeDeclarations";
45 constexpr const char* UTD_CUSTOM_REFERENCE = "ReferenceUniformDataTypeDeclarations";
46 
47 constexpr const char* UTD_CUSTOM = "CustomUTDs";
48 
49 constexpr const char* DEFAULT_TYPE_ID = "#default";
50 
51 constexpr const int32_t DEFAULT_USER_ID = 100;
52 } // namespace UDMF
53 } // namespace OHOS
54 #endif // UDMF_UTD_TYPE
55