Initialize Tizen 2.3
[framework/web/wrt-plugins-common.git] / src_mobile / plugins-api-support / PluginRegistration.cpp
1 /*
2  * Copyright (c) 2012 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   PluginRegistration.cpp
18  * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
19  */
20
21 #include "PluginRegistration.h"
22
23 #include "PluginRegistrationImpl.h"
24 #include "Plugin.h"
25 #include <dpl/assert.h>
26
27 namespace WrtPluginsApi {
28 PluginRegistration::PluginRegistration(Impl* impl) : m_impl(impl)
29 {
30     Assert(impl != 0 && "impl is NULL");
31 }
32
33 template<typename SignalSignature>
34 void PluginRegistration::Connect(const typename SignalSignature::Type& slot)
35 {
36     m_impl->Connect<SignalSignature>(slot);
37 }
38
39 void PluginRegistration::DisconnectAll()
40 {
41     m_impl->DisconnectAll();
42 }
43
44 void PluginRegistration::AddPlugin(Plugin& plugin)
45 {
46     m_impl->AddPlugin(plugin);
47 }
48
49 #define EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(SignalSignature)               \
50     template void PluginRegistration::Connect<SignalSignature>(            \
51         const typename SignalSignature::Type &)
52
53 EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnWidgetStart);
54 EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnWidgetStop);
55 EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnFrameLoad);
56 EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnFrameUnload);
57 }