[Release] wrt_0.8.274
[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::FastDelegate2<Evas_Object*, bool, void> EnterFullscreenCB;
48 typedef DPL::FastDelegate1<Evas_Object*, void> ExitFullscreenCB;
49 typedef DPL::FastDelegate1<bool, void> EditorclientImeCB;
50 typedef DPL::FastDelegate1<int, void> OrientationCB;
51 typedef DPL::FastDelegate1<const std::string&, void> HWkeyCB;
52
53 struct UserDelegates {
54     ProgressStartedCB progressStarted;
55     ProgressCB progress;
56     ProgressFinishCB progressFinish;
57     LoadStartCB loadStart;
58     LoadFinishCB loadFinish;
59     WebCrashCB webCrash;
60     WindowCreateBeforeCB windowCreateBefore;
61     WindowCreateAfterCB windowCreateAfter;
62     WindowCloseCB windowClose;
63     NavigationDecideCB navigationDecide;
64     WebkitExitCB webkitExit;
65     ResumeCB resume;
66     SuspendCB suspend;
67     ResetCB reset;
68     BufferUnsetCB bufferUnset;
69     BufferSetCB bufferSet;
70     EnterFullscreenCB enterFullscreen;
71     ExitFullscreenCB exitFullscreen;
72     OrientationCB setOrientation;
73     HWkeyCB hwkey;
74 };
75
76 typedef std::shared_ptr<UserDelegates> UserDelegatesPtr;
77 typedef std::shared_ptr<WidgetModel> WidgetModelPtr;
78 }
79
80 #endif // USER_DELEGATES_H