*/
std::vector<int> EXPORT_API getIntExtraDataArray(app_control_h appControl, const char *key);
+ /**
+ * @brief Get vector of string values from App Control array extra data.
+ * @param[in] appControl App Control handle
+ * @param[in] key Extra data array key
+ * @return Vector of string values on success, otherwise empty vector.
+ */
+ std::vector<std::string> EXPORT_API getStringExtraDataArray(app_control_h appControl, const char *key);
+
/**
* @brief Create array of strings of equal size.
* @details Both array and strings are created in a contiguous memory
*/
virtual void onDestroy() { }
+ /**
+ * @brief Untie underlying Evas_Object from this Control.
+ * @return Underlying Evas_Object.
+ */
+ Evas_Object *resetEvasObject();
+
private:
void setEvasObject(Evas_Object *object);
- Evas_Object *resetEvasObject();
+
void destroyEvasObject();
void onTypeCheck(Evas_Object *obj, void *eventInfo);
*/
void update(const char *parts, int type);
- private:
+ protected:
virtual Evas_Object *onCreate(Evas_Object *parent) override;
+ private:
static void onItemSelected(void *data, Evas_Object *obj, Elm_Object_Item *objectItem);
static void onItemLongpressed(void *data, Evas_Object *obj, Elm_Object_Item *objectItem);
static void onItemRealized(void *data, Evas_Object *obj, Elm_Object_Item *objectItem);
*/
Evas_Object *getBaseLayout() const;
+ /**
+ * @return Whether window is in landscape orientation.
+ */
+ bool isLandscape() const;
+
/**
* @brief Set whether windows supports rotation.
* @param[in] isEnabled Whether rotation is enabled
return result;
}
+std::vector<std::string> App::getStringExtraDataArray(app_control_h appControl, const char *key)
+{
+ std::vector<std::string> result;
+ char **array = nullptr;
+ int count = 0;
+
+ int err = app_control_get_extra_data_array(appControl, key, &array, &count);
+ RETVM_IF_ERR(err, result, "app_control_get_extra_data_array() failed.");
+ result.reserve(count);
+
+ for (int i = 0; i < count; ++i) {
+ result.push_back(array[i]);
+ free(array[i]);
+ }
+ free(array);
+
+ return result;
+}
+
char **App::createExtraDataArray(size_t dataSize, size_t count)
{
typedef char ExtraData[dataSize];
*/
#include "Ui/TabNavigator.h"
-#include "Ui/TabPage.h"
#include "Ui/Selector.h"
#include <algorithm>
return m_Layout;
}
+bool Window::isLandscape() const
+{
+ int rotation = elm_win_rotation_get(getEvasObject());
+ return rotation == 90 || rotation == 270;
+}
+
void Window::setRotationEnabled(bool isEnabled)
{
if (isEnabled) {