Remove Model2 from lib-apps-common 48/114148/2
authorAleksandr Sapozhnik <a.sapozhnik@samsung.com>
Fri, 10 Feb 2017 07:05:23 +0000 (09:05 +0200)
committerAleksandr Sapozhnik <a.sapozhnik@samsung.com>
Fri, 10 Feb 2017 07:28:45 +0000 (09:28 +0200)
Change-Id: I29efdda167c8b347d51044908128842f7b8cb487
Signed-off-by: Aleksandr Sapozhnik <a.sapozhnik@samsung.com>
lib-apps-common/inc/Model2/DataItem.h [deleted file]
lib-apps-common/inc/Model2/DataProvider.h [deleted file]
lib-logs/inc/Logs/Model/DataItem.h [new file with mode: 0644]
lib-logs/inc/Logs/Model/DataProvider.h [new file with mode: 0644]
lib-logs/inc/Logs/Model/Log.h
lib-logs/inc/Logs/Model/LogProvider.h
lib-logs/src/Logs/Model/DataItem.cpp [moved from lib-apps-common/src/Model2/DataItem.cpp with 94% similarity]
lib-logs/src/Logs/Model/DataProvider.cpp [moved from lib-apps-common/src/Model2/DataProvider.cpp with 95% similarity]

diff --git a/lib-apps-common/inc/Model2/DataItem.h b/lib-apps-common/inc/Model2/DataItem.h
deleted file mode 100644 (file)
index e45bfde..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2016 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * 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.
- */
-
-#ifndef MODEL2_DATA_ITEM_H
-#define MODEL2_DATA_ITEM_H
-
-#include <functional>
-#include <tizen.h>
-
-namespace Model2
-{
-       class EXPORT_API DataItem
-       {
-       public:
-               /**
-                * @brief Change callback
-                * @param[in] Changed info
-                */
-               typedef std::function<void(int)> UpdateCallback;
-
-               /**
-                * @brief Delete callback
-                */
-               typedef std::function<void()> DeleteCallback;
-
-               virtual ~DataItem() { }
-
-               /**
-                * @brief Set update callback
-                * @param[in]   callback    Update callback
-                */
-               void setUpdateCallback(UpdateCallback callback);
-
-               /**
-                * @brief Unset update callback
-                */
-               void unsetUpdateCallback();
-
-               /**
-                * @brief Set delete callback
-                * @param[in]   callback    Delete callback
-                */
-               void setDeleteCallback(DeleteCallback callback);
-
-               /**
-                * @brief Unset delete callback
-                */
-               void unsetDeleteCallback();
-
-       protected:
-               /**
-                * @brief ContactData updated callback
-                * @param[in]   changes     Changed info
-                */
-               void onUpdated(int changes);
-
-               /**
-                * @brief ContactData deleted callback
-                */
-               void onDeleted();
-
-       private:
-               UpdateCallback m_OnUpdated;
-               DeleteCallback m_OnDeleted;
-       };
-}
-
-
-
-#endif /* MODEL2_DATA_ITEM_H */
diff --git a/lib-apps-common/inc/Model2/DataProvider.h b/lib-apps-common/inc/Model2/DataProvider.h
deleted file mode 100644 (file)
index f63260b..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2016 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * 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.
- */
-
-#ifndef MODEL2_DATA_PROVIDER_H
-#define MODEL2_DATA_PROVIDER_H
-
-#include "Model2/DataItem.h"
-
-#include <list>
-
-namespace Model2
-{
-       class EXPORT_API DataProvider
-       {
-       public:
-               typedef std::list<DataItem *> DataList;
-
-               /**
-                * @brief Called once initialization is finished.
-                */
-               typedef std::function<void()> InitializeCallback;
-
-               /**
-                * @brief Insert callback
-                * @param[in] data
-                */
-               typedef std::function<void(DataItem &)> InsertCallback;
-
-               /**
-                * @brief Called when provider has finished updating its items.
-                */
-               typedef std::function<void()> UpdateFinishedCallback;
-
-               virtual ~DataProvider() { }
-
-               /**
-                * @brief Initialize provider data.
-                * @remark Should be called before retrieving the data.
-                * @param[in]   callback    Initialization finished callback
-                */
-               void initialize(InitializeCallback callback);
-
-               /**
-                * @return Data list
-                */
-               virtual const DataList &getDataList() = 0;
-
-               /**
-                * @brief Set insert callback
-                * @param[in]   callback    Create callback
-                */
-               void setInsertCallback(InsertCallback callback);
-
-               /**
-                * @brief Unset insert callback
-                */
-               void unsetInsertCallback();
-
-               /**
-                * @brief Set update finished callback
-                * @param[in]   callback    Update finished callback
-                */
-               void setUpdateFinishedCallback(UpdateFinishedCallback callback);
-
-               /**
-                * @brief Unset update finished callback
-                */
-               void unsetUpdateFinishedCallback();
-
-       protected:
-               /**
-                * @brief Called after initialize() to initialize provider data.
-                * @post onInitialized() should be called when initialization is finished.
-                */
-               virtual void onInitialize();
-
-               /**
-                * @brief Should be called to notify that initialization is finished.
-                */
-               void onInitialized();
-
-               /**
-                * @brief DataItem inserted callback
-                * @param[in]   dataItem    Data item
-                */
-               void onInserted(DataItem &dataItem);
-
-               /**
-                * @brief Should be called to notify that update is finished.
-                */
-               void onUpdateFinished();
-
-       private:
-               InitializeCallback m_OnInitialized;
-               InsertCallback m_OnInserted;
-               UpdateFinishedCallback m_OnUpdateFinished;
-       };
-}
-
-#endif /* MODEL2_DATA_PROVIDER_H */
diff --git a/lib-logs/inc/Logs/Model/DataItem.h b/lib-logs/inc/Logs/Model/DataItem.h
new file mode 100644 (file)
index 0000000..a409f0f
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * 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.
+ */
+
+#ifndef LOGS_MODEL_DATA_ITEM_H
+#define LOGS_MODEL_DATA_ITEM_H
+
+#include <functional>
+#include <tizen.h>
+
+namespace Logs
+{
+       namespace Model
+       {
+               class EXPORT_API DataItem
+               {
+               public:
+                       /**
+                        * @brief Change callback
+                        * @param[in] Changed info
+                        */
+                       typedef std::function<void(int)> UpdateCallback;
+
+                       /**
+                        * @brief Delete callback
+                        */
+                       typedef std::function<void()> DeleteCallback;
+
+                       virtual ~DataItem() { }
+
+                       /**
+                        * @brief Set update callback
+                        * @param[in]   callback    Update callback
+                        */
+                       void setUpdateCallback(UpdateCallback callback);
+
+                       /**
+                        * @brief Unset update callback
+                        */
+                       void unsetUpdateCallback();
+
+                       /**
+                        * @brief Set delete callback
+                        * @param[in]   callback    Delete callback
+                        */
+                       void setDeleteCallback(DeleteCallback callback);
+
+                       /**
+                        * @brief Unset delete callback
+                        */
+                       void unsetDeleteCallback();
+
+               protected:
+                       /**
+                        * @brief ContactData updated callback
+                        * @param[in]   changes     Changed info
+                        */
+                       void onUpdated(int changes);
+
+                       /**
+                        * @brief ContactData deleted callback
+                        */
+                       void onDeleted();
+
+               private:
+                       UpdateCallback m_OnUpdated;
+                       DeleteCallback m_OnDeleted;
+               };
+       }
+}
+
+
+
+#endif /* LOGS_MODEL_DATA_ITEM_H */
diff --git a/lib-logs/inc/Logs/Model/DataProvider.h b/lib-logs/inc/Logs/Model/DataProvider.h
new file mode 100644 (file)
index 0000000..1550103
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * 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.
+ */
+
+#ifndef LOGS_MODEL_DATA_PROVIDER_H
+#define LOGS_MODEL_DATA_PROVIDER_H
+
+#include "Logs/Model/DataItem.h"
+
+#include <list>
+
+namespace Logs
+{
+       namespace Model
+       {
+               class EXPORT_API DataProvider
+               {
+               public:
+                       typedef std::list<DataItem *> DataList;
+
+                       /**
+                        * @brief Called once initialization is finished.
+                        */
+                       typedef std::function<void()> InitializeCallback;
+
+                       /**
+                        * @brief Insert callback
+                        * @param[in] data
+                        */
+                       typedef std::function<void(DataItem &)> InsertCallback;
+
+                       /**
+                        * @brief Called when provider has finished updating its items.
+                        */
+                       typedef std::function<void()> UpdateFinishedCallback;
+
+                       virtual ~DataProvider() { }
+
+                       /**
+                        * @brief Initialize provider data.
+                        * @remark Should be called before retrieving the data.
+                        * @param[in]   callback    Initialization finished callback
+                        */
+                       void initialize(InitializeCallback callback);
+
+                       /**
+                        * @return Data list
+                        */
+                       virtual const DataList &getDataList() = 0;
+
+                       /**
+                        * @brief Set insert callback
+                        * @param[in]   callback    Create callback
+                        */
+                       void setInsertCallback(InsertCallback callback);
+
+                       /**
+                        * @brief Unset insert callback
+                        */
+                       void unsetInsertCallback();
+
+                       /**
+                        * @brief Set update finished callback
+                        * @param[in]   callback    Update finished callback
+                        */
+                       void setUpdateFinishedCallback(UpdateFinishedCallback callback);
+
+                       /**
+                        * @brief Unset update finished callback
+                        */
+                       void unsetUpdateFinishedCallback();
+
+               protected:
+                       /**
+                        * @brief Called after initialize() to initialize provider data.
+                        * @post onInitialized() should be called when initialization is finished.
+                        */
+                       virtual void onInitialize();
+
+                       /**
+                        * @brief Should be called to notify that initialization is finished.
+                        */
+                       void onInitialized();
+
+                       /**
+                        * @brief DataItem inserted callback
+                        * @param[in]   dataItem    Data item
+                        */
+                       void onInserted(DataItem &dataItem);
+
+                       /**
+                        * @brief Should be called to notify that update is finished.
+                        */
+                       void onUpdateFinished();
+
+               private:
+                       InitializeCallback m_OnInitialized;
+                       InsertCallback m_OnInserted;
+                       UpdateFinishedCallback m_OnUpdateFinished;
+               };
+       }
+}
+
+#endif /* LOGS_MODEL_DATA_PROVIDER_H */
index 78cddd9..87f57ca 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef LOGS_MODEL_LOG_H
 #define LOGS_MODEL_LOG_H
 
-#include "Model2/DataItem.h"
+#include "Logs/Model/DataItem.h"
 
 #include <contacts.h>
 #include <time.h>
@@ -32,7 +32,7 @@ namespace Logs
                /**
                 * @brief Log record information
                 */
-               class Log : public ::Model2::DataItem
+               class Log : public DataItem
                {
                public:
                        /**
index 6540eb5..4ad95d2 100644 (file)
@@ -21,7 +21,7 @@
 #include <time.h>
 #include <memory>
 
-#include "Model2/DataProvider.h"
+#include "Logs/Model/DataProvider.h"
 #include "Logs/Model/Log.h"
 #include "Logs/Model/LogGroup.h"
 
@@ -32,7 +32,7 @@ namespace Logs
                /**
                 * @brief Provides list of logs
                 */
-               class LogProvider : public ::Model2::DataProvider
+               class LogProvider : public DataProvider
                {
                public:
                        /**
similarity index 94%
rename from lib-apps-common/src/Model2/DataItem.cpp
rename to lib-logs/src/Logs/Model/DataItem.cpp
index 93c7db9..b5bc08d 100644 (file)
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-#include "Model2/DataItem.h"
+#include "Logs/Model/DataItem.h"
 
-using namespace Model2;
+using namespace Logs::Model;
 
 void DataItem::setUpdateCallback(UpdateCallback callback)
 {
similarity index 95%
rename from lib-apps-common/src/Model2/DataProvider.cpp
rename to lib-logs/src/Logs/Model/DataProvider.cpp
index 398b23f..1e92723 100644 (file)
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-#include "Model2/DataProvider.h"
+#include "Logs/Model/DataProvider.h"
 
-using namespace Model2;
+using namespace Logs::Model;
 
 void DataProvider::initialize(InitializeCallback callback)
 {