--- /dev/null
+/*
+ * Copyright (c) 2019-2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <string>
+#include <modes_errors.h>
+
+namespace ModeSupervisorNamespace {
+
+ typedef void (*valueChangedCB)(void *userData);
+
+ class PluginAction {
+ public:
+ PluginAction(const std::string &actionKey)
+ : key(actionKey)
+ {
+ }
+ virtual ~PluginAction() = default;
+
+ std::string getKey()
+ {
+ return key;
+ }
+
+ //If it is true, the Action is ignored.
+ //It is possible to get the old value in this procedure
+ //because the set() is immediately called after this function
+ virtual bool IsCurrentValue(int val)
+ {
+ return false;
+ }
+ virtual bool IsCurrentValue(double val)
+ {
+ return false;
+ }
+ virtual bool IsCurrentValue(bool val)
+ {
+ return false;
+ }
+ virtual bool IsCurrentValue(const std::string &val)
+ {
+ return false;
+ }
+
+ virtual int set(int val)
+ {
+ return MODES_ERROR_NOT_SUPPORTED;
+ }
+ virtual int set(double val)
+ {
+ return MODES_ERROR_NOT_SUPPORTED;
+ }
+ virtual int set(bool val)
+ {
+ return MODES_ERROR_NOT_SUPPORTED;
+ }
+ virtual int set(const std::string &val)
+ {
+ return MODES_ERROR_NOT_SUPPORTED;
+ }
+
+ virtual void undo()
+ {
+ }
+ virtual std::string getUndoInfo()
+ {
+ return std::string();
+ }
+ virtual int setUndoInfo(const std::string &info)
+ {
+ return MODES_ERROR_NOT_SUPPORTED;
+ }
+ virtual int setChangedCallback(valueChangedCB callback, void *userData)
+ {
+ // The callback should be called when the value is changed(Not Same).
+ return MODES_ERROR_NOT_SUPPORTED;
+ }
+ virtual void unSetChangedCallback(valueChangedCB callback)
+ {
+ }
+ protected:
+ const std::string key;
+ };
+}
--- /dev/null
+/*
+ * Copyright (c) 2019-2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <string>
+#include <modes_errors.h>
+#include <ModesPIAction.h>
+
+namespace ModeSupervisorNamespace {
+
+ class Plugin {
+ public:
+ Plugin() = default;
+ virtual ~Plugin() = default;
+
+ void setName(const std::string &pluginName)
+ {
+ name = pluginName;
+ }
+
+ std::string getName()
+ {
+ return name;
+ }
+
+ //It should returns dynamic allocated instance of PluginAction
+ virtual PluginAction* newAction(const std::string &key) = 0;
+
+ //Using destructor of PluginAction without overriding is recommended
+ virtual void deleteAction(PluginAction *piAction)
+ {
+ //release resources of piAction
+ delete piAction;
+ }
+ private:
+ std::string name;
+ };
+
+ typedef Plugin* (*createFunc)(void);
+ typedef void (*destroyFunc)(Plugin*);
+}
+++ /dev/null
-/*
- * Copyright (c) 2019-2020 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#pragma once
-
-#include <string>
-#include <modes_errors.h>
-#include <PluginAction.h>
-
-namespace ModeSupervisorNamespace {
-
- class Plugin {
- public:
- Plugin() = default;
- virtual ~Plugin() = default;
-
- void setName(const std::string &pluginName)
- {
- name = pluginName;
- }
-
- std::string getName()
- {
- return name;
- }
-
- //It should returns dynamic allocated instance of PluginAction
- virtual PluginAction* newAction(const std::string &key) = 0;
-
- //Using destructor of PluginAction without overriding is recommended
- virtual void deleteAction(PluginAction *piAction)
- {
- //release resources of piAction
- delete piAction;
- }
- private:
- std::string name;
- };
-
- typedef Plugin* (*createFunc)(void);
- typedef void (*destroyFunc)(Plugin*);
-}
+++ /dev/null
-/*
- * Copyright (c) 2019-2020 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#pragma once
-
-#include <string>
-#include <modes_errors.h>
-
-namespace ModeSupervisorNamespace {
-
- typedef void (*valueChangedCB)(void *userData);
-
- class PluginAction {
- public:
- PluginAction(const std::string &actionKey)
- : key(actionKey)
- {
- }
- virtual ~PluginAction() = default;
-
- std::string getKey()
- {
- return key;
- }
-
- //If it is true, the Action is ignored.
- //It is possible to get the old value in this procedure
- //because the set() is immediately called after this function
- virtual bool IsCurrentValue(int val)
- {
- return false;
- }
- virtual bool IsCurrentValue(double val)
- {
- return false;
- }
- virtual bool IsCurrentValue(bool val)
- {
- return false;
- }
- virtual bool IsCurrentValue(const std::string &val)
- {
- return false;
- }
-
- virtual int set(int val)
- {
- return MODES_ERROR_NOT_SUPPORTED;
- }
- virtual int set(double val)
- {
- return MODES_ERROR_NOT_SUPPORTED;
- }
- virtual int set(bool val)
- {
- return MODES_ERROR_NOT_SUPPORTED;
- }
- virtual int set(const std::string &val)
- {
- return MODES_ERROR_NOT_SUPPORTED;
- }
-
- virtual void undo()
- {
- }
- virtual std::string getUndoInfo()
- {
- return std::string();
- }
- virtual int setUndoInfo(const std::string &info)
- {
- return MODES_ERROR_NOT_SUPPORTED;
- }
- virtual int setChangedCallback(valueChangedCB callback, void *userData)
- {
- // The callback should be called when the value is changed(Not Same).
- return MODES_ERROR_NOT_SUPPORTED;
- }
- virtual void unSetChangedCallback(valueChangedCB callback)
- {
- }
- protected:
- const std::string key;
- };
-}
Group: System/Testing
%description unittests
-The %{name}-unittests pacakge contains programs for checking quality the %{name}.
+The %{name}-unittests package contains programs for checking quality the %{name}.
%if 0%{?gcov:1}
%package gcov
%{_includedir}/%{name}/modes*.h
%files plugin-devel
-%{_includedir}/%{name}/Plugin*.h
+%{_includedir}/%{name}/ModesP*.h
%{_datadir}/%{name}/schema/tizen_action_rule.xsd
%{_datadir}/%{name}/schema/tizen_modes_base.xsd
* limitations under the License.
*/
#include "modes_errors.h"
-#include "Plugin.h"
-#include "PluginAction.h"
+#include "ModesPlugin.h"
+#include "ModesPIAction.h"
#include "common/log.h"
#include "common/definitions.h"
#include "TestPluginAction.h"
#include <glib.h>
#include <string>
-#include "PluginAction.h"
+#include "ModesPIAction.h"
#include "common/definitions.h"
MODES_NAMESPACE_BEGIN
#include <string>
#include <memory>
#include "mdss.h"
-#include "PluginAction.h"
+#include "ModesPIAction.h"
#include "ActionObserver.h"
MODES_NAMESPACE_BEGIN
#include <list>
#include <string>
#include "mdss.h"
-#include "Plugin.h"
+#include "ModesPlugin.h"
#include "Action.h"
MODES_NAMESPACE_BEGIN
#include <utility>
#include <unordered_map>
#include "mdss.h"
-#include "Plugin.h"
+#include "ModesPlugin.h"
MODES_NAMESPACE_BEGIN
*/
#include <functional>
#include <gtest/gtest.h>
-#include "Plugin.h"
+#include "ModesPlugin.h"
#include "supervisor/ModesEx.h"
#include "supervisor/TAction.h"