summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_active_view_view_manager.eo
blob: a6f039aaffd56a9c5db4ec4145b4b9835ae3a094 (plain)
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
abstract @beta Efl.Ui.Active_View.View_Manager extends Efl.Object {
  [[Manager object used by @Efl.Ui.Active_View.Container to handle rendering and animation of its views, and user interaction.

    For instance, changes to the currently active view (@Efl.Ui.Active_View.Container.active_index) can be animated with a transition.
    This object can also handle user interaction. For example, dragging the active view to one side to get to a different view (like an Android home screen).
    Such user interactions should end up setting a new @Efl.Ui.Active_View.Container.active_index.
    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.Active_View.View_Manager is assigned to an @Efl.Ui.Active_View.Container, binding them together.
        The manager can read the current content of the container, subscribe to events, or do any initialization it requires.
      ]]
      params {
        active_view : Efl.Ui.Active_View.Container; [[The container to bind the view 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.

        The manager should check the container's @Efl.Ui.Active_View.Container.active_index since indices might have
        shifted due to the insertion of the new object.
      ]]
      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.

        The manager should check the container's @Efl.Ui.Active_View.Container.active_index since indices might have
        shifted due to the removal of the object.
      ]]
      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 view to another. If there was no previous view, $from might be -1.
        This function should display an animation if the @Efl.Ui.Active_View.View_Manager supports them.
      ]]
      params {
        from : int; [[Index of the starting view in the container's list. Might be -1 if unknown.]]
        to : int; [[Index of the target view in the container's list.]]
      }
    }
    @property view_size @pure_virtual  {
      [[Will be called whenever the @Efl.Ui.Active_View.Container.active_view_size changes so the @Efl.Ui.Active_View.View_Manager can update itself.]]
      set {
      }
      values {
        size : Eina.Size2D; [[The new size of the views.]]
      }
    }
    @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 view currently being displayed. Fractional values indicate a position in-between views.
                           For instance, when transitioning from view 2 to view 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.]]
  }
}