import elm_general;

enum Elm.Popup.Orient
{
   [[Possible orient values for popup.

     These values should be used in conjunction to elm_popup_orient_set() to
     set the position in which the popup should appear(relative to its parent)
     and in conjunction with elm_popup_orient_get() to know where the popup
     is appearing.
   ]]

   top = 0, [[Popup should appear in the top of parent, default.]]
   center, [[Popup should appear in the center of parent.]]
   bottom, [[Popup should appear in the bottom of parent.]]
   left, [[Popup should appear in the left of parent.]]
   right, [[Popup should appear in the right of parent.]]
   top_left, [[Popup should appear in the top left of parent.]]
   top_right, [[Popup should appear in the top right of parent.]]
   bottom_left, [[Popup should appear in the bottom left of parent.]]
   bottom_right, [[Notify should appear in the bottom right of parent.]]
   last [[Sentinel value, don't use.]]
}


class Elm.Popup (Elm.Layout, Elm_Interface_Atspi_Widget_Action)
{
   eo_prefix: elm_obj_popup;
   methods {
      @property align {
         set {
            [[Set the alignment of the popup object.

              Sets the alignment in which the popup will appear in its parent.

              \@if MOBILE \@since_tizen 2.3
              \@elseif WEARABLE \@since_tizen 2.3.1
              \@endif

              @since 1.9
            ]]
         }
         get {
            [[Get the alignment of the popup object.

              \@if MOBILE \@since_tizen 2.3
              \@elseif WEARABLE \@since_tizen 2.3.1
              \@endif

              @since 1.9
            ]]
         }
         values {
            horizontal: double; [[The horizontal alignment of the popup.]]
            vertical: double; [[The vertical alignment of the popup.]]
         }
      }
      @property allow_events {
         set {
            [[Sets whether events should be passed to by a click outside.

              Enabling allow event will remove the Blocked event area and
              events will pass to the lower layer objects otherwise they
              are blocked.

              Note: The default value is $false.

              \@if MOBILE \@since_tizen 2.3
              \@elseif WEARABLE \@since_tizen 2.3.1
              \@endif
            ]]
         }
         get {
            [[Returns value indicating whether allow event is enabled or not.

              \@if MOBILE \@since_tizen 2.3
              \@elseif WEARABLE \@since_tizen 2.3.1
              \@endif
            ]]
         }
         values {
            allow: bool; [[If $true, events are passed to lower objects.]]
         }
      }
      @property content_text_wrap_type {
         [[Control the wrapping type of content text packed in content
            area of popup object.
         ]]
         set {
            [[
              \@if MOBILE \@since_tizen 2.3
              \@elseif WEARABLE \@since_tizen 2.3.1
              \@endif
            ]]
         }
         get {
            [[
              \@if MOBILE \@since_tizen 2.3
              \@elseif WEARABLE \@since_tizen 2.3.1
              \@endif
            ]]
         }
         values {
            wrap: Elm.Wrap.Type; [[Wrapping type of type Elm_Wrap_Type.]]
         }
      }
      @property orient {
         set {
            [[Sets the orientation of the popup in the parent region.

              Sets the position in which popup will appear in its parent.
              By default, #ELM_POPUP_ORIENT_CENTER is set.

              \@if MOBILE \@since_tizen 2.3
              \@elseif WEARABLE \@since_tizen 2.3.1
              \@endif
            ]]
         }
         get {
            [[Returns the orientation of the popup.

              \@if MOBILE \@since_tizen 2.3
              \@elseif WEARABLE \@since_tizen 2.3.1
              \@endif
            ]]
         }
         values {
            orient: Elm.Popup.Orient; [[The orientation of the popup.]]
         }
      }
      @property timeout {
         set {
            [[Sets a timeout to hide popup automatically

              This function sets a timeout and starts the timer controlling
              when the popup is hidden. Since calling \@ref evas_object_show
              on a popup restarts the timer controlling when it is hidden,
              setting this before the  popup is shown will in effect mean
              starting the timer when the popup is shown. Smart signal
              "timeout" is called afterwards which can be handled
              if needed.

              Note: Set a value <= 0.0 to disable a running timer.

              Note: If the value > 0.0 and the popup is previously visible,
              the timer will be started with this value, canceling any
              running timer.

              \@if MOBILE \@since_tizen 2.3
              \@elseif WEARABLE \@since_tizen 2.3.1
              \@endif
            ]]
         }
         get {
            [[Returns the timeout value set to the popup (in seconds).

              \@if MOBILE \@since_tizen 2.3
              \@elseif WEARABLE \@since_tizen 2.3.1
              \@endif
            ]]
         }
         values {
            timeout: double; [[The timeout in seconds.]]
         }
      }
      @property scrollable {
         set @internal {
            [[Enable or disable scroller in popup content area

              Normally content area does not contain scroller.

              @since 1.15.1
            ]]
         }
         get @internal {
            [[Get the scrollable state of popup content area

              Normally content area does not contain scroller.

              @since 1.15.1
            ]]
         }
         values {
            scroll: bool; [[$true if it is to be scrollable, $false otherwise.]]
         }
      }
      item_append {
         [[Add a new item to a Popup object

           Both an item list and a content could not be set at the same time!
           once you add an item, the previous content will be removed.

           Warning: When the first item is appended to popup object, any
           previous content of the content area is deleted. At a time,
           only one of content, content-text and item(s) can be there
           in a popup content area.

           \@if MOBILE \@since_tizen 2.3
           \@elseif WEARABLE \@since_tizen 2.3.1
           \@endif
         ]]
         return: Elm.Widget_Item *; [[A handle to the item added or $null on errors.]]
         params {
            @in label: const(char)*; [[The Label of the new item.]]
            @in icon: Evas.Object * @optional; [[Icon to be set on new item.]]
            @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected.]]
            @in data: const(void)* @optional; [[Data passed to $func above.]]
         }
      }
      dismiss {
         [[Dismiss a Popup object.

           \@if MOBILE \@since_tizen 2.4
           \@elseif WEARABLE \@since_tizen 2.3.1
           \@endif
         ]]
      }
   }
   implements {
      class.constructor;
      Eo.Base.constructor;
      Evas.Object_Smart.del;
      Evas.Object_Smart.add;
      Elm.Widget.focus_direction;
      Elm.Widget.focus_next_manager_is;
      Elm.Widget.theme_apply;
      Elm.Widget.focus_direction_manager_is;
      Elm.Widget.access;
      //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
      //register/unregister access objects accordingly.
      // TIZEN_ONLY(20170516): connect to at-spi dbus based on org.a11y.Status.IsEnabled property
      Elm.Widget.screen_reader;
      //
      //
      Elm.Widget.focus_next;
      Elm.Widget.parent.set;
      Elm.Widget.translate;
      Elm.Widget.sub_object_del;
      Elm.Widget.event;
      //TIZEN_ONLY(20160726): add API elm_object_part_access_object_get
      Elm.Widget.part_access_object_get;
      //
      Elm.Container.content_get;
      Elm.Container.content_set;
      Elm.Container.content_unset;
      Elm.Layout.text_set;
      Elm.Layout.text_get;
      Elm.Layout.sizing_eval;
      Elm.Layout.signal_emit;
      Elm_Interface_Atspi_Widget_Action.elm_actions.get;
      Elm_Interface_Atspi_Accessible.state_set.get;
      //TIZEN ONLY(20160818): name interface added
      Elm_Interface_Atspi_Accessible.name.get;
      //
      Elm_Interface_Atspi_Component.highlight_grab;
      Elm_Interface_Atspi_Component.highlight_clear;
   }
   events {
      block,clicked;
      timeout;
      item,focused;
      item,unfocused;
      language,changed;
      access,changed;
      dismissed;
      //TIZEN_ONLY(20160629) : add "show,finished" internal callback
      show,finished;
      //
   }

}
