• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 UDMF_TYPE_DESCRIPTOR_IMPL_H
17 #define UDMF_TYPE_DESCRIPTOR_IMPL_H
18 
19 #include <memory>
20 
21 #include "type_descriptor.h"
22 #include "cj_common_ffi.h"
23 #include "udmf_log.h"
24 
25 namespace OHOS {
26 namespace UDMF {
27     using namespace OHOS::UDMF;
28 
29     class CTypeDescriptor : public OHOS::FFI::FFIData {
30         DECL_TYPE(CTypeDescriptor, OHOS::FFI::FFIData)
31         public:
32             CTypeDescriptor(std::shared_ptr<UDMF::TypeDescriptor> typeDescriptor);
33 
34             char *GetTypeId();
35             CArrString GetBelongingToTypes();
36             char *GetDescription();
37             char *GetIconFile();
38             char *GetReferenceURL();
39             CArrString GetFilenameExtensions();
40             CArrString GetMimeTypes();
41 
42             bool BelongsTo(const char *type);
43             bool IsLowerLevelType(const char *type);
44             bool IsHigherLevelType(const char *type);
45             bool Equals(CTypeDescriptor* thatCTypeDescriptor);
46 
47             const std::shared_ptr<UDMF::TypeDescriptor> &GetTypeDescriptor() const;
48 
49         private:
50             std::shared_ptr<UDMF::TypeDescriptor> typeDescriptor_;
51     };
52 
53 }
54 } // namespace OHOS::UDMF
55 
56 #endif