summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_spotlight_manager.eo
blob: 03f0e4fc352908122edf4c0ea01227751e8dfcb9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object {
  [[Manager object used by @Efl.Ui.Spotlight.Container to handle rendering and animation of its sub-widgets,
    and user interaction.

    For instance, changes to the current sub-widget in the spotlight (@Efl.Ui.Spotlight.Container.active_element) can be
    animated with a transition.
    This object can also handle user interaction. For example, dragging the sub-widget to one side to get to a
    different sub-widget (like an smartphone home screen).
    Such user interactions should end up setting a new @Efl.Ui.Spotlight.Container.active_element.
    During a transition, the evolution of the current position should be exposed by emitting $pos_update events.
  ]]
  methods {
    bind @pure_virtual {
      [[This method is called the first time an @Efl.Ui.Spotlight.Manager is assigned to an
        @Efl.Ui.Spotlight.Container, binding them together.
        The manager can read the current content of the container, subscribe to events, or do any initialization it
        requires.
      ]]
      params {
        spotlight : Efl.Ui.Spotlight.Container; [[The container to bind the manager to.]]
        group : Efl.Canvas.Group; [[The graphical group where the views should be added with
                                    @Efl.Canvas.Group.group_member_add and removed with
                                    @Efl.Canvas.Group.group_member_remove.]]
      }
    }
    content_add @pure_virtual  {
      [[A $subobj has been added at position $index in the bound container.]]
      params {
        subobj : Efl.Gfx.Entity; [[The new object that has been added to the container.]]
        index : int; [[The index of the new object in the container's list.]]
      }
    }
    content_del @pure_virtual  {
      [[The $subobj at position $index in the bound container has been removed.]]
      params {
        subobj : Efl.Gfx.Entity; [[The object being removed from the container.]]
        index : int; [[The index this object had in the container's list.]]
      }
    }
    switch_to @pure_virtual  {
      [[Switch from one sub-widget to another. If there was no previous sub-widget, $from might be -1.
        This function should display an animation if the @Efl.Ui.Spotlight.Manager supports them.
      ]]
      params {
        from : int; [[Index of the starting sub-widget in the container's list. Might be -1 if unknown.]]
        to : int; [[Index of the target sub-widget in the container's list.]]
      }
    }
    @property size @pure_virtual  {
      [[Will be called whenever the @Efl.Ui.Spotlight.Container.spotlight_size changes so the
        @Efl.Ui.Spotlight.Manager can update itself.]]
      set {
      }
      values {
        size : Eina.Size2D; [[The new size of the sub-widgets.]]
      }
    }
    @property animation_enabled @pure_virtual {
       [[This flag can be used to disable animations.]]
       values {
          enable : bool; [[$true if you want animations to happen, $false otherwise.]]
       }
    }
  }
  events {
    pos_update : double; [[Index of the sub-widget currently being displayed. Fractional values indicate a position
                           in-between sub-widgets. For instance, when transitioning from sub-widget 2 to sub-widget 3,
                           this event should be emitted with monotonically increasing values ranging from 2.0 to 3.0.
                           Animations can perform any movement they want, but the reported $pos_update must move in
                           the same direction.]]
  }
}