• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 OHOS_AAFWK_UI_SERVICE_MANAGER_PROXY_H
17 #define OHOS_AAFWK_UI_SERVICE_MANAGER_PROXY_H
18 
19 #include "hilog_wrapper.h"
20 #include "iremote_proxy.h"
21 #include "ui_service_mgr_interface.h"
22 
23 namespace OHOS {
24 namespace Ace {
25 /**
26  * @class UIServiceMgrProxy
27  * UIServiceMgrProxy.
28  */
29 class UIServiceMgrProxy : public IRemoteProxy<IUIServiceMgr> {
30 public:
UIServiceMgrProxy(const sptr<IRemoteObject> & impl)31     explicit UIServiceMgrProxy(const sptr<IRemoteObject>& impl) : IRemoteProxy<IUIServiceMgr>(impl)
32     {}
~UIServiceMgrProxy()33     virtual ~UIServiceMgrProxy()
34     {}
35     virtual int RegisterCallBack(const AAFwk::Want& want, const sptr<IUIService>& uiService);
36 
37     virtual int UnregisterCallBack(const AAFwk::Want& want);
38 
39     virtual int Push(const AAFwk::Want& want, const std::string& name, const std::string& jsonPath,
40         const std::string& data, const std::string& extraData);
41 
42     virtual int Request(const AAFwk::Want& want, const std::string& name, const std::string& data);
43 
44     virtual int ReturnRequest(const AAFwk::Want& want, const std::string& source, const std::string& data,
45         const std::string& extraData);
46 
47     virtual int ShowDialog(const std::string& name,
48                            const std::string& params,
49                            OHOS::Rosen::WindowType windowType,
50                            int x,
51                            int y,
52                            int width,
53                            int height,
54                            const sptr<OHOS::Ace::IDialogCallback>& dialogCallback,
55                            int* id = nullptr);
56 
57     virtual int CancelDialog(int id);
58 
59 private:
60     bool WriteInterfaceToken(MessageParcel& data);
61 
62 private:
63     static inline BrokerDelegator<UIServiceMgrProxy> delegator_;
64 };
65 }  // namespace Ace
66 }  // namespace OHOS
67 #endif  // OHOS_AAFWK_UI_SERVICE_MANAGER_PROXY_H
68