1
2
3
4 package org.sirius.server.win32;
5
6 import com.sun.jna.Pointer;
7 import com.sun.jna.platform.win32.WinDef.HWND;
8
9
10
11
12
13 public class Win32Locator {
14
15
16
17
18 private long hwnd;
19
20
21
22 private long parent;
23
24
25
26 private String winClass;
27
28
29
30 private String caption;
31
32
33
34 private int index;
35
36
37
38
39 public Win32Locator() {
40 hwnd = 0;
41 parent = 0;
42 winClass = "(.*)";
43 caption = "(.*)";
44 index = 0;
45 }
46
47
48
49
50
51
52 public Win32Locator(String winClass, String caption, int index) {
53 super();
54 this.winClass = winClass;
55 this.caption = caption;
56 this.index = index;
57 }
58
59
60
61
62
63
64
65 public Win32Locator(long parent, String winClass, String caption, int index) {
66 super();
67 this.parent = parent;
68 this.winClass = winClass;
69 this.caption = caption;
70 this.index = index;
71 }
72
73
74
75
76 public final String getCaption() {
77 return caption;
78 }
79
80
81
82
83 public final long getHwnd() {
84 return hwnd;
85 }
86
87
88
89
90 public final int getIndex() {
91 return index;
92 }
93
94
95
96
97 public final long getParent() {
98 return parent;
99 }
100
101
102
103
104 public final String getWinClass() {
105 return winClass;
106 }
107
108
109
110
111
112 public final void setCaption(final String captionVal) {
113 this.caption = captionVal;
114 }
115
116
117
118
119
120 public final void setHwnd(final HWND hwndVal) {
121 this.hwnd = Pointer.nativeValue(hwndVal.getPointer());
122 }
123
124
125
126
127
128 public final void setHwnd(final long hwndVal) {
129 this.hwnd = hwndVal;
130 }
131
132
133
134
135
136 public final void setIndex(final int indexVal) {
137 this.index = indexVal;
138 }
139
140
141
142
143 public final void setParent(final HWND parentVal) {
144 this.parent = parentVal.getPointer().getLong(0);
145 }
146
147
148
149
150
151 public final void setParent(final long parentVal) {
152 this.parent = parentVal;
153 }
154
155
156
157
158 public final void setWinClass(final String winClassVal) {
159 this.winClass = winClassVal;
160 }
161 }