Tizen 2.1 base
[platform/framework/web/wrt-plugins-common.git] / src / 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 {
29
30 PluginRegistration::PluginRegistration(Impl* impl) : m_impl(impl)
31 {
32     Assert(impl != 0 && "impl is NULL");
33 }
34
35 template<typename SignalSignature>
36 void PluginRegistration::Connect(const typename SignalSignature::Type& slot)
37 {
38     m_impl->Connect<SignalSignature>(slot);
39 }
40
41 void PluginRegistration::DisconnectAll()
42 {
43     m_impl->DisconnectAll();
44 }
45
46 void PluginRegistration::AddPlugin(Plugin& plugin)
47 {
48     m_impl->AddPlugin(plugin);
49 }
50
51 #define EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(SignalSignature)               \
52         template void PluginRegistration::Connect<SignalSignature>(            \
53                 const typename SignalSignature::Type&)
54
55 EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnWidgetStart);
56 EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnWidgetStop);
57 EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnFrameLoad);
58 EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnFrameUnload);
59
60 }