5112ad7a8a020c37d151eeaf0430fab1ecd36750
[platform/framework/web/wrt.git] / src / api_new / user_delegates.h
1 /*
2  * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
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  * @file        user_delegates.h
18  * @author      Tomasz Iwanek (t.iwanek@samsung.com)
19  * @brief       user delegates
20  */
21 #ifndef USER_DELEGATES_H
22 #define USER_DELEGATES_H
23
24 #include <dpl/fast_delegate.h>
25 #include <widget_model.h>
26 #include <memory>
27 #include <string>
28 #include <Evas.h>
29
30 namespace WRT {
31 typedef DPL::FastDelegate0<void> ProgressStartedCB;
32 typedef DPL::FastDelegate2<Evas_Object*, double, void> ProgressCB;
33 typedef DPL::FastDelegate0<void> ProgressFinishCB;
34 typedef DPL::FastDelegate1<Evas_Object*, void> LoadStartCB;
35 typedef DPL::FastDelegate1<Evas_Object*, void> LoadFinishCB;
36 typedef DPL::FastDelegate0<void> WebCrashCB;
37 typedef DPL::FastDelegate2<Evas**, Evas_Object*, void> WindowCreateBeforeCB;
38 typedef DPL::FastDelegate2<Evas_Object*, Evas_Object*, void> WindowCreateAfterCB;
39 typedef DPL::FastDelegate1<Evas_Object*, void> WindowCloseCB;
40 typedef DPL::FastDelegate2<Evas_Object*, std::string&, void> NavigationDecideCB;
41 typedef DPL::FastDelegate0<void> WebkitExitCB;
42 typedef DPL::FastDelegate1<bool, void> ResumeCB;
43 typedef DPL::FastDelegate1<bool, void> SuspendCB;
44 typedef DPL::FastDelegate1<bool, void> ResetCB;
45 typedef DPL::FastDelegate1<Evas_Object*, void> BufferUnsetCB;
46 typedef DPL::FastDelegate1<Evas_Object*, void> BufferSetCB;
47 typedef DPL::FastDelegate1<bool, void> ToggleFullscreenCB;
48 typedef DPL::FastDelegate1<bool, void> EditorclientImeCB;
49 typedef DPL::FastDelegate1<int, void> OrientationCB;
50 typedef DPL::FastDelegate1<const std::string&, void> HWkeyCB;
51
52 struct UserDelegates {
53     ProgressStartedCB progressStarted;
54     ProgressCB progress;
55     ProgressFinishCB progressFinish;
56     LoadStartCB loadStart;
57     LoadFinishCB loadFinish;
58     WebCrashCB webCrash;
59     WindowCreateBeforeCB windowCreateBefore;
60     WindowCreateAfterCB windowCreateAfter;
61     WindowCloseCB windowClose;
62     NavigationDecideCB navigationDecide;
63     WebkitExitCB webkitExit;
64     ResumeCB resume;
65     SuspendCB suspend;
66     ResetCB reset;
67     BufferUnsetCB bufferUnset;
68     BufferSetCB bufferSet;
69     ToggleFullscreenCB toggleFullscreen;
70     OrientationCB setOrientation;
71     HWkeyCB hwkey;
72 };
73
74 typedef std::shared_ptr<UserDelegates> UserDelegatesPtr;
75 typedef std::shared_ptr<WidgetModel> WidgetModelPtr;
76 }
77
78 #endif // USER_DELEGATES_H