• 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 PASTE_BOARD_SERVICE_INTERFACE_H
17 #define PASTE_BOARD_SERVICE_INTERFACE_H
18 
19 #include "i_entity_recognition_observer.h"
20 #include "i_pasteboard_delay_getter.h"
21 #include "i_pasteboard_entry_getter.h"
22 #include "i_pasteboard_observer.h"
23 #include "pasteboard_pattern.h"
24 
25 namespace OHOS {
26 namespace MiscServices {
27 class IPasteboardService : public IRemoteBroker {
28 public:
29     virtual void Clear() = 0;
30     virtual int32_t GetRecordValueByType(uint32_t dataId, uint32_t recordId, PasteDataEntry &value) = 0;
31     virtual int32_t GetPasteData(PasteData &data, int32_t &syncTime) = 0;
32     virtual bool HasPasteData() = 0;
33     virtual int32_t SetPasteData(PasteData &pasteData, const sptr<IPasteboardDelayGetter> delayGetter = nullptr,
34         const sptr<IPasteboardEntryGetter> entryGetter = nullptr) = 0;
35     virtual bool IsRemoteData() = 0;
36     virtual int32_t GetChangeCount(uint32_t &changeCount) = 0;
37     virtual int32_t GetDataSource(std::string &bundleName) = 0;
38     virtual int32_t SubscribeEntityObserver(
39         EntityType entityType, uint32_t expectedDataLength, const sptr<IEntityRecognitionObserver> &observer) = 0;
40     virtual int32_t UnsubscribeEntityObserver(
41         EntityType entityType, uint32_t expectedDataLength, const sptr<IEntityRecognitionObserver> &observer) = 0;
42     virtual std::vector<std::string> GetMimeTypes() = 0;
43     virtual bool HasDataType(const std::string &mimeType) = 0;
44     virtual std::set<Pattern> DetectPatterns(const std::set<Pattern> &patternsToCheck) = 0;
45     virtual void SubscribeObserver(PasteboardObserverType type, const sptr<IPasteboardChangedObserver> &observer) = 0;
46     virtual void UnsubscribeObserver(PasteboardObserverType type, const sptr<IPasteboardChangedObserver> &observer) = 0;
47     virtual void UnsubscribeAllObserver(PasteboardObserverType type) = 0;
48     virtual int32_t SetGlobalShareOption(const std::map<uint32_t, ShareOption> &globalShareOptions) = 0;
49     virtual int32_t RemoveGlobalShareOption(const std::vector<uint32_t> &tokenIds) = 0;
50     virtual std::map<uint32_t, ShareOption> GetGlobalShareOption(const std::vector<uint32_t> &tokenIds) = 0;
51     virtual int32_t SetAppShareOptions(const ShareOption &shareOptions) = 0;
52     virtual int32_t RemoveAppShareOptions() = 0;
53     virtual void PasteStart(const std::string &pasteId) = 0;
54     virtual void PasteComplete(const std::string &deviceId, const std::string &pasteId) = 0;
55     virtual int32_t GetRemoteDeviceName(std::string &deviceName, bool &isRemote) = 0;
56     virtual void ShowProgress(const std::string &progressKey, const sptr<IRemoteObject> &observer) = 0;
57     virtual int32_t RegisterClientDeathObserver(sptr<IRemoteObject> observer) = 0;
58     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.pasteboard.IPasteboardService");
59 };
60 } // namespace MiscServices
61 } // namespace OHOS
62 #endif // PASTE_BOARD_SERVICE_INTERFACE_H