summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con/efl_net_control_technology.eo
blob: f65d702fc4a051dcc46eeff939909da9693feddb (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
enum Efl.Net.Control.Technology.Type {
    [[Technology types

      @since 1.19
    ]]
    unknown, [[Type: unknown]]
    system, [[Type: system]]
    ethernet, [[Type: ethernet]]
    wifi, [[Type: WiFi]]
    bluetooth, [[Type: Bluetooth]]
    cellular, [[Type: cellular/mobile]]
    gps, [[Type: GPS]]
    vpn, [[Type: Virtual Private Network]]
    gadget, [[Type: USB gadget]]
    p2p, [[Type: Peer-2-Peer]]
}

class Efl.Net.Control.Technology (Efl.Loop.Consumer) {
    [[A technology that allows control of network access points.

      The @Efl.Net.Control is composed of multiple technologies, each
      can be disabled/enabled with @.powered property.

      When powered, the technology will dynamically create and remove
      access points in
      @Efl.Net.Control.access_points.

      @since 1.19
    ]]
    events {
        changed; [[Called when some properties were changed.]]
    }

    methods {
        @property powered {
            [[If $true the technology is available. If $false technology is disabled and if possible rfkill is used.]]
            get { }
            set { }
            values {
                powered: bool; [[$true if technology is powered, $false otherwise]]
            }
        }

        @property tethering {
            [[Tethering allows the default access point to be bridged to all clients connected through the technology.

              A common use case is to deploy the device as a router, such as
              a tethered phone allowing a laptop to connect to a 4G
              network.
            ]]
            get { }
            set { }
            values {
                enabled: bool; [[When to enable or disable tethering for this technology.]]
                identifier: string @optional; [[The name to identify the tethering. For WiFi this will translate to an SSID.]]
                passphrase: string @optional; [[The passphrase for tethering access. For WiFi this will translate to WPA passphrase.]]
            }
        }

        @property connected {
            [[If $true the technology has at least one access point connected.]]
            get { }
            values {
                connected: bool; [[$true if technology is connected, $false otherwise]]
            }
        }

        @property name {
            [[The user-friendly technology name]]
            get { }
            values {
                name: string; [[Technology name]]
            }
        }

        @property type {
            [[The technology type, such as "ethernet" or "wifi"]]
            get { }
            values {
                type: Efl.Net.Control.Technology.Type; [[Technology type]]
            }
        }

        scan {
            [[Explicitly trigger a scan.

              The scan will happen asynchronously in the background,
              with the results being delivered by events in the
              technology, @Efl.Net.Control or @Efl.Net.Control.Access_Point
              associated with the technology. For example, a scan on
              WiFi will add and remove access points.

              Try to avoid explicit scans.
              Rare exceptions to this rule include when the user requests them,
              such as entering a configuration dialog which demands a fresh
              state. Otherwise allow the system to perform
              passive scans in a timely manner.
            ]]
            return: ptr(Eina.Future) @owned; [[Future return for finished background scan]]
        }
    }

    implements {
        Efl.Object.destructor;
    }
}