gtk+-3.0: Update to 3.0.5
[vala-lang.git] / doc / vala / interfaces.xml
blobfa473ea8227868c03a6c7de1b97d0b764aa93469
1 <?xml version="1.0"?>
2 <section id="interfaces">
3         <h>Interfaces</h>
4         <p>Interfaces can be implemented by classes to provide functionality with a common interface. Each class
5         can implement multiple interface and interfaces can require other interfaces to be implemented.</p>
6         <section id="declaration">
7                 <h>Interface declarations</h>
8                 <blockcode>
9                 public interface InterfaceName : RequiredInterface &lt;optional&gt;
10                 {
11                         &lt;interface members&gt;
12                 }
13                 </blockcode>
14         </section>
15         <section id="methods">
16                 <h>Methods</h>
17                 <p>Interfaces can contain abstract and non abstract methods.</p>
18                 <blockcode>
19                 public abstract void MethodName ();
20                 public void MethodName2 ()
21                 {
22                         &lt;Implementation&gt;
23                 }
24                 </blockcode>
25         </section>
26         <section id="delegates">
27                 <h>Delegates</h>
28                 <p>Interfaces can also contain delegates</p>
29                 <blockcode>
30                 public delegate void DelegateName (void* data);
31                 </blockcode>
32         </section>
33         <section id="signals">
34                 <h>Signals</h>
35                 <p>Signals are also supported by interfaces</p>
36                 <blockcode>
37                 public signal void SignalName ();
38                 </blockcode>
39         </section>
40 </section>