2002-08-21 12:01:05 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-17 21:52:36 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2002-08-21 12:01:05 +00:00
|
|
|
*
|
2004-04-17 21:52:36 +00: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/
|
2002-08-21 12:01:05 +00: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.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2002-08-21 12:01:05 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-17 21:52:36 +00: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"),
|
2002-08-21 12:01:05 +00: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 21:52:36 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2002-08-21 12:01:05 +00: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 21:52:36 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2002-08-21 12:01:05 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
#ifndef nsPrintObject_h___
|
|
|
|
#define nsPrintObject_h___
|
|
|
|
|
|
|
|
// Interfaces
|
|
|
|
#include "nsCOMPtr.h"
|
2004-01-07 22:30:53 +00:00
|
|
|
#include "nsAutoPtr.h"
|
2002-08-21 12:01:05 +00:00
|
|
|
#include "nsIContent.h"
|
2004-07-31 23:15:21 +00:00
|
|
|
#include "nsPresContext.h"
|
2002-08-21 12:01:05 +00:00
|
|
|
#include "nsIPresShell.h"
|
2004-01-07 22:30:53 +00:00
|
|
|
#include "nsStyleSet.h"
|
2002-08-21 12:01:05 +00:00
|
|
|
#include "nsIViewManager.h"
|
|
|
|
#include "nsIDocShell.h"
|
|
|
|
#include "nsIDocument.h"
|
|
|
|
#include "nsIWidget.h"
|
|
|
|
|
|
|
|
// Other Includes
|
|
|
|
#include "nsRect.h"
|
|
|
|
|
|
|
|
// nsPrintObject Document Type
|
|
|
|
enum PrintObjectType {eDoc = 0, eFrame = 1, eIFrame = 2, eFrameSet = 3};
|
|
|
|
|
|
|
|
//---------------------------------------------------
|
|
|
|
//-- nsPrintObject Class
|
|
|
|
//---------------------------------------------------
|
|
|
|
class nsPrintObject
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
nsPrintObject();
|
|
|
|
~nsPrintObject(); // non-virtual
|
|
|
|
|
|
|
|
// Methods
|
2005-01-03 22:51:17 +00:00
|
|
|
nsresult Init(nsIDocShell* aDocShell);
|
2002-08-21 12:01:05 +00:00
|
|
|
|
|
|
|
PRBool IsPrintable() { return !mDontPrint; }
|
|
|
|
void DestroyPresentation();
|
|
|
|
|
|
|
|
// Data Members
|
|
|
|
nsCOMPtr<nsIDocShell> mDocShell;
|
|
|
|
nsCOMPtr<nsIPresShell> mDisplayPresShell;
|
|
|
|
nsCOMPtr<nsIDocument> mDocument;
|
|
|
|
|
2006-03-30 00:27:42 +00:00
|
|
|
nsCOMPtr<nsPresContext> mPresContext;
|
2002-08-21 12:01:05 +00:00
|
|
|
nsCOMPtr<nsIPresShell> mPresShell;
|
|
|
|
nsCOMPtr<nsIViewManager> mViewManager;
|
|
|
|
nsCOMPtr<nsIWidget> mWindow;
|
2006-03-30 00:27:42 +00:00
|
|
|
nsIView* mRootView;
|
2002-08-21 12:01:05 +00:00
|
|
|
|
2006-03-30 00:27:42 +00:00
|
|
|
nsIContent* mContent;
|
|
|
|
PrintObjectType mFrameType;
|
|
|
|
|
2002-08-21 12:01:05 +00:00
|
|
|
nsVoidArray mKids;
|
2006-03-30 00:27:42 +00:00
|
|
|
nsPrintObject* mParent;
|
2002-08-21 12:01:05 +00:00
|
|
|
PRPackedBool mHasBeenPrinted;
|
|
|
|
PRPackedBool mDontPrint;
|
|
|
|
PRPackedBool mPrintAsIs;
|
|
|
|
PRPackedBool mSharedPresShell;
|
2004-12-21 11:51:13 +00:00
|
|
|
PRPackedBool mInvisible; // Indicates PO is set to not visible by CSS
|
2002-08-21 12:01:05 +00:00
|
|
|
|
|
|
|
PRUnichar* mDocTitle;
|
|
|
|
PRUnichar* mDocURL;
|
|
|
|
float mShrinkRatio;
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsPrintObject& operator=(const nsPrintObject& aOther); // not implemented
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* nsPrintObject_h___ */
|
|
|
|
|