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.
17 #ifndef WATCH_HOLDER_BASE_SRC_WATCH_MIRROR_BASE_HH_
18 #define WATCH_HOLDER_BASE_SRC_WATCH_MIRROR_BASE_HH_
25 #include <app_control.h>
26 #include <aul_app_com.h>
28 #include <screen_connector_remote_surface/handle.h>
31 #include "watch_base.hh"
32 #include "ambient_listener.hh"
34 namespace watch_holder {
36 class EXPORT_API WatchMirrorBase : public WatchBase::IEvent, public AmbientListener {
38 WatchMirrorBase(std::shared_ptr<screen_connector::WlSurface> surface);
39 virtual ~WatchMirrorBase() = 0;
41 std::shared_ptr<ISharableWatchBase> GetCurrent() const;
42 virtual void OnChanged(const ISharableWatchBase& watch);
43 virtual void OnAdded(const ISharableWatchBase& watch);
44 virtual void OnUpdated(const ISharableWatchBase& watch);
45 virtual void OnRemoved(const ISharableWatchBase& watch);
46 void OnAmbientChanged(bool enter,
47 const tizen_base::Bundle& extra) override;
48 void OnAmbientEvent(EventType ev, std::string sender,
49 tizen_base::Bundle extra) override;
50 void AddWatch(std::shared_ptr<WatchBase> watch);
53 std::string GetUUID(std::string rid) const;
54 void OnAdded(const WatchBase& watch) final;
55 void OnUpdated(const WatchBase& watch) final;
56 void OnRemoved(const WatchBase& watch) final;
57 void OnBound(const WatchBase& watch) final;
58 virtual void OnChanged(int, std::string inst_id, std::string appid);
59 static void OnChangedSignal(keynode_t *node, void *user_data);
62 virtual std::shared_ptr<WatchBase> CreateWatch(int rid, std::string id,
63 std::string appid, bool mock = false) = 0;
64 virtual std::shared_ptr<WatchBase> CreateWatch(int rid, std::string id,
65 std::string appid, tizen_base::Bundle extra, bool mock = false) = 0;
69 aul_app_com_connection_h watch_changed_conn_ = nullptr;
70 std::list<std::shared_ptr<WatchBase>> stack_;
73 } // namespace watch_holder
75 #endif // WATCH_HOLDER_BASE_SRC_WATCH_MIRROR_BASE_HH_