Difference between revisions of "Documentation/DevGuide/OfficeDev/Component/Window Interfaces"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (1 revision(s))
m
Line 12: Line 12:
 
=== XWindow ===
 
=== XWindow ===
 
The interface <idl>com.sun.star.awt.XWindow</idl> is supported by the component and controller windows. This interface comprises methods to resize a window, control its visibility, enable and disable it, and make it the focus for input device events. Listeners are informed about window events.
 
The interface <idl>com.sun.star.awt.XWindow</idl> is supported by the component and controller windows. This interface comprises methods to resize a window, control its visibility, enable and disable it, and make it the focus for input device events. Listeners are informed about window events.
 
+
<source lang="idl">
 
   [oneway] void setPosSize ( long X, long Y, long Width, long Height, short Flags );  
 
   [oneway] void setPosSize ( long X, long Y, long Width, long Height, short Flags );  
 
   com::sun::star::awt::Rectangle getPosSize ();  
 
   com::sun::star::awt::Rectangle getPosSize ();  
Line 32: Line 32:
 
   [oneway] void addPaintListener ( com::sun::star::awt::XPaintListener xListener );  
 
   [oneway] void addPaintListener ( com::sun::star::awt::XPaintListener xListener );  
 
   [oneway] void removePaintListener ( com::sun::star::awt::XPaintListener xListener );  
 
   [oneway] void removePaintListener ( com::sun::star::awt::XPaintListener xListener );  
 
+
</source>
 
The <idl>com.sun.star.awt.XWindowListener</idl> gets the following notifications. The <idl>com.sun.star.awt.WindowEvent</idl> has members describing the size and position of the window.
 
The <idl>com.sun.star.awt.XWindowListener</idl> gets the following notifications. The <idl>com.sun.star.awt.WindowEvent</idl> has members describing the size and position of the window.
 
+
<source lang="idl">
 
   [oneway] void windowResized ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowResized ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowMoved ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowMoved ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowShown ( [in] com::sun::star::lang::EventObject e )
 
   [oneway] void windowShown ( [in] com::sun::star::lang::EventObject e )
 
   [oneway] void windowHidden ( [in] com::sun::star::lang::EventObject e );  
 
   [oneway] void windowHidden ( [in] com::sun::star::lang::EventObject e );  
 
+
</source>
 
What the other listeners do are evident by their names.
 
What the other listeners do are evident by their names.
  
Line 45: Line 45:
  
 
The interface <idl>com.sun.star.awt.XTopWindow</idl> is available at container windows. It informs listeners about top window events, and it can put itself in front of other windows or withdraw into the background. It also has a method to control the current menu bar:
 
The interface <idl>com.sun.star.awt.XTopWindow</idl> is available at container windows. It informs listeners about top window events, and it can put itself in front of other windows or withdraw into the background. It also has a method to control the current menu bar:
 
+
<source lang="idl">
 
   [oneway] void addTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener );  
 
   [oneway] void addTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener );  
 
   [oneway] void removeTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener );  
 
   [oneway] void removeTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener );  
Line 51: Line 51:
 
   [oneway] void toBack ();  
 
   [oneway] void toBack ();  
 
   [oneway] void setMenuBar ( com::sun::star::awt::XMenuBar xMenu );
 
   [oneway] void setMenuBar ( com::sun::star::awt::XMenuBar xMenu );
 
+
</source>
  
 
{{Documentation/Note|Although the <tt>XTopWindow</tt> interface has a method <tt>setMenuBar()</tt>, this method is not usable at this time. The <idl>com.sun.star.awt.XMenuBar</idl> interface is deprecated.}}
 
{{Documentation/Note|Although the <tt>XTopWindow</tt> interface has a method <tt>setMenuBar()</tt>, this method is not usable at this time. The <idl>com.sun.star.awt.XMenuBar</idl> interface is deprecated.}}
  
 
The top window listener receives the following messages. All methods take a <idl>com.sun.star.awt.WindowEvent</idl> with members describing the size and position of the window.
 
The top window listener receives the following messages. All methods take a <idl>com.sun.star.awt.WindowEvent</idl> with members describing the size and position of the window.
 
+
<source lang="idl">
 
   [oneway] void windowOpened ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowOpened ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowClosing ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowClosing ( [in] com::sun::star::awt::WindowEvent e )
Line 64: Line 64:
 
   [oneway] void windowActivated ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowActivated ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowDeactivated ( [in] com::sun::star::awt::WindowEvent e )
 
   [oneway] void windowDeactivated ( [in] com::sun::star::awt::WindowEvent e )
 
+
</source>
 
=== XWindowPeer ===
 
=== XWindowPeer ===
  
 
Each <code>XWindow</code> has a <idl>com.sun.star.awt.XWindowPeer</idl>. The <idl>com.sun.star.awt.XWindowPeer</idl> interface accesses the window toolkit implementation used to create it and provides the pointer of the pointing device, and controls the background color. It is also used to invalidate a window or portions of it to trigger a redraw cycle.
 
Each <code>XWindow</code> has a <idl>com.sun.star.awt.XWindowPeer</idl>. The <idl>com.sun.star.awt.XWindowPeer</idl> interface accesses the window toolkit implementation used to create it and provides the pointer of the pointing device, and controls the background color. It is also used to invalidate a window or portions of it to trigger a redraw cycle.
 
+
<source lang="idl">
 
   com::sun::star::awt::XToolkit getToolkit ()
 
   com::sun::star::awt::XToolkit getToolkit ()
 
   [oneway] void setPointer ( [in] com::sun::star::awt::XPointer Pointer )
 
   [oneway] void setPointer ( [in] com::sun::star::awt::XPointer Pointer )
Line 75: Line 75:
 
   [oneway] void invalidateRect ( [in] com::sun::star::awt::Rectangle Rect,  
 
   [oneway] void invalidateRect ( [in] com::sun::star::awt::Rectangle Rect,  
 
   [in] short Flags )
 
   [in] short Flags )
 
+
</source>
 
{{PDL1}}
 
{{PDL1}}
 
[[Category: Office Development]]
 
[[Category: Office Development]]

Revision as of 17:07, 23 March 2008



The window interfaces of the component window and container window control the OpenOffice.org application windows. This chapter provides a short overview.

XWindow

The interface com.sun.star.awt.XWindow is supported by the component and controller windows. This interface comprises methods to resize a window, control its visibility, enable and disable it, and make it the focus for input device events. Listeners are informed about window events.

  [oneway] void setPosSize ( long X, long Y, long Width, long Height, short Flags ); 
  com::sun::star::awt::Rectangle getPosSize (); 
 
  [oneway] void setVisible ( boolean Visible ); 
  [oneway] void setEnable ( boolean Enable ); 
  [oneway] void setFocus (); 
 
  [oneway] void addWindowListener ( com::sun::star::awt::XWindowListener xListener ); 
  [oneway] void removeWindowListener ( com::sun::star::awt::XWindowListener xListener ); 
  [oneway] void addFocusListener ( com::sun::star::awt::XFocusListener xListener ); 
  [oneway] void removeFocusListener ( com::sun::star::awt::XFocusListener xListener ); 
  [oneway] void addKeyListener ( com::sun::star::awt::XKeyListener xListener ); 
  [oneway] void removeKeyListener ( com::sun::star::awt::XKeyListener xListener ); 
  [oneway] void addMouseListener ( com::sun::star::awt::XMouseListener xListener ); 
  [oneway] void removeMouseListener ( com::sun::star::awt::XMouseListener xListener ); 
  [oneway] void addMouseMotionListener ( com::sun::star::awt::XMouseMotionListener xListener ); 
  [oneway] void removeMouseMotionListener ( com::sun::star::awt::XMouseMotionListener xListener ); 
  [oneway] void addPaintListener ( com::sun::star::awt::XPaintListener xListener ); 
  [oneway] void removePaintListener ( com::sun::star::awt::XPaintListener xListener );

The com.sun.star.awt.XWindowListener gets the following notifications. The com.sun.star.awt.WindowEvent has members describing the size and position of the window.

  [oneway] void windowResized ( [in] com::sun::star::awt::WindowEvent e )
  [oneway] void windowMoved ( [in] com::sun::star::awt::WindowEvent e )
  [oneway] void windowShown ( [in] com::sun::star::lang::EventObject e )
  [oneway] void windowHidden ( [in] com::sun::star::lang::EventObject e );

What the other listeners do are evident by their names.

XTopWindow

The interface com.sun.star.awt.XTopWindow is available at container windows. It informs listeners about top window events, and it can put itself in front of other windows or withdraw into the background. It also has a method to control the current menu bar:

  [oneway] void addTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener ); 
  [oneway] void removeTopWindowListener ( com::sun::star::awt::XTopWindowListener xListener ); 
  [oneway] void toFront (); 
  [oneway] void toBack (); 
  [oneway] void setMenuBar ( com::sun::star::awt::XMenuBar xMenu );

Template:Documentation/Note

The top window listener receives the following messages. All methods take a com.sun.star.awt.WindowEvent with members describing the size and position of the window.

  [oneway] void windowOpened ( [in] com::sun::star::awt::WindowEvent e )
  [oneway] void windowClosing ( [in] com::sun::star::awt::WindowEvent e )
  [oneway] void windowClosed ( [in] com::sun::star::awt::WindowEvent e )
  [oneway] void windowMinimized ( [in] com::sun::star::awt::WindowEvent e )
  [oneway] void windowNormalized ( [in] com::sun::star::awt::WindowEvent e )
  [oneway] void windowActivated ( [in] com::sun::star::awt::WindowEvent e )
  [oneway] void windowDeactivated ( [in] com::sun::star::awt::WindowEvent e )

XWindowPeer

Each XWindow has a com.sun.star.awt.XWindowPeer. The com.sun.star.awt.XWindowPeer interface accesses the window toolkit implementation used to create it and provides the pointer of the pointing device, and controls the background color. It is also used to invalidate a window or portions of it to trigger a redraw cycle.

  com::sun::star::awt::XToolkit getToolkit ()
  [oneway] void setPointer ( [in] com::sun::star::awt::XPointer Pointer )
  [oneway] void setBackground ( [in] long Color ) 
  [oneway] void invalidate ( [in] short Flags )
  [oneway] void invalidateRect ( [in] com::sun::star::awt::Rectangle Rect, 
  [in] short Flags )
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools