1999-11-17 03:19:56 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2004-04-18 22:01:16 +00:00
|
|
|
* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
1999-11-17 03:19:56 +00:00
|
|
|
* The Original Code is the Mozilla browser.
|
2004-04-18 22:01:16 +00:00
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications, Inc.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1999
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
1999-11-17 03:19:56 +00:00
|
|
|
* Contributor(s):
|
|
|
|
* Travis Bogard <travis@netscape.com>
|
2004-04-18 22:01:16 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-11-17 03:19:56 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
#include "nsrootidl.idl"
|
|
|
|
/*#include "nsIWidget.idl" Boy this would be nice.*/
|
|
|
|
|
|
|
|
[ptr] native nsIWidget(nsIWidget);
|
|
|
|
%{ C++
|
2001-07-16 02:40:48 +00:00
|
|
|
class nsIWidget;
|
1999-11-17 03:19:56 +00:00
|
|
|
%}
|
|
|
|
|
2000-06-03 09:46:12 +00:00
|
|
|
typedef voidPtr nativeWindow;
|
1999-11-17 03:19:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The nsIBaseWindow describes a generic window and basic operations that
|
|
|
|
* can be performed on it. This is not to be a complete windowing interface
|
|
|
|
* but rather a common set that nearly all windowed objects support.
|
|
|
|
*/
|
|
|
|
|
|
|
|
[scriptable, uuid(046BC8A0-8015-11d3-AF70-00A024FFC08C)]
|
|
|
|
interface nsIBaseWindow : nsISupports
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Allows a client to initialize an object implementing this interface with
|
|
|
|
the usually required window setup information.
|
2009-07-22 00:45:10 +00:00
|
|
|
It is possible to pass null for both parentNativeWindow and parentWidget,
|
|
|
|
but only docshells support this.
|
1999-11-17 03:19:56 +00:00
|
|
|
|
|
|
|
@param parentNativeWindow - This allows a system to pass in the parenting
|
|
|
|
window as a native reference rather than relying on the calling
|
|
|
|
application to have created the parent window as an nsIWidget. This
|
|
|
|
value will be ignored (should be nsnull) if an nsIWidget is passed in to
|
2009-07-22 00:45:10 +00:00
|
|
|
the parentWidget parameter.
|
1999-11-17 03:19:56 +00:00
|
|
|
|
|
|
|
@param parentWidget - This allows a system to pass in the parenting widget.
|
|
|
|
This allows some objects to optimize themselves and rely on the view
|
|
|
|
system for event flow rather than creating numerous native windows. If
|
2009-07-22 00:45:10 +00:00
|
|
|
one of these is not available, nsnull should be passed.
|
1999-11-17 03:19:56 +00:00
|
|
|
|
|
|
|
@param x - This is the x co-ordinate relative to the parent to place the
|
|
|
|
window.
|
|
|
|
|
|
|
|
@param y - This is the y co-ordinate relative to the parent to place the
|
|
|
|
window.
|
|
|
|
|
|
|
|
@param cx - This is the width for the window to be.
|
|
|
|
|
|
|
|
@param cy - This is the height for the window to be.
|
|
|
|
|
|
|
|
@return NS_OK - Window Init succeeded without a problem.
|
|
|
|
NS_ERROR_UNEXPECTED - Call was unexpected at this time. Most likely
|
|
|
|
due to you calling it after create() has been called.
|
|
|
|
NS_ERROR_INVALID_ARG - controls that require either a parentNativeWindow
|
|
|
|
or a parentWidget may return invalid arg when they do not
|
|
|
|
receive what they are needing.
|
|
|
|
*/
|
|
|
|
[noscript]void initWindow(in nativeWindow parentNativeWindow,
|
|
|
|
in nsIWidget parentWidget, in long x, in long y, in long cx, in long cy);
|
|
|
|
|
|
|
|
/*
|
|
|
|
Tells the window that intialization and setup is complete. When this is
|
|
|
|
called the window can actually create itself based on the setup
|
|
|
|
information handed to it.
|
|
|
|
|
|
|
|
@return NS_OK - Creation was successfull.
|
|
|
|
NS_ERROR_UNEXPECTED - This call was unexpected at this time.
|
|
|
|
Perhaps create() had already been called or not all
|
|
|
|
required initialization had been done.
|
|
|
|
*/
|
|
|
|
void create();
|
|
|
|
|
|
|
|
/*
|
2000-01-26 06:24:04 +00:00
|
|
|
Tell the window that it should destroy itself. This call should not be
|
|
|
|
necessary as it will happen implictly when final release occurs on the
|
|
|
|
object. If for some reaons you want the window destroyed prior to release
|
|
|
|
due to cycle or ordering issues, then this call provides that ability.
|
1999-11-17 03:19:56 +00:00
|
|
|
|
|
|
|
@return NS_OK - Everything destroyed properly.
|
2000-01-26 06:24:04 +00:00
|
|
|
NS_ERROR_UNEXPECTED - This call was unexpected at this time.
|
|
|
|
Perhaps create() has not been called yet.
|
1999-11-17 03:19:56 +00:00
|
|
|
*/
|
|
|
|
void destroy();
|
|
|
|
|
|
|
|
/*
|
|
|
|
Sets the current x and y coordinates of the control. This is relative to
|
|
|
|
the parent window.
|
|
|
|
*/
|
|
|
|
void setPosition(in long x, in long y);
|
|
|
|
|
|
|
|
/*
|
|
|
|
Gets the current x and y coordinates of the control. This is relatie to the
|
|
|
|
parent window.
|
|
|
|
*/
|
|
|
|
void getPosition(out long x, out long y);
|
|
|
|
|
|
|
|
/*
|
|
|
|
Sets the width and height of the control.
|
|
|
|
*/
|
|
|
|
void setSize(in long cx, in long cy, in boolean fRepaint);
|
|
|
|
|
|
|
|
/*
|
|
|
|
Gets the width and height of the control.
|
|
|
|
*/
|
|
|
|
void getSize(out long cx, out long cy);
|
|
|
|
|
|
|
|
/*
|
|
|
|
Convenience function combining the SetPosition and SetSize into one call.
|
1999-11-27 02:49:57 +00:00
|
|
|
Also is more efficient than calling both.
|
1999-11-17 03:19:56 +00:00
|
|
|
*/
|
|
|
|
void setPositionAndSize(in long x, in long y, in long cx, in long cy,
|
1999-11-27 02:49:57 +00:00
|
|
|
in boolean fRepaint);
|
|
|
|
|
|
|
|
/*
|
|
|
|
Convenience function combining the GetPosition and GetSize into one call.
|
|
|
|
Also is more efficient than calling both.
|
|
|
|
*/
|
|
|
|
void getPositionAndSize(out long x, out long y, out long cx, out long cy);
|
|
|
|
|
1999-11-17 03:19:56 +00:00
|
|
|
/**
|
|
|
|
* Tell the window to repaint itself
|
|
|
|
* @param aForce - if true, repaint immediately
|
|
|
|
* if false, the window may defer repainting as it sees fit.
|
|
|
|
*/
|
|
|
|
void repaint(in boolean force);
|
|
|
|
|
|
|
|
/*
|
2009-07-22 00:45:10 +00:00
|
|
|
This is the parenting widget for the control. This may be null if the
|
|
|
|
native window was handed in for the parent during initialization.
|
|
|
|
If this is returned, it should refer to the same object as
|
|
|
|
parentNativeWindow.
|
1999-11-17 03:19:56 +00:00
|
|
|
|
|
|
|
Setting this after Create() has been called may not be supported by some
|
|
|
|
implementations.
|
|
|
|
|
|
|
|
On controls that don't support widgets, setting this will return a
|
|
|
|
NS_ERROR_NOT_IMPLEMENTED error.
|
|
|
|
*/
|
2000-03-17 23:47:48 +00:00
|
|
|
[noscript] attribute nsIWidget parentWidget;
|
1999-11-17 03:19:56 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
This is the native window parent of the control.
|
|
|
|
|
|
|
|
Setting this after Create() has been called may not be supported by some
|
|
|
|
implementations.
|
|
|
|
|
|
|
|
On controls that don't support setting nativeWindow parents, setting this
|
|
|
|
will return a NS_ERROR_NOT_IMPLEMENTED error.
|
|
|
|
*/
|
|
|
|
attribute nativeWindow parentNativeWindow;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Attribute controls the visibility of the object behind this interface.
|
|
|
|
Setting this attribute to false will hide the control. Setting it to
|
|
|
|
true will show it.
|
|
|
|
*/
|
|
|
|
attribute boolean visibility;
|
|
|
|
|
2002-02-28 23:19:04 +00:00
|
|
|
/*
|
|
|
|
a disabled window should accept no user interaction; it's a dead window,
|
|
|
|
like the parent of a modal window.
|
|
|
|
*/
|
|
|
|
attribute boolean enabled;
|
|
|
|
|
2003-02-24 20:15:19 +00:00
|
|
|
/** set blurSuppression to true to suppress handling of blur events.
|
|
|
|
* set it false to re-enable them. query it to determine whether
|
|
|
|
* blur events are suppressed. The implementation should allow
|
|
|
|
* for blur events to be suppressed multiple times.
|
|
|
|
*/
|
|
|
|
attribute boolean blurSuppression;
|
|
|
|
|
1999-11-17 03:19:56 +00:00
|
|
|
/*
|
|
|
|
Allows you to find out what the widget is of a given object. Depending
|
|
|
|
on the object, this may return the parent widget in which this object
|
2002-02-28 23:19:04 +00:00
|
|
|
lives if it has not had to create its own widget.
|
1999-11-17 03:19:56 +00:00
|
|
|
*/
|
2000-03-17 23:47:48 +00:00
|
|
|
[noscript] readonly attribute nsIWidget mainWidget;
|
1999-11-17 03:19:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Give the window focus.
|
|
|
|
*/
|
|
|
|
void setFocus();
|
|
|
|
|
1999-12-02 09:41:21 +00:00
|
|
|
/*
|
|
|
|
Title of the window.
|
|
|
|
*/
|
1999-11-17 03:19:56 +00:00
|
|
|
attribute wstring title;
|
|
|
|
};
|