• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 GENERAL_CONTROLLER_SERVICE_IMPL_H
17 #define GENERAL_CONTROLLER_SERVICE_IMPL_H
18 
19 #include "data_share_manager_impl.h"
20 #include "general_controller.h"
21 
22 namespace OHOS {
23 namespace AAFwk {
24 class IDataAbilityObserver;
25 }
26 
27 namespace DataShare {
28 class GeneralControllerServiceImpl : public GeneralController {
29 public:
30     GeneralControllerServiceImpl() = default;
31 
32     virtual ~GeneralControllerServiceImpl() = default;
33 
34     int Insert(const Uri &uri, const DataShareValuesBucket &value) override;
35 
36     int Update(const Uri &uri, const DataSharePredicates &predicates, const DataShareValuesBucket &value) override;
37 
38     int Delete(const Uri &uri, const DataSharePredicates &predicates) override;
39 
40     std::shared_ptr<DataShareResultSet> Query(const Uri &uri, const DataSharePredicates &predicates,
41         std::vector<std::string> &columns, DatashareBusinessError &businessError) override;
42 
43     void RegisterObserver(const Uri &uri, const sptr<AAFwk::IDataAbilityObserver> &dataObserver) override;
44 
45     void UnregisterObserver(const Uri &uri, const sptr<AAFwk::IDataAbilityObserver> &dataObserver) override;
46 
47     void NotifyChange(const Uri &uri) override;
48 };
49 } // namespace DataShare
50 } // namespace OHOS
51 #endif // GENERAL_CONTROLLER_SERVICE_IMPL_H
52