Implement _Ewk_Autofill_Profile class.
authorMarcel Swacha <m.swacha@samsung.com>
Mon, 26 May 2014 12:34:39 +0000 (14:34 +0200)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Change-Id: I4f226489601e4483e5eb4e24b516c45d05aa1ecb

tizen_src/impl/API/ewk_autofill_profile_private.cc [new file with mode: 0644]
tizen_src/impl/API/ewk_autofill_profile_private.h [new file with mode: 0644]
tizen_src/impl/chromium-efl.gyp

diff --git a/tizen_src/impl/API/ewk_autofill_profile_private.cc b/tizen_src/impl/API/ewk_autofill_profile_private.cc
new file mode 100644 (file)
index 0000000..3867cf9
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "ewk_autofill_profile_private.h"
+
+unsigned _Ewk_Autofill_Profile::s_currentID = 0;
+
+_Ewk_Autofill_Profile::_Ewk_Autofill_Profile() {
+  m_profileID = s_currentID;
+  ++s_currentID;
+}
+
+_Ewk_Autofill_Profile::~_Ewk_Autofill_Profile() {
+}
+
+unsigned _Ewk_Autofill_Profile::getProfileID() const {
+  return m_profileID;
+}
+
+std::string _Ewk_Autofill_Profile::getData(
+    DataType name) const {
+  const AutofillDataMap::const_iterator it = m_data.find(name);
+
+  return (it != m_data.end()) ? (*it).second : std::string();
+}
+
+void _Ewk_Autofill_Profile::setData(DataType name,
+    const std::string& value) {
+  m_data[name] = value;
+}
diff --git a/tizen_src/impl/API/ewk_autofill_profile_private.h b/tizen_src/impl/API/ewk_autofill_profile_private.h
new file mode 100644 (file)
index 0000000..32a041a
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EWK_AUTOFILL_PROFILE_PRIVATE_H_
+#define EWK_AUTOFILL_PROFILE_PRIVATE_H_
+
+#include <string>
+#include <map>
+
+enum DataType {
+  PROFILE_ID = 0,
+  PROFILE_NAME,
+  PROFILE_COMPANY,
+  PROFILE_ADDRESS1,
+  PROFILE_ADDRESS2,
+  PROFILE_CITY_TOWN,
+  PROFILE_STATE_PROVINCE_REGION,
+  PROFILE_ZIPCODE,
+  PROFILE_COUNTRY,
+  PROFILE_PHONE,
+  PROFILE_EMAIL,
+  MAX_AUTOFILL
+};
+
+class _Ewk_Autofill_Profile {
+public:
+  _Ewk_Autofill_Profile();
+  ~_Ewk_Autofill_Profile();
+
+  typedef std::map<DataType, std::string> AutofillDataMap;
+
+  unsigned getProfileID() const;
+  std::string getData(DataType name) const;
+
+  void setData(DataType name, const std::string& value);
+
+private:
+  static unsigned s_currentID;
+  unsigned m_profileID;
+  AutofillDataMap m_data;
+};
+
+#endif /*EWK_AUTOFILL_PROFILE_PRIVATE_H_*/
index d96837c..2b07a59 100755 (executable)
@@ -45,6 +45,8 @@
     ],
     'sources': [
       'API/ewk_auth_challenge_private.h',
+      'API/ewk_autofill_profile_private.h',
+      'API/ewk_autofill_profile_private.cc',
       'API/ewk_certificate_private.h',
       'API/ewk_console_message_private.h',
       'API/ewk_context_menu_private.h',