Implements WatchBase
[platform/core/appfw/widget-viewer.git] / watch-holder / src / watch_holder.hh
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __WATCH_HOLDER_WATCH_HOLDER_HH__
18 #define __WATCH_HOLDER_WATCH_HOLDER_HH__
19
20 #include <string>
21 #include <list>
22 #include <map>
23 #include <memory>
24
25 #include <Evas.h>
26 #include <bundle.h>
27 #include <bundle_cpp.h>
28 #include <aul_app_com.h>
29
30 #include "watch_holder_base.hh"
31 #include "watch.hh"
32 #include "ambient_listener.hh"
33
34 namespace watch_holder {
35
36 class EXPORT_API WatchHolder : public WatchHolderBase {
37  public:
38   WatchHolder(Evas_Object* win);
39   virtual ~WatchHolder();
40
41   std::shared_ptr<Watch> Cast(std::shared_ptr<WatchBase> w_base);
42   const Watch& Cast(const WatchBase& w_base);
43
44  protected:
45   std::shared_ptr<WatchBase> CreateWatch(std::string appid,
46       bool mock = false) override;
47   std::shared_ptr<WatchBase> CreateWatch(int rid, std::string id,
48     std::string appid, bool mock = false) override;
49   std::shared_ptr<WatchBase> CreateWatch(std::string appid,
50     tizen_base::Bundle extra, bool mock = false) override;
51   std::shared_ptr<WatchBase> CreateWatch(int rid, std::string id,
52     std::string appid, tizen_base::Bundle extra, bool mock = false) override;
53
54  private:
55   Evas_Object* viewer_win_;
56 };
57
58 }  // namespace watch_holder
59
60 #endif  // __WATCH_HOLDER_WATCH_HOLDER_HH__
61