aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/GeckoPrintSession.h
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-06-19 02:52:03 +0800
committerChristian Persch <chpe@src.gnome.org>2006-06-19 02:52:03 +0800
commitc6573cb04bdc216e7e5ea3657cb1186eaf0f1095 (patch)
tree769cc33a1564a50d1414cb6b6b6f7306c1635840 /embed/mozilla/GeckoPrintSession.h
parent0db1af2c76d4cae33992f82a1736f6ed743b7dc1 (diff)
downloadgsoc2013-epiphany-c6573cb04bdc216e7e5ea3657cb1186eaf0f1095.tar
gsoc2013-epiphany-c6573cb04bdc216e7e5ea3657cb1186eaf0f1095.tar.gz
gsoc2013-epiphany-c6573cb04bdc216e7e5ea3657cb1186eaf0f1095.tar.bz2
gsoc2013-epiphany-c6573cb04bdc216e7e5ea3657cb1186eaf0f1095.tar.lz
gsoc2013-epiphany-c6573cb04bdc216e7e5ea3657cb1186eaf0f1095.tar.xz
gsoc2013-epiphany-c6573cb04bdc216e7e5ea3657cb1186eaf0f1095.tar.zst
gsoc2013-epiphany-c6573cb04bdc216e7e5ea3657cb1186eaf0f1095.zip
A embed/mozilla/GeckoPrintService.cpp: A
2006-06-18 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * data/default-prefs-common.js: * embed/Makefile.am: * embed/ephy-embed-shell.c: (ephy_embed_shell_dispose), (ephy_embed_shell_set_page_setup), (ephy_embed_shell_get_page_setup), (ephy_embed_shell_set_print_settings), (ephy_embed_shell_get_print_settings): * embed/ephy-embed-shell.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/EphyUtils.cpp: * embed/mozilla/EphyUtils.h: * embed/mozilla/Makefile.am: A embed/mozilla/GeckoPrintService.cpp: A embed/mozilla/GeckoPrintService.h: A embed/mozilla/GeckoPrintSession.cpp: A embed/mozilla/GeckoPrintSession.h: * embed/mozilla/MozRegisterComponents.cpp: R embed/mozilla/PrintingPromptService.cpp: R embed/mozilla/PrintingPromptService.h: * embed/mozilla/mozilla-embed-single.cpp: R embed/print-dialog.c: R embed/print-dialog.h: * src/ephy-shell.c: (ephy_shell_dispose), (ephy_shell_get_prefs_dialog): * src/ephy-shell.h: * src/epiphany.defs: * src/window-commands.c: (page_setup_done_cb), (window_cmd_file_print_setup): Drop libgnomeprint[ui] and use gtk printing.
Diffstat (limited to 'embed/mozilla/GeckoPrintSession.h')
-rw-r--r--embed/mozilla/GeckoPrintSession.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/embed/mozilla/GeckoPrintSession.h b/embed/mozilla/GeckoPrintSession.h
new file mode 100644
index 000000000..4b06a9f04
--- /dev/null
+++ b/embed/mozilla/GeckoPrintSession.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2006 Christian Persch
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ */
+
+#ifndef GECKO_PRINT_SESSION_H
+#define GECKO_PRINT_SESSION_H
+
+#include <nsCOMPtr.h>
+#include <nsIPrintSession.h>
+#include <nsIWebProgressListener.h>
+#include <nsIPrintProgress.h>
+#include <nsIPrintProgressParams.h>
+#include <nsWeakReference.h>
+
+#include <gtk/gtkwidget.h>
+#include <gtk/gtkprintjob.h>
+#include <gtk/gtkprinter.h>
+#include <gtk/gtkprintjob.h>
+
+class nsIPrintSettings;
+class nsIDOMWindow;
+
+/* 0940c973-97e7-476f-a612-4ed9473a0b36 */
+#define GECKO_PRINT_SESSION_IID \
+{ 0x0940c973, 0x97e7, 0x476f, \
+ { 0xa6, 0x12, 0x4e, 0xd9, 0x47, 0x3a, 0x0b, 0x36 } }
+
+#define GECKO_PRINT_SESSION_CLASSNAME "Gecko Print Session"
+
+class GeckoPrintSession : public nsIPrintSession,
+ public nsIPrintProgress,
+ public nsIPrintProgressParams,
+ public nsSupportsWeakReference
+{
+ public:
+ GeckoPrintSession();
+ virtual ~GeckoPrintSession();
+
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSIPRINTSESSION
+ NS_DECL_NSIWEBPROGRESSLISTENER
+ NS_DECL_NSIPRINTPROGRESS
+ NS_DECL_NSIPRINTPROGRESSPARAMS
+
+ nsresult SetSettings (GtkPrintSettings*, GtkPageSetup*, GtkPrinter*);
+ void GetSourceFile (nsACString&);
+
+ static GeckoPrintSession *FromSettings (nsIPrintSettings *);
+
+ void Cancel ();
+ void StartPrinting ();
+ void JobStatusChanged ();
+ void JobDone ();
+ void JobError (const char *);
+
+ private:
+ GtkPrintSettings *mSettings;
+ GtkPageSetup *mPageSetup;
+ GtkPrinter *mPrinter;
+ GtkPrintJob *mJob;
+ GtkWidget *mProgressDialog;
+ GtkWidget *mTitleLabel;
+ GtkWidget *mProgressBar;
+ nsCString mSourceFile;
+ nsCString mTitle;
+ guint mStartPrintIdleID;
+ PRPackedBool mSourceFileIsTemp;
+ PRPackedBool mDone;
+ PRPackedBool mCancelled;
+
+ void SetProgress (PRInt32, PRInt32);
+ void SetProgressText (const char *); void LaunchJob ();
+ void LaunchJobOnIdle ();
+ void DestroyJob ();
+};
+
+#endif /* GECKO_PRINT_SESSION_H */