View Javadoc

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   * @author Myk Kolisnyk
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       * @param winClass
49       * @param caption
50       * @param index
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       * @param parent
61       * @param winClass
62       * @param caption
63       * @param index
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       * @return the caption
75       */
76      public final String getCaption() {
77          return caption;
78      }
79  
80      /**
81       * @return the hwnd
82       */
83      public final long getHwnd() {
84          return hwnd;
85      }
86  
87      /**
88       * @return the index
89       */
90      public final int getIndex() {
91          return index;
92      }
93  
94      /**
95       * @return the parent
96       */
97      public final long getParent() {
98          return parent;
99      }
100 
101     /**
102      * @return the winClass
103      */
104     public final String getWinClass() {
105         return winClass;
106     }
107 
108     /**
109      * @param captionVal
110      *            the caption to set
111      */
112     public final void setCaption(final String captionVal) {
113         this.caption = captionVal;
114     }
115 
116     /**
117      * @param hwndVal
118      *            the hwnd to set
119      */
120     public final void setHwnd(final HWND hwndVal) {
121         this.hwnd = Pointer.nativeValue(hwndVal.getPointer());
122     }
123 
124     /**
125      * .
126      * @param hwndVal .
127      */
128     public final void setHwnd(final long hwndVal) {
129         this.hwnd = hwndVal;
130     }
131 
132     /**
133      * @param indexVal
134      *            the index to set
135      */
136     public final void setIndex(final int indexVal) {
137         this.index = indexVal;
138     }
139 
140     /**
141      * @param parentVal the parent to set
142      */
143     public final void setParent(final HWND parentVal) {
144         this.parent = parentVal.getPointer().getLong(0);
145     }
146 
147     /**
148      * .
149      * @param parentVal .
150      */
151     public final void setParent(final long parentVal) {
152         this.parent = parentVal;
153     }
154 
155     /**
156      * @param winClassVal  the winClass to set
157      */
158     public final void setWinClass(final String winClassVal) {
159         this.winClass = winClassVal;
160     }
161 }