--- /dev/null
+/*
+ * Copyright 2017 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 UX_MULTI_SELECTOR_H
+#define UX_MULTI_SELECTOR_H
+
+#include "Ui/Control.h"
+
+namespace Ux
+{
+ class EXPORT_API MultiSelector : public Ui::Control
+ {
+ public:
+ struct Strings
+ {
+ const char *selectAll; /**< "Select all" item text. */
+ const char *deselectAll; /**< "Deselect all" item text. */
+ };
+
+ MultiSelector();
+
+ /**
+ * @brief Set count of selected items.
+ */
+ void setCount(size_t count);
+
+ /**
+ * @brief Set translatable strings for menu.
+ * @param[in] strings Translatable strings table.
+ */
+ void setStrings(const Strings &strings);
+
+ private:
+ virtual Evas_Object *onCreate(Evas_Object *parent) override;
+ void onButtonClicked(Evas_Object *button, void *eventInfo);
+
+ Strings m_Strings;
+ };
+}
+
+#endif /* UX_MULTI_SELECTOR_H */
--- /dev/null
+/*
+ * Copyright 2017 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.
+ */
+
+#include "Ux/MultiSelector.h"
+#include "Ui/CircleMenu.h"
+#include "Utils/Callback.h"
+
+#define BUF_SIZE 8
+
+using namespace Ux;
+
+MultiSelector::MultiSelector()
+ : m_Strings { }
+{
+}
+
+void MultiSelector::setCount(size_t count)
+{
+ char buf[BUF_SIZE];
+ snprintf(buf, sizeof(buf), "%zu", count);
+ elm_object_text_set(getEvasObject(), buf);
+}
+
+void MultiSelector::setStrings(const Strings &strings)
+{
+ m_Strings = strings;
+}
+
+Evas_Object *MultiSelector::onCreate(Evas_Object *parent)
+{
+ auto button = elm_button_add(parent);
+ elm_object_style_set(button, "select_mode");
+ elm_object_text_set(button, "0");
+ evas_object_smart_callback_add(button, "clicked",
+ makeCallback(&MultiSelector::onButtonClicked), this);
+
+ elm_layout_content_set(parent, "elm.swallow.icon", button);
+
+ return button;
+}
+
+void MultiSelector::onButtonClicked(Evas_Object *button, void *eventInfo)
+{
+ auto menu = new Ui::CircleMenu();
+ menu->create(button);
+
+ menu->addItem(m_Strings.selectAll, [] {
+ //TODO React on select all event
+ });
+ menu->addItem(m_Strings.deselectAll, [] {
+ //TODO React on deselect all event
+ });
+ menu->show();
+}