01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Mikhail Danilov
19: * @version $Revision$
20: */package org.apache.harmony.awt.wtk;
21:
22: import java.awt.Dimension;
23: import java.awt.Point;
24:
25: /**
26: * Provides factory for NativeWindow
27: */
28: public interface WindowFactory {
29: /**
30: * Creates and returns NativeWindow with desired
31: * creation params
32: *
33: * @param p - initial window properties
34: * @return created window
35: */
36: NativeWindow createWindow(CreationParams p);
37:
38: /**
39: * Create NativeWindow instance connected to existing native resource
40: * @param nativeWindowId - id of existing window
41: * @return created NativeWindow instance
42: */
43: NativeWindow attachWindow(long nativeWindowId);
44:
45: /**
46: * Returns NativeWindow instance if created by this instance of
47: * WindowFactory, otherwise null
48: *
49: * @param id - HWND on Windows xwindow on X
50: * @return NativeWindow or null if unknown
51: */
52: NativeWindow getWindowById(long id);
53:
54: /**
55: * Returns NativeWindow instance of the top-level window
56: * that contains a specified point and was
57: * created by this instance of WindowFactory
58: * @param p - Point to check
59: * @return NativeWindow or null if the point is
60: * not within a window created by this WindowFactory
61: */
62: NativeWindow getWindowFromPoint(Point p);
63:
64: /**
65: * Returns whether native system supports the state for windows.
66: * This method tells whether the UI concept of, say, maximization or iconification is supported.
67: * It will always return false for "compound" states like Frame.ICONIFIED|Frame.MAXIMIZED_VERT.
68: * In other words, the rule of thumb is that only queries with a single frame state
69: * constant as an argument are meaningful.
70: *
71: * @param state - one of named frame state constants.
72: * @return true is this frame state is supported by this Toolkit implementation, false otherwise.
73: */
74: boolean isWindowStateSupported(int state);
75:
76: /**
77: * @see org.apache.harmony.awt.ComponentInternals
78: */
79: void setCaretPosition(int x, int y);
80:
81: /**
82: * Request size of arbitrary native window
83: * @param id - window ID
84: * @return window size
85: */
86: Dimension getWindowSizeById(long id);
87: }
|