2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* The contents of this file are subject to the Netscape 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/NPL/
|
1998-04-14 00:24:54 +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-04-14 00:24:54 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* 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
|
|
|
|
* 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 NPL, 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 NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2001-10-24 04:01:09 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsIFrame_h___
|
|
|
|
#define nsIFrame_h___
|
|
|
|
|
2001-10-24 04:01:09 +04:00
|
|
|
/* nsIFrame is in the process of being deCOMtaminated, i.e., this file is eventually
|
|
|
|
going to be eliminated, and all callers will use nsFrame instead. At the moment
|
|
|
|
we're midway through this process, so you will see inlined functions and member
|
|
|
|
variables in this file. -dwh */
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "nsISupports.h"
|
2001-07-16 06:40:48 +04:00
|
|
|
#include "nsEvent.h"
|
1998-05-21 06:34:13 +04:00
|
|
|
#include "nsStyleStruct.h"
|
2001-10-24 04:01:09 +04:00
|
|
|
#include "nsIStyleContext.h"
|
|
|
|
#include "nsIContent.h"
|
2001-07-16 06:40:48 +04:00
|
|
|
|
1999-11-19 18:33:29 +03:00
|
|
|
/**
|
|
|
|
* New rules of reflow:
|
|
|
|
* 1. you get a WillReflow() followed by a Reflow() followed by a DidReflow() in order
|
|
|
|
* (no separate pass over the tree)
|
|
|
|
* 2. it's the parent frame's responsibility to size/position the child's view (not
|
|
|
|
* the child frame's responsibility as it is today) during reflow (and before
|
|
|
|
* sending the DidReflow() notification)
|
|
|
|
* 3. positioning of child frames (and their views) is done on the way down the tree,
|
|
|
|
* and sizing of child frames (and their views) on the way back up
|
|
|
|
* 4. if you move a frame (outside of the reflow process, or after reflowing it),
|
|
|
|
* then you must make sure that its view (or its child frame's views) are re-positioned
|
|
|
|
* as well. It's reasonable to not position the view until after all reflowing the
|
|
|
|
* entire line, for example, but the frame should still be positioned and sized (and
|
|
|
|
* the view sized) during the reflow (i.e., before sending the DidReflow() notification)
|
|
|
|
* 5. the view system handles moving of widgets, i.e., it's not our problem
|
|
|
|
*/
|
|
|
|
|
2001-08-01 05:27:50 +04:00
|
|
|
struct nsHTMLReflowState;
|
2001-12-18 01:39:59 +03:00
|
|
|
class nsHTMLReflowCommand;
|
2001-08-01 05:27:50 +04:00
|
|
|
struct nsHTMLReflowMetrics;
|
|
|
|
|
1998-09-18 23:53:27 +04:00
|
|
|
class nsIAtom;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsIPresContext;
|
|
|
|
class nsIPresShell;
|
|
|
|
class nsIRenderingContext;
|
1999-08-31 07:09:40 +04:00
|
|
|
class nsISizeOfHandler;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsIView;
|
|
|
|
class nsIWidget;
|
2001-08-01 05:27:50 +04:00
|
|
|
class nsIDOMRange;
|
|
|
|
class nsISelectionController;
|
2001-12-07 17:51:12 +03:00
|
|
|
class nsIPercentHeightObserver;
|
2001-08-17 07:13:07 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
2001-08-01 05:27:50 +04:00
|
|
|
class nsIAccessible;
|
2001-08-17 07:13:07 +04:00
|
|
|
#endif
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1999-09-10 22:29:37 +04:00
|
|
|
struct nsPeekOffsetStruct;
|
1998-04-14 00:24:54 +04:00
|
|
|
struct nsPoint;
|
|
|
|
struct nsRect;
|
2001-08-01 05:27:50 +04:00
|
|
|
struct nsSize;
|
|
|
|
struct nsMargin;
|
2001-05-18 03:52:32 +04:00
|
|
|
|
1998-07-09 21:06:12 +04:00
|
|
|
// IID for the nsIFrame interface
|
|
|
|
// a6cf9050-15b3-11d2-932e-00805f8add32
|
|
|
|
#define NS_IFRAME_IID \
|
|
|
|
{ 0xa6cf9050, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-05-22 08:54:11 +04:00
|
|
|
/**
|
|
|
|
* Indication of how the frame can be split. This is used when doing runaround
|
|
|
|
* of floaters, and when pulling up child frames from a next-in-flow.
|
|
|
|
*
|
|
|
|
* The choices are splittable, not splittable at all, and splittable in
|
|
|
|
* a non-rectangular fashion. This last type only applies to block-level
|
|
|
|
* elements, and indicates whether splitting can be used when doing runaround.
|
|
|
|
* If you can split across page boundaries, but you expect each continuing
|
|
|
|
* frame to be the same width then return frSplittable and not
|
|
|
|
* frSplittableNonRectangular.
|
|
|
|
*
|
|
|
|
* @see #IsSplittable()
|
|
|
|
*/
|
|
|
|
typedef PRUint32 nsSplittableType;
|
|
|
|
|
|
|
|
#define NS_FRAME_NOT_SPLITTABLE 0 // Note: not a bit!
|
|
|
|
#define NS_FRAME_SPLITTABLE 0x1
|
|
|
|
#define NS_FRAME_SPLITTABLE_NON_RECTANGULAR 0x3
|
|
|
|
|
|
|
|
#define NS_FRAME_IS_SPLITTABLE(type)\
|
|
|
|
(0 != ((type) & NS_FRAME_SPLITTABLE))
|
|
|
|
|
|
|
|
#define NS_FRAME_IS_NOT_SPLITTABLE(type)\
|
|
|
|
(0 == ((type) & NS_FRAME_SPLITTABLE))
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
1998-05-14 04:47:05 +04:00
|
|
|
/**
|
|
|
|
* Frame state bits. Any bits not listed here are reserved for future
|
|
|
|
* extensions, but must be stored by the frames.
|
|
|
|
*/
|
|
|
|
typedef PRUint32 nsFrameState;
|
|
|
|
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_IN_REFLOW 0x00000001
|
1998-05-29 06:09:18 +04:00
|
|
|
|
|
|
|
// This bit is set when a frame is created. After it has been reflowed
|
|
|
|
// once (during the DidReflow with a finished state) the bit is
|
|
|
|
// cleared.
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_FIRST_REFLOW 0x00000002
|
1998-05-12 08:17:56 +04:00
|
|
|
|
1999-02-13 08:58:28 +03:00
|
|
|
// If this bit is is set, then the view position and size should be
|
1998-10-17 00:09:32 +04:00
|
|
|
// kept in sync with the frame position and size. If the bit is not
|
|
|
|
// set then it's the responsibility of the frame itself (or whoever
|
|
|
|
// created the view) to position and size its associated view
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_SYNC_FRAME_AND_VIEW 0x00000004
|
1998-10-17 00:09:32 +04:00
|
|
|
|
1999-02-13 08:58:28 +03:00
|
|
|
// If this bit is set, then there is a child frame in the frame that
|
1998-10-31 01:04:56 +03:00
|
|
|
// extends outside this frame's bounding box. The implication is that
|
|
|
|
// the frames rect does not completely cover its children and
|
|
|
|
// therefore operations like rendering and hit testing (for example)
|
|
|
|
// must operate differently.
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_OUTSIDE_CHILDREN 0x00000008
|
1998-10-31 01:04:56 +03:00
|
|
|
|
1999-02-13 08:58:28 +03:00
|
|
|
// If this bit is set, then a reference to the frame is being held
|
1998-11-19 03:43:36 +03:00
|
|
|
// elsewhere. The frame may want to send a notification when it is
|
|
|
|
// destroyed to allow these references to be cleared.
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_EXTERNAL_REFERENCE 0x00000010
|
1998-11-19 03:43:36 +03:00
|
|
|
|
1999-02-13 08:58:28 +03:00
|
|
|
// If this bit is set, then the frame is a replaced element. For example,
|
|
|
|
// a frame displaying an image
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_REPLACED_ELEMENT 0x00000020
|
1999-02-13 08:58:28 +03:00
|
|
|
|
1999-04-05 07:44:07 +04:00
|
|
|
// If this bit is set, then the frame corresponds to generated content
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_GENERATED_CONTENT 0x00000040
|
1999-04-05 07:44:07 +04:00
|
|
|
|
1999-04-14 01:48:35 +04:00
|
|
|
// If this bit is set, then the frame has requested one or more image
|
|
|
|
// loads via the nsIPresContext.StartLoadImage API at some time during
|
|
|
|
// its lifetime.
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_HAS_LOADED_IMAGES 0x00000080
|
1999-04-14 01:48:35 +04:00
|
|
|
|
1999-04-25 21:20:53 +04:00
|
|
|
// If this bit is set, then the frame is has been moved out of the flow,
|
|
|
|
// e.g., it is absolutely positioned or floated
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_OUT_OF_FLOW 0x00000100
|
1999-04-25 21:20:53 +04:00
|
|
|
|
1999-04-26 08:02:04 +04:00
|
|
|
// If this bit is set, then the frame reflects content that may be selected
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_SELECTED_CONTENT 0x00000200
|
1999-04-26 08:02:04 +04:00
|
|
|
|
1999-07-24 06:33:07 +04:00
|
|
|
// If this bit is set, then the frame is dirty and needs to be reflowed.
|
|
|
|
// This bit is set when the frame is first created
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_IS_DIRTY 0x00000400
|
1999-07-22 03:47:01 +04:00
|
|
|
|
1999-08-28 01:39:26 +04:00
|
|
|
// If this bit is set then the frame is unflowable.
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_IS_UNFLOWABLE 0x00000800
|
1999-08-28 01:39:26 +04:00
|
|
|
|
2000-01-12 11:28:24 +03:00
|
|
|
// If this bit is set, the frame has dirty children.
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_HAS_DIRTY_CHILDREN 0x00001000
|
2000-01-12 11:28:24 +03:00
|
|
|
|
2000-02-03 03:51:37 +03:00
|
|
|
// If this bit is set, the frame has an associated view
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_HAS_VIEW 0x00002000
|
2000-02-03 03:51:37 +03:00
|
|
|
|
2000-05-04 12:35:42 +04:00
|
|
|
// If this bit is set, the frame was created from anonymous content.
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_INDEPENDENT_SELECTION 0x00004000
|
2000-05-04 12:35:42 +04:00
|
|
|
|
2000-05-25 23:58:51 +04:00
|
|
|
// If this bit is set, the frame is "special" (lame term, I know),
|
|
|
|
// which means that it is part of the mangled frame hierarchy that
|
|
|
|
// results when an inline has been split because of a nested block.
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_IS_SPECIAL 0x00008000
|
2000-05-25 23:58:51 +04:00
|
|
|
|
2001-02-23 15:31:28 +03:00
|
|
|
// If this bit is set, the frame doesn't allow ignorable whitespace as
|
|
|
|
// children. For example, the whitespace between <table>\n<tr>\n<td>
|
|
|
|
// will be excluded during the construction of children.
|
|
|
|
// The bit is set when the frame is first created and remain
|
|
|
|
// unchanged during the life-time of the frame.
|
|
|
|
#define NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE 0x00010000
|
1999-01-09 03:11:40 +03:00
|
|
|
|
2001-03-09 06:13:03 +03:00
|
|
|
#ifdef IBMBIDI
|
|
|
|
// If this bit is set, the frame itself is a bidi continuation,
|
|
|
|
// or is incomplete (its next sibling is a bidi continuation)
|
2001-03-10 03:15:16 +03:00
|
|
|
#define NS_FRAME_IS_BIDI 0x00020000
|
2001-03-09 06:13:03 +03:00
|
|
|
#endif
|
2001-02-23 15:31:28 +03:00
|
|
|
|
2001-03-30 09:25:49 +04:00
|
|
|
// If this bit is set the frame has descendant with a view
|
|
|
|
#define NS_FRAME_HAS_CHILD_WITH_VIEW 0x00040000
|
|
|
|
|
2001-02-23 15:31:28 +03:00
|
|
|
// The lower 20 bits of the frame state word are reserved by this API.
|
|
|
|
#define NS_FRAME_RESERVED 0x000FFFFF
|
|
|
|
|
|
|
|
// The upper 12 bits of the frame state word are reserved for frame
|
1999-01-09 03:11:40 +03:00
|
|
|
// implementations.
|
2001-02-23 15:31:28 +03:00
|
|
|
#define NS_FRAME_IMPL_RESERVED 0xFFF00000
|
1999-01-09 03:11:40 +03:00
|
|
|
|
1998-05-14 04:47:05 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
1998-12-18 18:54:23 +03:00
|
|
|
enum nsFramePaintLayer {
|
|
|
|
eFramePaintLayer_Underlay = 0,
|
|
|
|
eFramePaintLayer_Content = 1,
|
1998-12-21 19:40:46 +03:00
|
|
|
eFramePaintLayer_Overlay = 2
|
1998-12-18 18:54:23 +03:00
|
|
|
};
|
|
|
|
|
1999-02-02 03:23:40 +03:00
|
|
|
enum nsSelectionAmount {
|
1999-02-10 21:55:25 +03:00
|
|
|
eSelectCharacter = 0,
|
|
|
|
eSelectWord = 1,
|
|
|
|
eSelectLine = 2, //previous drawn line in flow.
|
1999-09-08 03:40:17 +04:00
|
|
|
eSelectBeginLine = 3,
|
|
|
|
eSelectEndLine = 4,
|
1999-09-26 03:33:02 +04:00
|
|
|
eSelectNoAmount = 5, //just bounce back current offset.
|
2000-05-17 02:48:28 +04:00
|
|
|
eSelectDir = 6, //select next/previous frame based on direction
|
|
|
|
eSelectParagraph = 7 //select a "paragraph"
|
1999-02-02 03:23:40 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
enum nsDirection {
|
1999-02-10 21:55:25 +03:00
|
|
|
eDirNext = 0,
|
|
|
|
eDirPrevious= 1
|
1999-02-02 03:23:40 +03:00
|
|
|
};
|
|
|
|
|
1999-05-20 04:52:00 +04:00
|
|
|
enum nsSpread {
|
|
|
|
eSpreadNone = 0,
|
|
|
|
eSpreadAcross = 1,
|
|
|
|
eSpreadDown = 2
|
|
|
|
};
|
|
|
|
|
2000-09-13 02:45:33 +04:00
|
|
|
enum nsContextProviderRelationship {
|
|
|
|
eContextProvider_Ancestor = 0,
|
|
|
|
eContextProvider_Descendant = 1
|
|
|
|
};
|
|
|
|
|
1999-10-30 06:52:11 +04:00
|
|
|
// Carried out margin flags
|
|
|
|
#define NS_CARRIED_TOP_MARGIN_IS_AUTO 0x1
|
|
|
|
#define NS_CARRIED_BOTTOM_MARGIN_IS_AUTO 0x2
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
// For HTML reflow we rename with the different paint layers are
|
|
|
|
// actually used for.
|
|
|
|
#define NS_FRAME_PAINT_LAYER_BACKGROUND eFramePaintLayer_Underlay
|
|
|
|
#define NS_FRAME_PAINT_LAYER_FLOATERS eFramePaintLayer_Content
|
|
|
|
#define NS_FRAME_PAINT_LAYER_FOREGROUND eFramePaintLayer_Overlay
|
|
|
|
#define NS_FRAME_PAINT_LAYER_DEBUG eFramePaintLayer_Overlay
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reflow status returned by the reflow methods.
|
|
|
|
*
|
|
|
|
* NS_FRAME_NOT_COMPLETE bit flag means the frame does not map all its
|
|
|
|
* content, and that the parent frame should create a continuing frame.
|
|
|
|
* If this bit isn't set it means the frame does map all its content.
|
|
|
|
*
|
|
|
|
* NS_FRAME_REFLOW_NEXTINFLOW bit flag means that the next-in-flow is
|
|
|
|
* dirty, and also needs to be reflowed. This status only makes sense
|
|
|
|
* for a frame that is not complete, i.e. you wouldn't set both
|
|
|
|
* NS_FRAME_COMPLETE and NS_FRAME_REFLOW_NEXTINFLOW
|
|
|
|
*
|
|
|
|
* The low 8 bits of the nsReflowStatus are reserved for future extensions;
|
|
|
|
* the remaining 24 bits are zero (and available for extensions; however
|
|
|
|
* API's that accept/return nsReflowStatus must not receive/return any
|
|
|
|
* extension bits).
|
|
|
|
*
|
|
|
|
* @see #Reflow()
|
|
|
|
*/
|
|
|
|
typedef PRUint32 nsReflowStatus;
|
|
|
|
|
|
|
|
#define NS_FRAME_COMPLETE 0 // Note: not a bit!
|
|
|
|
#define NS_FRAME_NOT_COMPLETE 0x1
|
|
|
|
#define NS_FRAME_REFLOW_NEXTINFLOW 0x2
|
|
|
|
|
|
|
|
#define NS_FRAME_IS_COMPLETE(status) \
|
|
|
|
(0 == ((status) & NS_FRAME_NOT_COMPLETE))
|
|
|
|
|
|
|
|
#define NS_FRAME_IS_NOT_COMPLETE(status) \
|
|
|
|
(0 != ((status) & NS_FRAME_NOT_COMPLETE))
|
|
|
|
|
|
|
|
// This macro tests to see if an nsReflowStatus is an error value
|
|
|
|
// or just a regular return value
|
|
|
|
#define NS_IS_REFLOW_ERROR(_status) (PRInt32(_status) < 0)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extensions to the reflow status bits defined by nsIFrameReflow
|
|
|
|
*/
|
|
|
|
|
|
|
|
// This bit is set, when a break is requested. This bit is orthogonal
|
|
|
|
// to the nsIFrame::nsReflowStatus completion bits.
|
|
|
|
#define NS_INLINE_BREAK 0x0100
|
|
|
|
|
|
|
|
// When a break is requested, this bit when set indicates that the
|
|
|
|
// break should occur after the frame just reflowed; when the bit is
|
|
|
|
// clear the break should occur before the frame just reflowed.
|
|
|
|
#define NS_INLINE_BREAK_BEFORE 0x0000
|
|
|
|
#define NS_INLINE_BREAK_AFTER 0x0200
|
|
|
|
|
|
|
|
// The type of break requested can be found in these bits.
|
|
|
|
#define NS_INLINE_BREAK_TYPE_MASK 0xF000
|
|
|
|
|
|
|
|
//----------------------------------------
|
|
|
|
// Macros that use those bits
|
|
|
|
|
|
|
|
#define NS_INLINE_IS_BREAK(_status) \
|
|
|
|
(0 != ((_status) & NS_INLINE_BREAK))
|
|
|
|
|
|
|
|
#define NS_INLINE_IS_BREAK_AFTER(_status) \
|
|
|
|
(0 != ((_status) & NS_INLINE_BREAK_AFTER))
|
|
|
|
|
|
|
|
#define NS_INLINE_IS_BREAK_BEFORE(_status) \
|
|
|
|
(NS_INLINE_BREAK == ((_status) & (NS_INLINE_BREAK|NS_INLINE_BREAK_AFTER)))
|
|
|
|
|
|
|
|
#define NS_INLINE_GET_BREAK_TYPE(_status) (((_status) >> 12) & 0xF)
|
|
|
|
|
|
|
|
#define NS_INLINE_MAKE_BREAK_TYPE(_type) ((_type) << 12)
|
|
|
|
|
|
|
|
// Construct a line-break-before status. Note that there is no
|
|
|
|
// completion status for a line-break before because we *know* that
|
|
|
|
// the frame will be reflowed later and hence it's current completion
|
|
|
|
// status doesn't matter.
|
|
|
|
#define NS_INLINE_LINE_BREAK_BEFORE() \
|
|
|
|
(NS_INLINE_BREAK | NS_INLINE_BREAK_BEFORE | \
|
|
|
|
NS_INLINE_MAKE_BREAK_TYPE(NS_STYLE_CLEAR_LINE))
|
|
|
|
|
|
|
|
// Take a completion status and add to it the desire to have a
|
|
|
|
// line-break after. For this macro we do need the completion status
|
|
|
|
// because the user of the status will need to know whether to
|
|
|
|
// continue the frame or not.
|
|
|
|
#define NS_INLINE_LINE_BREAK_AFTER(_completionStatus) \
|
|
|
|
((_completionStatus) | NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER | \
|
|
|
|
NS_INLINE_MAKE_BREAK_TYPE(NS_STYLE_CLEAR_LINE))
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DidReflow status values.
|
|
|
|
*/
|
|
|
|
typedef PRBool nsDidReflowStatus;
|
|
|
|
|
|
|
|
#define NS_FRAME_REFLOW_NOT_FINISHED PR_FALSE
|
|
|
|
#define NS_FRAME_REFLOW_FINISHED PR_TRUE
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
|
|
|
* A frame in the layout model. This interface is supported by all frame
|
|
|
|
* objects.
|
|
|
|
*
|
1998-11-09 22:40:27 +03:00
|
|
|
* Frames can have multiple child lists: the default unnamed child list
|
|
|
|
* (referred to as the <i>principal</i> child list, and additional named
|
|
|
|
* child lists. There is an ordering of frames within a child list, but
|
|
|
|
* there is no order defined between frames in different child lists of
|
|
|
|
* the same parent frame.
|
1998-09-10 23:32:14 +04:00
|
|
|
*
|
1999-07-22 06:24:52 +04:00
|
|
|
* Frames are NOT reference counted. Use the Destroy() member function
|
|
|
|
* to destroy a frame. The lifetime of the frame hierarchy is bounded by the
|
1998-11-09 22:40:27 +03:00
|
|
|
* lifetime of the presentation shell which owns the frames.
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
1998-09-24 05:50:16 +04:00
|
|
|
class nsIFrame : public nsISupports
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
|
|
|
public:
|
2001-01-04 23:44:42 +03:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFRAME_IID)
|
1998-12-03 09:31:43 +03:00
|
|
|
/**
|
1998-12-04 09:13:18 +03:00
|
|
|
* Called to initialize the frame. This is called immediately after creating
|
|
|
|
* the frame.
|
|
|
|
*
|
1999-02-25 06:27:57 +03:00
|
|
|
* If the frame is a continuing frame, then aPrevInFlow indicates the previous
|
|
|
|
* frame (the frame that was split). You should connect the continuing frame to
|
|
|
|
* its prev-in-flow, e.g. by using the AppendToFlow() function
|
|
|
|
*
|
|
|
|
* If you want a view associated with your frame, you should create the view
|
1998-12-04 09:13:18 +03:00
|
|
|
* now.
|
1998-12-03 09:31:43 +03:00
|
|
|
*
|
|
|
|
* @param aContent the content object associated with the frame
|
1998-12-29 06:38:16 +03:00
|
|
|
* @param aGeometricParent the geometric parent frame
|
|
|
|
* @param aContentParent the content parent frame
|
1998-12-03 09:31:43 +03:00
|
|
|
* @param aContext the style context associated with the frame
|
1999-02-25 06:27:57 +03:00
|
|
|
* @param aPrevInFlow the prev-in-flow frame
|
|
|
|
* @see #AppendToFlow()
|
1998-12-03 09:31:43 +03:00
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Init(nsIPresContext* aPresContext,
|
1998-12-03 09:31:43 +03:00
|
|
|
nsIContent* aContent,
|
1999-01-14 08:16:23 +03:00
|
|
|
nsIFrame* aParent,
|
1999-02-25 06:27:57 +03:00
|
|
|
nsIStyleContext* aContext,
|
|
|
|
nsIFrame* aPrevInFlow) = 0;
|
1998-12-03 09:31:43 +03:00
|
|
|
|
1999-07-22 06:24:52 +04:00
|
|
|
/**
|
|
|
|
* Destroys this frame and each of its child frames (recursively calls
|
|
|
|
* Destroy() for each child)
|
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Destroy(nsIPresContext* aPresContext) = 0;
|
1999-07-22 06:24:52 +04:00
|
|
|
|
1998-09-10 23:32:14 +04:00
|
|
|
/**
|
1998-11-10 09:05:32 +03:00
|
|
|
* Called to set the initial list of frames. This happens after the frame
|
1998-12-03 09:31:43 +03:00
|
|
|
* has been initialized.
|
1998-09-10 23:32:14 +04:00
|
|
|
*
|
1998-11-10 09:05:32 +03:00
|
|
|
* This is only called once for a given child list, and won't be called
|
|
|
|
* at all for child lists with no initial list of frames.
|
1998-09-10 23:32:14 +04:00
|
|
|
*
|
1998-11-10 09:05:32 +03:00
|
|
|
* @param aListName the name of the child list. A NULL pointer for the atom
|
|
|
|
* name means the unnamed principal child list
|
1999-07-24 06:33:07 +04:00
|
|
|
* @param aChildList list of child frames. Each of the frames has its
|
1999-07-27 18:15:42 +04:00
|
|
|
* NS_FRAME_IS_DIRTY bit set
|
1998-11-10 09:05:32 +03:00
|
|
|
* @return NS_ERROR_INVALID_ARG if there is no child list with the specified
|
|
|
|
* name,
|
|
|
|
* NS_ERROR_UNEXPECTED if the frame is an atomic frame or if the
|
|
|
|
* initial list of frames has already been set for that child list,
|
|
|
|
* NS_OK otherwise
|
1998-12-03 09:31:43 +03:00
|
|
|
* @see #Init()
|
1998-09-10 23:32:14 +04:00
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
|
1998-11-10 09:05:32 +03:00
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList) = 0;
|
1998-09-10 23:32:14 +04:00
|
|
|
|
1999-01-15 04:28:28 +03:00
|
|
|
/**
|
|
|
|
* This method is responsible for appending frames to the frame
|
1999-07-22 08:32:31 +04:00
|
|
|
* list. The implementation should append the frames to the specified
|
1999-07-22 06:24:52 +04:00
|
|
|
* child list and then generate a reflow command.
|
1999-01-15 04:28:28 +03:00
|
|
|
*
|
|
|
|
* @param aListName the name of the child list. A NULL pointer for the atom
|
|
|
|
* name means the unnamed principal child list
|
1999-07-24 06:33:07 +04:00
|
|
|
* @param aFrameList list of child frames to append. Each of the frames has
|
1999-07-27 18:15:42 +04:00
|
|
|
* its NS_FRAME_IS_DIRTY bit set
|
1999-01-15 04:28:28 +03:00
|
|
|
* @return NS_ERROR_INVALID_ARG if there is no child list with the specified
|
|
|
|
* name,
|
1999-07-27 18:15:42 +04:00
|
|
|
* NS_ERROR_UNEXPECTED if the frame is an atomic frame,
|
1999-01-15 04:28:28 +03:00
|
|
|
* NS_OK otherwise
|
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
|
1999-01-15 04:28:28 +03:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aFrameList) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method is responsible for inserting frames into the frame
|
1999-07-22 08:32:31 +04:00
|
|
|
* list. The implementation should insert the new frames into the specified
|
1999-07-22 06:24:52 +04:00
|
|
|
* child list and then generate a reflow command.
|
1999-01-15 04:28:28 +03:00
|
|
|
*
|
|
|
|
* @param aListName the name of the child list. A NULL pointer for the atom
|
|
|
|
* name means the unnamed principal child list
|
|
|
|
* @param aPrevFrame the frame to insert frames <b>after</b>
|
1999-07-24 06:33:07 +04:00
|
|
|
* @param aFrameList list of child frames to insert <b>after</b> aPrevFrame.
|
1999-07-27 18:15:42 +04:00
|
|
|
* Each of the frames has its NS_FRAME_IS_DIRTY bit set
|
1999-01-15 04:28:28 +03:00
|
|
|
* @return NS_ERROR_INVALID_ARG if there is no child list with the specified
|
|
|
|
* name,
|
1999-07-27 18:15:42 +04:00
|
|
|
* NS_ERROR_UNEXPECTED if the frame is an atomic frame,
|
1999-01-15 04:28:28 +03:00
|
|
|
* NS_OK otherwise
|
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD InsertFrames(nsIPresContext* aPresContext,
|
1999-01-15 04:28:28 +03:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsIFrame* aFrameList) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method is responsible for removing a frame in the frame
|
|
|
|
* list. The implementation should do something with the removed frame
|
|
|
|
* and then generate a reflow command. The implementation is responsible
|
|
|
|
* for destroying aOldFrame (the caller mustn't destroy aOldFrame).
|
|
|
|
*
|
|
|
|
* @param aListName the name of the child list. A NULL pointer for the atom
|
|
|
|
* name means the unnamed principal child list
|
|
|
|
* @param aOldFrame the frame to remove
|
|
|
|
* @return NS_ERROR_INVALID_ARG if there is no child list with the specified
|
|
|
|
* name,
|
1999-07-27 18:15:42 +04:00
|
|
|
* NS_ERROR_FAILURE if the child frame is not in the specified
|
|
|
|
* child list,
|
|
|
|
* NS_ERROR_UNEXPECTED if the frame is an atomic frame,
|
1999-01-15 04:28:28 +03:00
|
|
|
* NS_OK otherwise
|
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD RemoveFrame(nsIPresContext* aPresContext,
|
1999-01-15 04:28:28 +03:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aOldFrame) = 0;
|
1999-07-22 08:32:31 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This method is responsible for replacing the old frame with the
|
|
|
|
* new frame. The old frame should be destroyed and the new frame inserted
|
|
|
|
* in its place in the specified child list.
|
|
|
|
*
|
|
|
|
* @param aListName the name of the child list. A NULL pointer for the atom
|
|
|
|
* name means the unnamed principal child list
|
|
|
|
* @param aOldFrame the frame to remove
|
1999-07-24 06:33:07 +04:00
|
|
|
* @param aNewFrame the frame to replace it with. The new frame has its
|
1999-07-27 18:15:42 +04:00
|
|
|
* NS_FRAME_IS_DIRTY bit set
|
1999-07-22 08:32:31 +04:00
|
|
|
* @return NS_ERROR_INVALID_ARG if there is no child list with the specified
|
|
|
|
* name,
|
1999-07-27 18:15:42 +04:00
|
|
|
* NS_ERROR_FAILURE if the old child frame is not in the specified
|
|
|
|
* child list,
|
|
|
|
* NS_ERROR_UNEXPECTED if the frame is an atomic frame,
|
1999-07-22 08:32:31 +04:00
|
|
|
* NS_OK otherwise
|
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD ReplaceFrame(nsIPresContext* aPresContext,
|
1999-07-22 08:32:31 +04:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aOldFrame,
|
|
|
|
nsIFrame* aNewFrame) = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the content object associated with this frame. Adds a reference to
|
|
|
|
* the content object so the caller must do a release.
|
|
|
|
*
|
|
|
|
* @see nsISupports#Release()
|
|
|
|
*/
|
2001-10-24 04:01:09 +04:00
|
|
|
nsresult GetContent(nsIContent** aContent) const { *aContent = mContent; NS_IF_ADDREF(*aContent); return NS_OK; }
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1999-01-22 21:58:14 +03:00
|
|
|
/**
|
|
|
|
* Get the offsets of the frame. most will be 0,0
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetOffsets(PRInt32 &start, PRInt32 &end) const = 0;
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
|
|
|
* Get the style context associated with this frame. Note that GetStyleContext()
|
|
|
|
* adds a reference to the style context so the caller must do a release.
|
|
|
|
*
|
1998-04-17 05:41:24 +04:00
|
|
|
* @see nsISupports#Release()
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
2001-10-24 04:01:09 +04:00
|
|
|
nsresult GetStyleContext(nsIStyleContext** aStyleContext) const {
|
2001-10-24 23:12:02 +04:00
|
|
|
*aStyleContext = mStyleContext; NS_IF_ADDREF(*aStyleContext); return NS_OK;
|
2001-10-24 04:01:09 +04:00
|
|
|
}
|
|
|
|
nsresult SetStyleContext(nsIPresContext* aPresContext, nsIStyleContext* aContext) {
|
|
|
|
if (aContext != mStyleContext) {
|
|
|
|
NS_IF_RELEASE(mStyleContext);
|
|
|
|
if (nsnull != aContext) {
|
|
|
|
mStyleContext = aContext;
|
|
|
|
NS_ADDREF(aContext);
|
|
|
|
DidSetStyleContext(aPresContext);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Style post processing hook
|
|
|
|
NS_IMETHOD DidSetStyleContext(nsIPresContext* aPresContext) = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
1998-10-08 22:21:32 +04:00
|
|
|
* Get the style data associated with this frame.
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
2001-10-24 04:01:09 +04:00
|
|
|
nsresult GetStyleData(nsStyleStructID aSID,
|
|
|
|
const nsStyleStruct*& aStyleStruct) const {
|
|
|
|
NS_ASSERTION(mStyleContext, "No style context found!");
|
|
|
|
aStyleStruct = mStyleContext->GetStyleData(aSID);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2001-02-07 12:57:26 +03:00
|
|
|
// Fill a style struct with data
|
2001-10-24 04:01:09 +04:00
|
|
|
nsresult GetStyle(nsStyleStructID aSID, const nsStyleStruct** aStruct) const {
|
|
|
|
NS_ASSERTION(mStyleContext, "No style context found!");
|
|
|
|
mStyleContext->GetStyle(aSID, aStruct);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2001-02-07 12:57:26 +03:00
|
|
|
// Utility function: more convenient than 2 calls to GetStyleData to get border and padding
|
|
|
|
NS_IMETHOD CalcBorderPadding(nsMargin& aBorderPadding) const = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1999-09-04 03:35:14 +04:00
|
|
|
/**
|
|
|
|
* These methods are to access any additional style contexts that
|
|
|
|
* the frame may be holding. These are contexts that are children
|
|
|
|
* of the frame's primary context and are NOT used as style contexts
|
|
|
|
* for any child frames. These contexts also MUST NOT have any child
|
|
|
|
* contexts whatsoever. If you need to insert style contexts into the
|
|
|
|
* style tree, then you should create pseudo element frames to own them
|
1999-09-21 11:48:34 +04:00
|
|
|
* The indicies must be consecutive and implementations MUST return an
|
|
|
|
* NS_ERROR_INVALID_ARG if asked for an index that is out of range.
|
1999-09-04 03:35:14 +04:00
|
|
|
*/
|
|
|
|
NS_IMETHOD GetAdditionalStyleContext(PRInt32 aIndex,
|
|
|
|
nsIStyleContext** aStyleContext) const = 0;
|
|
|
|
NS_IMETHOD SetAdditionalStyleContext(PRInt32 aIndex,
|
|
|
|
nsIStyleContext* aStyleContext) = 0;
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
1999-01-14 08:16:23 +03:00
|
|
|
* Accessor functions for geometric parent
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
2001-10-24 04:01:09 +04:00
|
|
|
nsresult GetParent(nsIFrame** aParent) const { *aParent = mParent; return NS_OK; }
|
2001-10-30 03:01:39 +03:00
|
|
|
NS_IMETHOD SetParent(const nsIFrame* aParent) { mParent = (nsIFrame*)aParent; return NS_OK; }
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Bounding rect of the frame. The values are in twips, and the origin is
|
|
|
|
* relative to the upper-left of the geometric parent. The size includes the
|
|
|
|
* content area, borders, and padding.
|
1999-11-19 18:33:29 +03:00
|
|
|
*
|
|
|
|
* Note: moving or sizing the frame does not affect the view's size or
|
|
|
|
* position.
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
2001-10-24 04:01:09 +04:00
|
|
|
nsresult GetRect(nsRect& aRect) const {
|
|
|
|
aRect = mRect;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult GetOrigin(nsPoint& aPoint) const {
|
|
|
|
aPoint.x = mRect.x;
|
|
|
|
aPoint.y = mRect.y;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult GetSize(nsSize& aSize) const {
|
|
|
|
aSize.width = mRect.width;
|
|
|
|
aSize.height = mRect.height;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult SetRect(nsIPresContext* aPresContext,
|
|
|
|
const nsRect& aRect) {
|
|
|
|
MoveTo(aPresContext, aRect.x, aRect.y);
|
|
|
|
SizeTo(aPresContext, aRect.width, aRect.height);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult MoveTo(nsIPresContext* aPresContext,
|
|
|
|
nscoord aX,
|
|
|
|
nscoord aY) {
|
|
|
|
mRect.x = aX;
|
|
|
|
mRect.y = aY;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult SizeTo(nsIPresContext* aPresContext,
|
|
|
|
nscoord aWidth,
|
|
|
|
nscoord aHeight) {
|
|
|
|
mRect.width = aWidth;
|
|
|
|
mRect.height = aHeight;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
1998-04-17 05:41:24 +04:00
|
|
|
|
1998-11-09 22:59:33 +03:00
|
|
|
/**
|
|
|
|
* Used to iterate the list of additional child list names. Returns the atom
|
|
|
|
* name for the additional child list at the specified 0-based index, or a
|
|
|
|
* NULL pointer if there are no more named child lists.
|
|
|
|
*
|
|
|
|
* Note that the list is only the additional named child lists and does not
|
|
|
|
* include the unnamed principal child list.
|
|
|
|
*
|
|
|
|
* @return NS_ERROR_INVALID_ARG if the index is < 0 and NS_OK otherwise
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
|
1999-02-10 05:25:01 +03:00
|
|
|
nsIAtom** aListName) const = 0;
|
1998-11-09 22:59:33 +03:00
|
|
|
|
1998-04-17 05:41:24 +04:00
|
|
|
/**
|
1998-11-09 22:40:27 +03:00
|
|
|
* Get the first child frame from the specified child list.
|
1998-10-09 01:03:59 +04:00
|
|
|
*
|
1998-11-09 22:40:27 +03:00
|
|
|
* @param aListName the name of the child list. A NULL pointer for the atom
|
|
|
|
* name means the unnamed principal child list
|
|
|
|
* @return NS_ERROR_INVALID_ARG if there is no child list with the specified name
|
|
|
|
* @see #GetAdditionalListName()
|
|
|
|
*/
|
2000-01-22 04:16:50 +03:00
|
|
|
NS_IMETHOD FirstChild(nsIPresContext* aPresContext,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame** aFirstChild) const = 0;
|
1998-11-09 22:40:27 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Child frames are linked together in a singly-linked
|
1998-04-17 05:41:24 +04:00
|
|
|
*/
|
2001-10-24 04:01:09 +04:00
|
|
|
nsresult GetNextSibling(nsIFrame** aNextSibling) const {
|
|
|
|
*aNextSibling = mNextSibling;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult SetNextSibling(nsIFrame* aNextSibling) {
|
|
|
|
mNextSibling = aNextSibling;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
1998-12-18 18:54:23 +03:00
|
|
|
* Paint is responsible for painting the a frame. The aWhichLayer
|
|
|
|
* argument indicates which layer of painting should be done during
|
|
|
|
* the call.
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Paint(nsIPresContext* aPresContext,
|
1998-04-17 05:41:24 +04:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
1998-12-18 18:54:23 +03:00
|
|
|
const nsRect& aDirtyRect,
|
2001-09-19 16:35:19 +04:00
|
|
|
nsFramePaintLayer aWhichLayer,
|
|
|
|
PRUint32 aFlags = 0) = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
1998-10-08 22:21:32 +04:00
|
|
|
* Event handling of GUI events.
|
|
|
|
*
|
|
|
|
* @param aEvent event structure describing the type of event and rge widget
|
|
|
|
* where the event originated
|
|
|
|
* @param aEventStatus a return value indicating whether the event was handled
|
|
|
|
* and whether default processing should be done
|
|
|
|
*
|
|
|
|
* XXX From a frame's perspective it's unclear what the effect of the event status
|
|
|
|
* is. Does it cause the event to continue propagating through the frame hierarchy
|
|
|
|
* or is it just returned to the widgets?
|
|
|
|
*
|
|
|
|
* @see nsGUIEvent
|
|
|
|
* @see nsEventStatus
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD HandleEvent(nsIPresContext* aPresContext,
|
1998-04-17 05:41:24 +04:00
|
|
|
nsGUIEvent* aEvent,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsEventStatus* aEventStatus) = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2000-02-11 04:24:59 +03:00
|
|
|
NS_IMETHOD GetContentForEvent(nsIPresContext* aPresContext,
|
|
|
|
nsEvent* aEvent,
|
|
|
|
nsIContent** aContent) = 0;
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD GetContentAndOffsetsFromPoint(nsIPresContext* aCX,
|
1999-09-30 00:04:05 +04:00
|
|
|
const nsPoint& aPoint,
|
|
|
|
nsIContent ** aNewContent,
|
|
|
|
PRInt32& aContentOffset,
|
1999-10-13 05:16:09 +04:00
|
|
|
PRInt32& aContentOffsetEnd,
|
|
|
|
PRBool& aBeginFrameContent) = 0;
|
1999-09-30 00:04:05 +04:00
|
|
|
|
1998-08-28 20:02:33 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
1998-11-18 08:25:26 +03:00
|
|
|
* Get the cursor for a given frame.
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD GetCursor(nsIPresContext* aPresContext,
|
1998-11-18 08:25:26 +03:00
|
|
|
nsPoint& aPoint,
|
|
|
|
PRInt32& aCursor) = 0;
|
|
|
|
|
2000-03-22 05:43:08 +03:00
|
|
|
/**
|
|
|
|
* Get the frame that should receive events for a given point in the
|
|
|
|
* coordinate space of this frame's parent, if the frame is painted in
|
|
|
|
* the given paint layer. A frame should return itself if it should
|
|
|
|
* recieve the events. A successful return value indicates that a
|
|
|
|
* point was found.
|
|
|
|
*/
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
|
|
|
|
const nsPoint& aPoint,
|
2000-03-22 05:43:08 +03:00
|
|
|
nsFramePaintLayer aWhichLayer,
|
1998-11-18 08:25:26 +03:00
|
|
|
nsIFrame** aFrame) = 0;
|
|
|
|
|
1999-02-12 03:02:31 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a point (in the frame's coordinate space) given an offset into
|
|
|
|
* the content. This point should be on the baseline of text with
|
|
|
|
* the correct horizontal offset
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetPointFromOffset(nsIPresContext* inPresContext,
|
2000-01-07 17:36:43 +03:00
|
|
|
nsIRenderingContext* inRendContext,
|
1999-02-12 03:02:31 +03:00
|
|
|
PRInt32 inOffset,
|
|
|
|
nsPoint* outPoint) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the child frame of this frame which contains the given
|
|
|
|
* content offset. outChildFrame may be this frame, or nsnull on return.
|
|
|
|
* outContentOffset returns the content offset relative to the start
|
1999-09-11 04:18:02 +04:00
|
|
|
* of the returned node. You can also pass a hint which tells the method
|
|
|
|
* to stick to the end of the first found frame or the beginning of the
|
|
|
|
* next in case the offset falls on a boundary.
|
1999-02-12 03:02:31 +03:00
|
|
|
*/
|
|
|
|
NS_IMETHOD GetChildFrameContainingOffset(PRInt32 inContentOffset,
|
1999-09-11 04:18:02 +04:00
|
|
|
PRBool inHint,//false stick left
|
1999-02-12 03:02:31 +03:00
|
|
|
PRInt32* outFrameContentOffset,
|
|
|
|
nsIFrame* *outChildFrame) = 0;
|
|
|
|
|
1998-11-18 08:25:26 +03:00
|
|
|
/**
|
1998-05-14 04:47:05 +04:00
|
|
|
* Get the current frame-state value for this frame. aResult is
|
2001-10-24 04:01:09 +04:00
|
|
|
* filled in with the state bits.
|
1998-05-14 04:47:05 +04:00
|
|
|
*/
|
2001-10-24 04:01:09 +04:00
|
|
|
nsresult GetFrameState(nsFrameState* aResult) {
|
|
|
|
*aResult = mState;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
1998-05-14 04:47:05 +04:00
|
|
|
|
|
|
|
/**
|
2001-10-24 04:01:09 +04:00
|
|
|
* Set the current frame-state value for this frame.
|
1998-05-14 04:47:05 +04:00
|
|
|
*/
|
2001-10-24 04:01:09 +04:00
|
|
|
nsresult SetFrameState(nsFrameState aNewState) {
|
|
|
|
mState = aNewState;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
1998-05-14 04:47:05 +04:00
|
|
|
|
1998-05-08 08:45:37 +04:00
|
|
|
/**
|
|
|
|
* This call is invoked when content is changed in the content tree.
|
|
|
|
* The first frame that maps that content is asked to deal with the
|
1998-05-11 22:38:10 +04:00
|
|
|
* change by generating an incremental reflow command.
|
1998-05-08 08:45:37 +04:00
|
|
|
*
|
2001-01-17 01:10:04 +03:00
|
|
|
* @param aPresContext the presentation context
|
|
|
|
* @param aContent the content node that was changed
|
|
|
|
* @param aSubContent a hint to the frame about the change
|
1998-05-08 08:45:37 +04:00
|
|
|
*/
|
1998-09-30 03:41:59 +04:00
|
|
|
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
|
1998-05-08 08:45:37 +04:00
|
|
|
nsIContent* aChild,
|
|
|
|
nsISupports* aSubContent) = 0;
|
|
|
|
|
1998-09-18 23:53:27 +04:00
|
|
|
/**
|
|
|
|
* This call is invoked when the value of a content objects's attribute
|
1998-09-30 03:41:59 +04:00
|
|
|
* is changed.
|
|
|
|
* The first frame that maps that content is asked to deal
|
1999-09-10 09:50:02 +04:00
|
|
|
* with the change by doing whatever is appropriate.
|
1998-09-18 23:53:27 +04:00
|
|
|
*
|
|
|
|
* @param aChild the content object
|
|
|
|
* @param aAttribute the attribute whose value changed
|
1999-09-10 09:50:02 +04:00
|
|
|
* @param aHint the level of change that has already been dealt with
|
1998-09-18 23:53:27 +04:00
|
|
|
*/
|
1998-09-30 03:41:59 +04:00
|
|
|
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext,
|
1998-09-18 23:53:27 +04:00
|
|
|
nsIContent* aChild,
|
1999-10-16 03:16:45 +04:00
|
|
|
PRInt32 aNameSpaceID,
|
1998-09-30 03:41:59 +04:00
|
|
|
nsIAtom* aAttribute,
|
2001-08-25 06:01:08 +04:00
|
|
|
PRInt32 aModType,
|
1998-09-30 03:41:59 +04:00
|
|
|
PRInt32 aHint) = 0;
|
1998-09-18 23:53:27 +04:00
|
|
|
|
1999-09-10 09:50:02 +04:00
|
|
|
/**
|
|
|
|
* This call is invoked when the value of a content object's state
|
|
|
|
* is changed.
|
|
|
|
* The first frame that maps that content is asked to deal
|
|
|
|
* with the change by doing whatever is appropriate.
|
|
|
|
*
|
|
|
|
* @param aChild the content object
|
|
|
|
* @param aHint the level of change that has already been dealt with
|
|
|
|
*/
|
|
|
|
NS_IMETHOD ContentStateChanged(nsIPresContext* aPresContext,
|
|
|
|
nsIContent* aChild,
|
|
|
|
PRInt32 aHint) = 0;
|
|
|
|
|
1998-04-18 03:08:20 +04:00
|
|
|
/**
|
|
|
|
* Return how your frame can be split.
|
|
|
|
*/
|
1998-05-22 08:54:11 +04:00
|
|
|
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const = 0;
|
1998-04-18 03:08:20 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
1999-02-25 08:31:15 +03:00
|
|
|
* Flow member functions
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
1999-02-24 07:48:08 +03:00
|
|
|
NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const = 0;
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_IMETHOD SetPrevInFlow(nsIFrame*) = 0;
|
1999-02-24 07:48:08 +03:00
|
|
|
NS_IMETHOD GetNextInFlow(nsIFrame** aNextInFlow) const = 0;
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_IMETHOD SetNextInFlow(nsIFrame*) = 0;
|
|
|
|
|
1999-10-30 06:52:11 +04:00
|
|
|
/**
|
|
|
|
* Pre-reflow hook. Before a frame is reflowed this method will be called.
|
|
|
|
* This call will always be invoked at least once before a subsequent Reflow
|
|
|
|
* and DidReflow call. It may be called more than once, In general you will
|
|
|
|
* receive on WillReflow notification before each Reflow request.
|
|
|
|
*
|
|
|
|
* XXX Is this really the semantics we want? Because we have the NS_FRAME_IN_REFLOW
|
|
|
|
* bit we can ensure we don't call it more than once...
|
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD WillReflow(nsIPresContext* aPresContext) = 0;
|
1999-10-30 06:52:11 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The frame is given a maximum size and asked for its desired size.
|
|
|
|
* This is the frame's opportunity to reflow its children.
|
|
|
|
*
|
|
|
|
* @param aDesiredSize <i>out</i> parameter where you should return the
|
|
|
|
* desired size and ascent/descent info. You should include any
|
|
|
|
* space you want for border/padding in the desired size you return.
|
|
|
|
*
|
|
|
|
* It's okay to return a desired size that exceeds the max
|
|
|
|
* size if that's the smallest you can be, i.e. it's your
|
|
|
|
* minimum size.
|
|
|
|
*
|
|
|
|
* maxElementSize is an optional parameter for returning your
|
|
|
|
* maximum element size. If may be null in which case you
|
|
|
|
* don't have to compute a maximum element size. The
|
|
|
|
* maximum element size must be less than or equal to your
|
|
|
|
* desired size.
|
|
|
|
*
|
|
|
|
* For an incremental reflow you are responsible for invalidating
|
|
|
|
* any area within your frame that needs repainting (including
|
|
|
|
* borders). If your new desired size is different than your current
|
|
|
|
* size, then your parent frame is responsible for making sure that
|
|
|
|
* the difference between the two rects is repainted
|
|
|
|
*
|
|
|
|
* @param aReflowState information about your reflow including the reason
|
|
|
|
* for the reflow and the available space in which to lay out. Each
|
|
|
|
* dimension of the available space can either be constrained or
|
|
|
|
* unconstrained (a value of NS_UNCONSTRAINEDSIZE). If constrained
|
|
|
|
* you should choose a value that's less than or equal to the
|
|
|
|
* constrained size. If unconstrained you can choose as
|
|
|
|
* large a value as you like.
|
|
|
|
*
|
|
|
|
* Note that the available space can be negative. In this case you
|
|
|
|
* still must return an accurate desired size. If you're a container
|
|
|
|
* you must <b>always</b> reflow at least one frame regardless of the
|
|
|
|
* available space
|
|
|
|
*
|
|
|
|
* @param aStatus a return value indicating whether the frame is complete
|
|
|
|
* and whether the next-in-flow is dirty and needs to be reflowed
|
|
|
|
*/
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
|
1999-10-30 06:52:11 +04:00
|
|
|
nsHTMLReflowMetrics& aReflowMetrics,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Post-reflow hook. After a frame is reflowed this method will be called
|
|
|
|
* informing the frame that this reflow process is complete, and telling the
|
|
|
|
* frame the status returned by the Reflow member function.
|
|
|
|
*
|
|
|
|
* This call may be invoked many times, while NS_FRAME_IN_REFLOW is set, before
|
|
|
|
* it is finally called once with a NS_FRAME_REFLOW_COMPLETE value. When called
|
|
|
|
* with a NS_FRAME_REFLOW_COMPLETE value the NS_FRAME_IN_REFLOW bit in the
|
|
|
|
* frame state will be cleared.
|
|
|
|
*
|
|
|
|
* XXX This doesn't make sense. If the frame is reflowed but not complete, then
|
|
|
|
* the status should be NS_FRAME_NOT_COMPLETE and not NS_FRAME_COMPLETE
|
|
|
|
* XXX Don't we want the semantics to dictate that we only call this once for
|
|
|
|
* a given reflow?
|
|
|
|
*/
|
2001-12-07 17:51:12 +03:00
|
|
|
NS_IMETHOD DidReflow(nsIPresContext* aPresContext,
|
|
|
|
const nsHTMLReflowState* aReflowState,
|
|
|
|
nsDidReflowStatus aStatus) = 0;
|
1999-10-30 06:52:11 +04:00
|
|
|
|
|
|
|
// XXX Maybe these three should be a separate interface?
|
|
|
|
|
2000-07-29 02:29:28 +04:00
|
|
|
/**
|
|
|
|
* Helper method used by block reflow to identify runs of text so
|
|
|
|
* that proper word-breaking can be done.
|
|
|
|
*
|
|
|
|
* @param aContinueTextRun A frame should set aContinueTextRun to
|
|
|
|
* PR_TRUE if we can continue a "text run" through the frame. A
|
|
|
|
* text run is text that should be treated contiguously for line
|
|
|
|
* and word breaking.
|
|
|
|
*
|
|
|
|
* @return The return value is irrelevant.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD CanContinueTextRun(PRBool& aContinueTextRun) const = 0;
|
|
|
|
|
1999-10-30 06:52:11 +04:00
|
|
|
// Justification helper method used to distribute extra space in a
|
|
|
|
// line to leaf frames. aUsedSpace is filled in with the amount of
|
|
|
|
// space actually used.
|
|
|
|
NS_IMETHOD AdjustFrameSize(nscoord aExtraSpace, nscoord& aUsedSpace) = 0;
|
|
|
|
|
|
|
|
// Justification helper method that is used to remove trailing
|
|
|
|
// whitespace before justification.
|
|
|
|
NS_IMETHOD TrimTrailingWhiteSpace(nsIPresContext* aPresContext,
|
|
|
|
nsIRenderingContext& aRC,
|
|
|
|
nscoord& aDeltaWidth) = 0;
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
|
|
|
* Accessor functions to get/set the associated view object
|
|
|
|
*/
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD GetView(nsIPresContext* aPresContext,
|
|
|
|
nsIView** aView) const = 0; // may be null
|
|
|
|
NS_IMETHOD SetView(nsIPresContext* aPresContext,
|
|
|
|
nsIView* aView) = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Find the first geometric parent that has a view
|
|
|
|
*/
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD GetParentWithView(nsIPresContext* aPresContext,
|
|
|
|
nsIFrame** aParent) const = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the offset from this frame to the closest geometric parent that
|
|
|
|
* has a view. Also returns the containing view or null in case of error
|
|
|
|
*/
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD GetOffsetFromView(nsIPresContext* aPresContext,
|
|
|
|
nsPoint& aOffset,
|
|
|
|
nsIView** aView) const = 0;
|
2002-02-08 01:39:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the offset from this frame's upper left corner to the upper
|
|
|
|
* left corner of the view returned by a call to GetView(). aOffset
|
|
|
|
* will contain the offset to the view or (0,0) if the frame has no
|
|
|
|
* view. aView will contain a pointer to the view returned by GetView().
|
|
|
|
* aView is optional, that is, you may pass null if you are not interested
|
|
|
|
* in getting a pointer to the view.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetOriginToViewOffset(nsIPresContext* aPresContext,
|
|
|
|
nsPoint& aOffset,
|
|
|
|
nsIView** aView) const = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the window that contains this frame. If this frame has a
|
|
|
|
* view and the view has a window, then this frames window is
|
|
|
|
* returned, otherwise this frame's geometric parent is checked
|
|
|
|
* recursively upwards.
|
|
|
|
*/
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD GetWindow(nsIPresContext* aPresContext,
|
|
|
|
nsIWidget** aWidget) const = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1999-02-09 08:44:13 +03:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame. May return a NULL atom pointer
|
|
|
|
*
|
|
|
|
* @see nsLayoutAtoms
|
|
|
|
*/
|
1999-02-10 07:17:06 +03:00
|
|
|
NS_IMETHOD GetFrameType(nsIAtom** aType) const = 0;
|
1999-02-09 08:44:13 +03:00
|
|
|
|
1998-05-14 02:38:09 +04:00
|
|
|
/**
|
|
|
|
* Is this frame a "containing block"?
|
|
|
|
*/
|
|
|
|
NS_IMETHOD IsPercentageBase(PRBool& aBase) const = 0;
|
|
|
|
|
1998-09-06 00:57:57 +04:00
|
|
|
/**
|
|
|
|
* called when the frame has been scrolled to a new
|
|
|
|
* position. only called for frames with views.
|
|
|
|
*/
|
1999-08-31 07:09:40 +04:00
|
|
|
NS_IMETHOD Scrolled(nsIView *aView) = 0;
|
1998-09-06 00:57:57 +04:00
|
|
|
|
1999-02-02 03:23:40 +03:00
|
|
|
/** Selection related calls
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* Called to set the selection of the frame based on frame offsets. you can FORCE the frame
|
|
|
|
* to redraw event if aSelected == the frame selection with the last parameter.
|
1999-03-12 03:17:14 +03:00
|
|
|
* data in struct may be changed when passed in.
|
1999-04-26 08:02:04 +04:00
|
|
|
* @param aRange is the range that will dictate if the frames need to be redrawn null means the whole content needs to be redrawn
|
|
|
|
* @param aSelected is it selected
|
1999-05-20 04:52:00 +04:00
|
|
|
* @param aSpread should is spread selection to flow elements around it? or go down to its children?
|
1999-01-26 02:28:23 +03:00
|
|
|
*/
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD SetSelected(nsIPresContext* aPresContext,
|
|
|
|
nsIDOMRange* aRange,
|
|
|
|
PRBool aSelected,
|
|
|
|
nsSpread aSpread) = 0;
|
1999-01-22 21:58:14 +03:00
|
|
|
|
1999-04-26 08:02:04 +04:00
|
|
|
NS_IMETHOD GetSelected(PRBool *aSelected) const = 0;
|
1998-12-14 21:34:14 +03:00
|
|
|
|
2000-08-09 03:38:00 +04:00
|
|
|
/**
|
|
|
|
* called to discover where this frame, or a parent frame has user-select style
|
|
|
|
* applied, which affects that way that it is selected.
|
|
|
|
*
|
|
|
|
* @param aIsSelectable out param. Set to true if the frame can be selected
|
|
|
|
* (i.e. is not affected by user-select: none)
|
|
|
|
* @param aSelectStyle out param. Returns the type of selection style found
|
|
|
|
* (using values defined in nsStyleConsts.h).
|
|
|
|
*/
|
|
|
|
NS_IMETHOD IsSelectable(PRBool* aIsSelectable, PRUint8* aSelectStyle) const = 0;
|
2000-08-05 08:41:33 +04:00
|
|
|
|
2000-05-31 07:20:02 +04:00
|
|
|
/**
|
|
|
|
* Called to retrieve the SelectionController associated with the frame.
|
|
|
|
* @param aSelCon will contain the selection controller associated with
|
|
|
|
* the frame.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetSelectionController(nsIPresContext *aPresContext, nsISelectionController **aSelCon) = 0;
|
|
|
|
|
1999-05-08 01:12:59 +04:00
|
|
|
/** EndSelection related calls
|
|
|
|
*/
|
|
|
|
|
2000-08-15 02:28:41 +04:00
|
|
|
/**
|
|
|
|
* Call to turn on/off mouseCapture at the view level. Needed by the ESM so
|
|
|
|
* it must be in the public interface.
|
|
|
|
* @param aPresContext presContext associated with the frame
|
|
|
|
* @param aGrabMouseEvents PR_TRUE to enable capture, PR_FALSE to disable
|
|
|
|
*/
|
|
|
|
NS_IMETHOD CaptureMouse(nsIPresContext* aPresContext, PRBool aGrabMouseEvents) = 0;
|
|
|
|
|
1999-02-02 03:23:40 +03:00
|
|
|
/**
|
|
|
|
* called to find the previous/next character, word, or line returns the actual
|
|
|
|
* nsIFrame and the frame offset. THIS DOES NOT CHANGE SELECTION STATE
|
|
|
|
* uses frame's begin selection state to start. if no selection on this frame will
|
|
|
|
* return NS_ERROR_FAILURE
|
1999-09-10 22:29:37 +04:00
|
|
|
* @param aPOS is defined in nsIFrameSelection
|
|
|
|
*/
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos) = 0;
|
1999-02-02 03:23:40 +03:00
|
|
|
|
2000-07-26 15:31:12 +04:00
|
|
|
/**
|
|
|
|
* called to see if the children of the frame are visible from indexstart to index end.
|
|
|
|
* this does not change any state. returns PR_TRUE only if the indexes are valid and any of
|
|
|
|
* the children are visible. for textframes this index is the character index.
|
|
|
|
* if aStart = aEnd result will be PR_FALSE
|
|
|
|
* @param aStart start index of first child from 0-N (number of children)
|
|
|
|
* @param aEnd end index of last child from 0-N
|
|
|
|
* @param aRecurse should this frame talk to siblings to get to the contents other children?
|
|
|
|
* @param aFinished did this frame have the aEndIndex? or is there more work to do
|
|
|
|
* @param _retval return value true or false. false = range is not rendered.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD CheckVisibility(nsIPresContext* aContext, PRInt32 aStartIndex, PRInt32 aEndIndex, PRBool aRecurse, PRBool *aFinished, PRBool *_retval)=0;
|
|
|
|
|
2000-01-12 11:28:24 +03:00
|
|
|
/**
|
|
|
|
* Called by a child frame on a parent frame to tell the parent frame that the child needs
|
|
|
|
* to be reflowed. The parent should either propagate the request to its parent frame or
|
2001-12-18 01:39:59 +03:00
|
|
|
* handle the request by generating a eReflowType_ReflowDirtyChildren reflow command.
|
2000-01-12 11:28:24 +03:00
|
|
|
*/
|
2001-03-13 09:38:59 +03:00
|
|
|
|
2000-01-12 11:28:24 +03:00
|
|
|
NS_IMETHOD ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) = 0;
|
|
|
|
|
2001-05-18 03:52:32 +04:00
|
|
|
/**
|
|
|
|
* Called to retrieve this frame's accessible.
|
|
|
|
* If this frame implements Accessibility return a valid accessible
|
|
|
|
* If not return NS_ERROR_NOT_IMPLEMENTED.
|
|
|
|
* Note: nsAccessible must be refcountable. Do not implement directly on your frame
|
|
|
|
* Use a mediatior of some kind.
|
|
|
|
*/
|
2001-08-17 07:13:07 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
2001-05-18 03:52:32 +04:00
|
|
|
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible) = 0;
|
2001-08-17 07:13:07 +04:00
|
|
|
#endif
|
2001-05-18 03:52:32 +04:00
|
|
|
|
2001-03-13 09:38:59 +03:00
|
|
|
/**
|
|
|
|
* Called during appending or cancelling a reflow command to give frames notice
|
|
|
|
* of reflow commands that will be targeted below them.
|
|
|
|
*/
|
2001-12-18 01:39:59 +03:00
|
|
|
NS_IMETHOD ReflowCommandNotify(nsIPresShell* aShell,
|
|
|
|
nsHTMLReflowCommand* aRC,
|
|
|
|
PRBool aCommandAdded) = 0;
|
2001-03-13 09:38:59 +03:00
|
|
|
|
2000-09-13 02:45:33 +04:00
|
|
|
/**
|
2002-03-10 09:16:01 +03:00
|
|
|
* Called in style ReResolution to get the frame that contains the style context that is the
|
|
|
|
* parent style context for this frame.
|
|
|
|
* @param aProviderFrame: set to the frame who's style context is to be used as the parent context
|
|
|
|
* in reresolving style for this frame. Note that this may or may not be the
|
|
|
|
* parent frame of this frame.
|
|
|
|
* @param aRelatioship : indicates how the provider frame relates to this frame:
|
|
|
|
* i.e. if the parent context provider frame is a child of this frame,
|
|
|
|
* then aRelationship must be set to eContextProvider_Descendant,
|
|
|
|
* if a parent, grandparent etc. set to eContextProvider_Ancestor
|
|
|
|
* (this is used to control recursion in style reresolution)
|
2000-09-13 02:45:33 +04:00
|
|
|
*
|
2002-03-10 09:16:01 +03:00
|
|
|
* if return value is NS_OK then aProvdierFrame must be set, otherwise it is ignored.
|
|
|
|
*
|
|
|
|
* PRECONDITIONS: aProviderFrame cannot be null
|
|
|
|
* POSTCONDITIONS: *aProfiderFrame will be a valid frame if this routine succeeds
|
|
|
|
* aRelationship will be set to a legal enum value indicating the correct relationship
|
2000-09-13 02:45:33 +04:00
|
|
|
*/
|
2002-03-10 09:16:01 +03:00
|
|
|
NS_IMETHOD GetParentStyleContextProvider(nsIPresContext* aPresContext,
|
|
|
|
nsIFrame** aProviderFrame,
|
|
|
|
nsContextProviderRelationship& aRelationship) = 0;
|
2000-09-13 02:45:33 +04:00
|
|
|
|
2001-01-27 17:09:34 +03:00
|
|
|
/**
|
|
|
|
* Determines whether a frame is visible for painting
|
|
|
|
* this takes into acount whether it is painting selection for printin
|
|
|
|
* @param aPresContext PresContext
|
|
|
|
* @param aRenderingContext PresContext
|
|
|
|
* @param aCheckVis indicates whether it should check for CSS visibility,
|
|
|
|
* PR_FALSE skips the check, PR_TRUE does the check
|
|
|
|
* @param aIsVisible return value
|
|
|
|
*/
|
|
|
|
NS_IMETHOD IsVisibleForPainting(nsIPresContext * aPresContext,
|
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
PRBool aCheckVis,
|
|
|
|
PRBool* aIsVisible) = 0;
|
2001-10-25 05:08:40 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine whether the frame is logically empty, i.e., whether the
|
|
|
|
* layout would be the same whether or not the frame is present.
|
|
|
|
* Placeholder frames should return true. Block frames should be
|
|
|
|
* considered empty whenever margins collapse through them, even
|
|
|
|
* though those margins are relevant.
|
|
|
|
*
|
|
|
|
* aIsPre should be ignored by frames to which the 'white-space'
|
|
|
|
* property applies.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD IsEmpty(PRBool aIsQuirkMode,
|
|
|
|
PRBool aIsPre,
|
|
|
|
PRBool* aResult) = 0;
|
|
|
|
|
2001-03-09 06:13:03 +03:00
|
|
|
#ifdef IBMBIDI
|
|
|
|
/**
|
|
|
|
* retrieve and set Bidi property of this frame
|
|
|
|
* @lina 5/1/2000
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetBidiProperty(nsIPresContext* aPresContext,
|
|
|
|
nsIAtom* aPropertyName,
|
|
|
|
void** aPropertyValue,
|
2001-06-21 16:35:48 +04:00
|
|
|
size_t aSize ) const = 0;
|
2001-03-09 06:13:03 +03:00
|
|
|
NS_IMETHOD SetBidiProperty(nsIPresContext* aPresContext,
|
|
|
|
nsIAtom* aPropertyName,
|
2001-06-21 16:35:48 +04:00
|
|
|
void* aPropertyValue) = 0;
|
2001-03-09 06:13:03 +03:00
|
|
|
#endif // IBMBIDI
|
|
|
|
|
2001-10-24 04:01:09 +04:00
|
|
|
protected:
|
|
|
|
// Members
|
|
|
|
nsRect mRect;
|
|
|
|
nsIContent* mContent;
|
|
|
|
nsIStyleContext* mStyleContext;
|
|
|
|
nsIFrame* mParent;
|
|
|
|
nsIFrame* mNextSibling; // singly linked list of frames
|
|
|
|
nsFrameState mState;
|
|
|
|
|
1998-09-24 05:50:16 +04:00
|
|
|
private:
|
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
2001-11-28 09:50:13 +03:00
|
|
|
// typesafe way to access style data. See comment in nsStyleStruct.h
|
|
|
|
// and also overloaded function in nsIStyleContext.h
|
|
|
|
template <class T>
|
|
|
|
inline void
|
|
|
|
GetStyleData(nsIFrame* aFrame, const T** aStyleStruct)
|
|
|
|
{
|
|
|
|
aFrame->GetStyleData(NS_GET_STYLESTRUCTID(T),
|
|
|
|
*NS_REINTERPRET_CAST(const nsStyleStruct**, aStyleStruct));
|
|
|
|
}
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#endif /* nsIFrame_h___ */
|