2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <app_control_internal.h>
19 #include <app_control.h>
22 #include <screen_connector_remote_surface_evas/util.h>
25 #include "watch_holder.hh"
26 #include "bundle_cpp.h"
32 #define LOG_TAG "WATCH_HOLDER"
34 using namespace tizen_base;
36 namespace watch_holder {
38 WatchHolder::~WatchHolder() = default;
40 WatchHolder::WatchHolder(Evas_Object* win) :
41 WatchHolderBase(screen_connector::util::GetWlSurface(win),
42 util::GetWidth(win), util::GetHeight(win)), viewer_win_(win) {
45 std::shared_ptr<WatchBase> WatchHolder::CreateWatch(std::string appid,
47 return make_shared<Watch>(
48 std::move(appid), viewer_win_, this, mock);
51 std::shared_ptr<WatchBase> WatchHolder::CreateWatch(int rid, std::string id,
52 std::string appid, bool mock) {
53 return make_shared<Watch>(rid, std::move(id),
54 std::move(appid), viewer_win_, this, mock);
57 std::shared_ptr<WatchBase> WatchHolder::CreateWatch(std::string appid,
58 tizen_base::Bundle extra, bool mock) {
59 return make_shared<Watch>(std::move(appid), viewer_win_, std::move(extra),
63 std::shared_ptr<WatchBase> WatchHolder::CreateWatch(int rid, std::string id,
64 std::string appid, tizen_base::Bundle extra, bool mock) {
65 return make_shared<Watch>(rid, std::move(id), std::move(appid),
66 viewer_win_, std::move(extra), this, mock);
69 shared_ptr<Watch> WatchHolder::Cast(shared_ptr<WatchBase> watch) {
70 return dynamic_pointer_cast<Watch>(watch);
73 const Watch& WatchHolder::Cast(const WatchBase& watch) {
74 return dynamic_cast<const Watch&>(watch);
78 } // namespace watch_holder