2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-17 20:52:41 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-08-28 07:05:23 +04:00
|
|
|
*
|
2004-04-17 20:52:41 +04:00
|
|
|
* 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/
|
1998-08-28 07:05:23 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* 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.
|
1998-08-28 07:05:23 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-17 20:52:41 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-17 20:52:41 +04:00
|
|
|
* either of 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"),
|
2001-09-29 00:14:13 +04:00
|
|
|
* 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
|
2004-04-17 20:52:41 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04:00
|
|
|
* 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
|
2004-04-17 20:52:41 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1998-08-28 07:05:23 +04:00
|
|
|
|
|
|
|
#ifndef nsIViewObserver_h___
|
|
|
|
#define nsIViewObserver_h___
|
|
|
|
|
|
|
|
#include "nsISupports.h"
|
2001-07-16 06:40:48 +04:00
|
|
|
#include "nsEvent.h"
|
1998-08-28 07:05:23 +04:00
|
|
|
|
|
|
|
class nsIRenderingContext;
|
|
|
|
struct nsRect;
|
2001-07-16 06:40:48 +04:00
|
|
|
struct nsGUIEvent;
|
1998-08-28 07:05:23 +04:00
|
|
|
|
|
|
|
#define NS_IVIEWOBSERVER_IID \
|
2004-10-15 01:51:00 +04:00
|
|
|
{ 0x0f4bc34a, 0xc93b, 0x4699, \
|
|
|
|
{ 0xb6, 0xc2, 0xb3, 0xca, 0x9e, 0xe4, 0x6c, 0x95 } }
|
1998-08-28 07:05:23 +04:00
|
|
|
|
|
|
|
class nsIViewObserver : public nsISupports
|
|
|
|
{
|
|
|
|
public:
|
1999-06-25 02:40:53 +04:00
|
|
|
|
2002-06-26 07:38:55 +04:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IVIEWOBSERVER_IID)
|
1998-08-28 07:05:23 +04:00
|
|
|
|
|
|
|
/* called when the observer needs to paint
|
|
|
|
* @param aRenderingContext - rendering context to paint to
|
|
|
|
* @param aDirtyRect - rectangle of dirty area
|
|
|
|
* @return error status
|
|
|
|
*/
|
|
|
|
NS_IMETHOD Paint(nsIView * aView,
|
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
const nsRect& aDirtyRect) = 0;
|
|
|
|
|
|
|
|
/* called when the observer needs to handle an event
|
|
|
|
* @param aEvent - event notification
|
|
|
|
* @param aEventStatus - out parameter for event handling
|
|
|
|
* status
|
2000-03-22 05:43:08 +03:00
|
|
|
* @param aHandled - whether the correct frame was found to
|
|
|
|
* handle the event
|
1998-08-28 07:05:23 +04:00
|
|
|
* @return error status
|
|
|
|
*/
|
|
|
|
NS_IMETHOD HandleEvent(nsIView * aView,
|
|
|
|
nsGUIEvent* aEvent,
|
2000-03-22 05:43:08 +03:00
|
|
|
nsEventStatus* aEventStatus,
|
massive landing of joki changes.
Relevant nsbeta3+ bugs 43309, 44503, 2634, 2504,5981, 24698, 25758, 33577,
36062, 36217, 41191, 41491, 42356, 42829, 43016
r=saari (joki code). also been tested by heikki and bryner
2000-08-09 01:31:05 +04:00
|
|
|
PRBool aForceHandle,
|
2000-03-22 05:43:08 +03:00
|
|
|
PRBool& aHandled) = 0;
|
1998-08-28 07:05:23 +04:00
|
|
|
|
|
|
|
/* called when the view has been resized and the
|
|
|
|
* content within the view needs to be reflowed.
|
|
|
|
* @param aWidth - new width of view
|
|
|
|
* @param aHeight - new height of view
|
|
|
|
* @return error status
|
|
|
|
*/
|
|
|
|
NS_IMETHOD ResizeReflow(nsIView * aView, nscoord aWidth, nscoord aHeight) = 0;
|
2004-10-15 01:51:00 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Hack to find out if the view observer is itself visible, in lieu
|
|
|
|
* of having the view trees linked.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD_(PRBool) IsVisible() = 0;
|
1998-08-28 07:05:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|