2002-08-21 16:01:05 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 01:52:36 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2002-08-21 16:01:05 +04:00
|
|
|
*
|
2004-04-18 01:52:36 +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/
|
2002-08-21 16:01:05 +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.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2002-08-21 16:01:05 +04: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-18 01:52:36 +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"),
|
2002-08-21 16:01:05 +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-18 01:52:36 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2002-08-21 16:01:05 +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-18 01:52:36 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2002-08-21 16:01:05 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
#ifndef nsPrintObject_h___
|
|
|
|
#define nsPrintObject_h___
|
|
|
|
|
2011-12-16 23:42:07 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
|
2002-08-21 16:01:05 +04:00
|
|
|
// Interfaces
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsIPresShell.h"
|
2004-01-08 01:30:53 +03:00
|
|
|
#include "nsStyleSet.h"
|
2002-08-21 16:01:05 +04:00
|
|
|
#include "nsIViewManager.h"
|
|
|
|
#include "nsIDocShell.h"
|
|
|
|
#include "nsIDocument.h"
|
2010-11-11 00:15:21 +03:00
|
|
|
#include "nsIDocShellTreeOwner.h"
|
2002-08-21 16:01:05 +04:00
|
|
|
|
2010-04-11 00:10:12 +04:00
|
|
|
class nsPresContext;
|
|
|
|
|
2002-08-21 16:01:05 +04:00
|
|
|
// nsPrintObject Document Type
|
|
|
|
enum PrintObjectType {eDoc = 0, eFrame = 1, eIFrame = 2, eFrameSet = 3};
|
|
|
|
|
|
|
|
//---------------------------------------------------
|
|
|
|
//-- nsPrintObject Class
|
|
|
|
//---------------------------------------------------
|
|
|
|
class nsPrintObject
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
nsPrintObject();
|
|
|
|
~nsPrintObject(); // non-virtual
|
|
|
|
|
|
|
|
// Methods
|
2009-12-11 07:02:13 +03:00
|
|
|
nsresult Init(nsIDocShell* aDocShell, nsIDOMDocument* aDoc,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aPrintPreview);
|
2002-08-21 16:01:05 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsPrintable() { return !mDontPrint; }
|
2002-08-21 16:01:05 +04:00
|
|
|
void DestroyPresentation();
|
|
|
|
|
|
|
|
// Data Members
|
|
|
|
nsCOMPtr<nsIDocShell> mDocShell;
|
2010-11-11 00:15:21 +03:00
|
|
|
nsCOMPtr<nsIDocShellTreeOwner> mTreeOwner;
|
2002-08-21 16:01:05 +04:00
|
|
|
nsCOMPtr<nsIDocument> mDocument;
|
|
|
|
|
2010-03-25 16:17:11 +03:00
|
|
|
nsRefPtr<nsPresContext> mPresContext;
|
2002-08-21 16:01:05 +04:00
|
|
|
nsCOMPtr<nsIPresShell> mPresShell;
|
|
|
|
nsCOMPtr<nsIViewManager> mViewManager;
|
|
|
|
|
2009-12-11 07:02:13 +03:00
|
|
|
nsCOMPtr<nsIContent> mContent;
|
2006-03-30 04:27:42 +04:00
|
|
|
PrintObjectType mFrameType;
|
|
|
|
|
2009-02-03 17:42:18 +03:00
|
|
|
nsTArray<nsPrintObject*> mKids;
|
2006-03-30 04:27:42 +04:00
|
|
|
nsPrintObject* mParent;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mHasBeenPrinted;
|
|
|
|
bool mDontPrint;
|
|
|
|
bool mPrintAsIs;
|
|
|
|
bool mSharedPresShell;
|
|
|
|
bool mInvisible; // Indicates PO is set to not visible by CSS
|
|
|
|
bool mPrintPreview;
|
|
|
|
bool mDidCreateDocShell;
|
2002-08-21 16:01:05 +04:00
|
|
|
float mShrinkRatio;
|
2007-02-07 10:46:44 +03:00
|
|
|
float mZoomRatio;
|
2002-08-21 16:01:05 +04:00
|
|
|
|
|
|
|
private:
|
2011-12-16 23:42:07 +04:00
|
|
|
nsPrintObject& operator=(const nsPrintObject& aOther) MOZ_DELETE;
|
2002-08-21 16:01:05 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* nsPrintObject_h___ */
|
|
|
|
|