1 /*******************************************************************************
2  * Copyright (c) 2009, 2017 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  * Port to the D programming language:
11  *     alice <stigma@disroot.org>
12  *******************************************************************************/
13 module org.eclipse.swt.accessibility.AccessibleAttributeEvent;
14 
15 import java.lang.all;
16 import java.util.EventObject;
17 
18 /**
19  * Instances of this class are sent as a result of accessibility clients
20  * sending AccessibleAttribute messages to an accessible object.
21  *
22  * @see AccessibleAttributeListener
23  * @see AccessibleAttributeAdapter
24  *
25  * @since 3.6
26  */
27 public class AccessibleAttributeEvent : EventObject {
28 
29     /**
30      * [out] the top margin in pixels
31      *
32      * @see AccessibleAttributeListener#getAttributes
33      */
34     public int topMargin;
35 
36     /**
37      * [out] the bottom margin in pixels
38      *
39      * @see AccessibleAttributeListener#getAttributes
40      */
41     public int bottomMargin;
42 
43     /**
44      * [out] the left margin in pixels
45      *
46      * @see AccessibleAttributeListener#getAttributes
47      */
48     public int leftMargin;
49 
50     /**
51      * [out] the right margin in pixels
52      *
53      * @see AccessibleAttributeListener#getAttributes
54      */
55     public int rightMargin;
56 
57     /**
58      * [out] an array of pixel locations representing tab stops
59      *
60      * @see AccessibleAttributeListener#getAttributes
61      */
62     public int[] tabStops;
63 
64     /**
65      * [out] whether or not to justify the text
66      *
67      * @see AccessibleAttributeListener#getAttributes
68      */
69     public bool justify;
70 
71     /**
72      * [out] the alignment, which is one of SWT#LEFT, SWT#RIGHT or SWT#CENTER
73      *
74      * @see AccessibleAttributeListener#getAttributes
75      */
76     public int alignment;
77 
78     /**
79      * [out] the indent in pixels
80      *
81      * @see AccessibleAttributeListener#getAttributes
82      */
83     public int indent;
84 
85     /**
86      * [out] the 1-based level of this accessible in its group
87      *  (0 means "not applicable")
88      *
89      * @see AccessibleAttributeListener#getAttributes
90      * @since 3.102
91      */
92     public int groupLevel;
93     /**
94      * [out] the 1-based number of similar children in this accessible's group,
95      * including this accessible (0 means "not applicable")
96      *
97      * @see AccessibleAttributeListener#getAttributes
98      * @since 3.102
99      */
100     public int groupCount;
101     /**
102      * [out] the 1-based index of this accessible in its group
103      *  (0 means "not applicable")
104      *
105      * @see AccessibleAttributeListener#getAttributes
106      * @since 3.102
107      */
108     public int groupIndex;
109 
110     /**
111      * [out] an array of alternating key and value Strings which
112      * represent additional (i.e. non predefined) attributes
113      *
114      * @see AccessibleAttributeListener#getAttributes
115      */
116     public String [] attributes;
117 
118     // static const long serialVersionUID = -2894665777259297851L;
119 
120 /**
121  * Constructs a new instance of this class.
122  *
123  * @param source the object that fired the event
124  */
125 public this(Object source) {
126     super(source);
127 }
128 
129 /**
130  * Returns a string containing a concise, human-readable
131  * description of the receiver.
132  *
133  * @return a string representation of the event
134  */
135 override
136 string toString() const {
137     return Format("AccessibleAttributeEvent {{ topMargin={} bottomMargin={} leftMargin={} rightMargin={}" ~
138         " tabStops={} justify={} alignment={} indent={} groupLevel={} groupCount={} groupIndex={}}",
139         topMargin, bottomMargin, leftMargin, rightMargin, tabStops, justify, alignment, indent, groupLevel,
140         groupCount, groupIndex);
141 }
142 }