2 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include "notification-ex/app_control_action.h"
22 #include "notification-ex/visibility_action.h"
23 #include "notification-ex/default_action_factory.h"
24 #include "notification-ex/exception.h"
30 #define LOG_TAG "NOTIFICATION_EX"
33 namespace notification {
36 unique_ptr<AbstractAction> DefaultActionFactory::CreateAction(int type) {
38 case AbstractAction::NullObject :
39 THROW(ERROR_INVALID_PARAMETER);
40 case AbstractAction::AppControl :
41 app_control_h control;
42 app_control_create(&control);
43 return unique_ptr<AbstractAction>(new AppControlAction(control));
44 case AbstractAction::Visibility :
45 return unique_ptr<AbstractAction>(new VisibilityAction());
46 case AbstractAction::Custom :
54 } // namespace notification