3 * Copyright (C) 2008-2011 Florian Brosch
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Florian Brosch <flo.brosch@gmail.com>
24 using Valadoc
.Content
;
27 * Represents an signal.
29 public class Valadoc
.Api
.Signal
: Member
, Callable
{
30 private string? default_impl_cname
;
31 private string? dbus_name
;
32 private string? cname
;
38 internal string? implicit_array_length_cparameter_name
{
44 public Signal (Node parent
, SourceFile file
, string name
, SymbolAccessibility accessibility
,
45 SourceComment? comment
, string? cname
, string? default_impl_cname
, string? dbus_name
, bool is_dbus_visible
,
46 bool is_virtual
, Vala
.Signal data
)
48 base (parent
, file
, name
, accessibility
, comment
, data
);
50 this
.default_impl_cname
= default_impl_cname
;
51 this
.dbus_name
= dbus_name
;
54 this
.is_dbus_visible
= is_dbus_visible
;
55 this
.is_virtual
= is_virtual
;
59 * Returns the name of this signal as it is used in C.
61 public string?
get_cname () {
65 public string?
get_default_impl_cname () {
66 return default_impl_cname
;
70 * Returns the dbus-name.
72 public string get_dbus_name () {
79 public TypeReference? return_type
{
85 * Specifies whether this signal is virtual
87 public bool is_virtual
{
93 * Specifies whether this signal is visible for dbus
95 public bool is_dbus_visible
{
103 protected override Inline
build_signature () {
104 var signature
= new
SignatureBuilder ();
106 signature
.append_keyword (accessibility
.to_string ());
108 signature
.append_keyword ("virtual");
111 signature
.append_keyword ("signal");
113 signature
.append_content (return_type
.signature
);
114 signature
.append_symbol (this
);
115 signature
.append ("(");
118 foreach (Node param
in get_children_by_type (NodeType
.FORMAL_PARAMETER
, false)) {
120 signature
.append (",", false);
122 signature
.append_content (param
.signature
, !first
);
126 signature
.append (")", false);
128 return signature
.get ();
134 public override NodeType node_type
{
135 get { return NodeType
.SIGNAL
; }
141 public override void accept (Visitor visitor
) {
142 visitor
.visit_signal (this
);