change the name of Plugin header files accepted/tizen/unified/20200715.115516 submit/tizen/20200715.082746
authorYoungjae Shin <yj99.shin@samsung.com>
Mon, 6 Jul 2020 08:49:02 +0000 (17:49 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Wed, 15 Jul 2020 08:26:35 +0000 (17:26 +0900)
Plugin.h => ModesPlugin.h
PluginAction.h => ModesPIAction.h

Change-Id: I55765297f2a4f932a75f3405f9e40610057f87db

include/ModesPIAction.h [new file with mode: 0644]
include/ModesPlugin.h [new file with mode: 0644]
include/Plugin.h [deleted file]
include/PluginAction.h [deleted file]
packaging/modes.spec
plugin/TestPlugin.cpp
plugin/TestPluginAction.h
supervisor/Action.h
supervisor/ActionRule.h
supervisor/PluginMapper.h
tests/modes_test_policy.cpp

diff --git a/include/ModesPIAction.h b/include/ModesPIAction.h
new file mode 100644 (file)
index 0000000..d31ca33
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * 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;
+       };
+}
diff --git a/include/ModesPlugin.h b/include/ModesPlugin.h
new file mode 100644 (file)
index 0000000..3a4c2ed
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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*);
+}
diff --git a/include/Plugin.h b/include/Plugin.h
deleted file mode 100644 (file)
index 65378a0..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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*);
-}
diff --git a/include/PluginAction.h b/include/PluginAction.h
deleted file mode 100644 (file)
index d31ca33..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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;
-       };
-}
index ae2815af7dcd5c51b216f896f93f883cffd234ea..863fcaca420916fb2cc27f7ea87a2f4e6e106d9a 100644 (file)
@@ -62,7 +62,7 @@ Summary: Test Programs for %{name}
 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
@@ -178,7 +178,7 @@ systemctl try-restart %{name}.service
 %{_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
 
index 2278527e80c92c8ccd71d6015a3ef76eac8db357..37a4586fac66fc94c6d6f0bac07b5a230f5a019c 100644 (file)
@@ -14,8 +14,8 @@
  * 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"
index fb94e1b1a6978fc13f629270402664febe519bf2..54996151bd6da0187e3f5c423664ec306cdc276b 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <glib.h>
 #include <string>
-#include "PluginAction.h"
+#include "ModesPIAction.h"
 #include "common/definitions.h"
 
 MODES_NAMESPACE_BEGIN
index 2eeb4a35c3627ac7d3596f0c12db47023a76e6c7..ef0e66f8a4cc21142753664f7eba70bbee460df0 100644 (file)
@@ -20,7 +20,7 @@
 #include <string>
 #include <memory>
 #include "mdss.h"
-#include "PluginAction.h"
+#include "ModesPIAction.h"
 #include "ActionObserver.h"
 
 MODES_NAMESPACE_BEGIN
index c912f6747967640c54a49ce3175ec85687fe7684..e6a1dc696842b912732ff0f813c568f489beb895 100644 (file)
@@ -18,7 +18,7 @@
 #include <list>
 #include <string>
 #include "mdss.h"
-#include "Plugin.h"
+#include "ModesPlugin.h"
 #include "Action.h"
 
 MODES_NAMESPACE_BEGIN
index 5226a9a352082f580f8216d52426f3db8a058c65..6917a933db253a92227af3a1c0f3d1566e7fd610 100644 (file)
@@ -21,7 +21,7 @@
 #include <utility>
 #include <unordered_map>
 #include "mdss.h"
-#include "Plugin.h"
+#include "ModesPlugin.h"
 
 MODES_NAMESPACE_BEGIN
 
index fa6c19083319bd2362677cd204c08b4bb8d613b6..adbf2a74d5bff7738b5b2dd0da40854be22c4b20 100644 (file)
@@ -15,7 +15,7 @@
  */
 #include <functional>
 #include <gtest/gtest.h>
-#include "Plugin.h"
+#include "ModesPlugin.h"
 #include "supervisor/ModesEx.h"
 #include "supervisor/TAction.h"