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 
16 #ifndef I_FILE_ACCESS_SERVICE_BASE_H
17 #define I_FILE_ACCESS_SERVICE_BASE_H
18 
19 #include "ability_connect_callback_interface.h"
20 #include "file_access_helper.h"
21 #include "iremote_broker.h"
22 #include "iremote_object.h"
23 #include "iobserver_callback.h"
24 #include "uri.h"
25 
26 namespace OHOS {
27 namespace FileAccessFwk {
28 using Uri = OHOS::Uri;
29 class IFileAccessServiceBase : public IRemoteBroker {
30 public:
31     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.FileAccessFwk.IFileAccessServiceBase");
32 
33 protected:
34     virtual int32_t OnChange(Uri uri, NotifyType notifyType) = 0;
35     virtual int32_t RegisterNotify(Uri uri, bool notifyForDescendants, const sptr<IFileAccessObserver> &observer,
36         const std::shared_ptr<ConnectExtensionInfo> &info) = 0;
37     virtual int32_t UnregisterNotify(Uri uri, const sptr<IFileAccessObserver> &observer,
38         const std::shared_ptr<ConnectExtensionInfo> &info) = 0;
39     //Get exension proxy by SA
40     virtual int32_t GetExtensionProxy(const std::shared_ptr<ConnectExtensionInfo> &info,
41         sptr<IFileAccessExtBase> &extensionProxy) = 0;
42     virtual int32_t ConnectFileExtAbility(const AAFwk::Want &want,
43         const sptr<AAFwk::IAbilityConnection>& connection) = 0;
44     virtual int32_t DisConnectFileExtAbility(const sptr<AAFwk::IAbilityConnection>& connection) = 0;
45 };
46 } // namespace FileAccessFwk
47 } // namespace OHOS
48 #endif // I_FILE_ACCESS_SERVICE_BASE_H
49