[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    KDE Printing API Request (Was: [REMINDER] KDE Dev Platform FROZEN)
From:       Alex Merry <huntedhacker () tiscali ! co ! uk>
Date:       2007-10-06 19:36:11
Message-ID: 200710062036.17138.huntedhacker () tiscali ! co ! uk
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


On Saturday 06 Oct 2007, Allen Winter wrote:
> PS.  KSSL and printing stuff still needs work.  We can still accept
> code that improves those areas at any time. :)

Hopefully the last API bit for printing, bar removing libkdeprint:

Is this patch OK to commit?  It doesn't do anything interesting at the 
moment, but provides the API for getting a customised QPrintDialog.

The methods return a QAbstractPrintDialog *, but in actual fact it's a 
QPrintDialog *.  Does this cause problems for deleting (the caller 
takes ownership)?  If so, it should return a QPrintDialog * (although 
that loses us the flexibility of possibly implementing our own dialog 
later).

Alex



-- 
KDE: http://www.kde.org
Ubuntu/Kubuntu: http://www.ubuntu.org http://www.kubuntu.org

["kdeprintdialog.diff" (text/x-diff)]

Index: kdeui/dialogs/kdeprintdialog.cpp
===================================================================
--- kdeui/dialogs/kdeprintdialog.cpp	(revision 0)
+++ kdeui/dialogs/kdeprintdialog.cpp	(revision 0)
@@ -0,0 +1,38 @@
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (c) 2007 Alex Merry <huntedhacker@tiscali.co.uk>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License version 2 as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ **/
+
+#include "kdeprintdialog.h"
+
+#include <QPrintDialog>
+
+QAbstractPrintDialog *KdePrint::getPrintDialog(QPrinter *printer,
+                                               QList<QWidget> customTabs,
+                                               QWidget *parent)
+{
+    Q_UNUSED(customTabs)
+    return new QPrintDialog(printer, parent);
+}
+
+
+QAbstractPrintDialog *KdePrint::getPrintDialog(QPrinter *printer,
+                                               QWidget *parent)
+{
+    return new QPrintDialog(printer, parent);
+}
+
Index: kdeui/dialogs/kdeprintdialog.h
===================================================================
--- kdeui/dialogs/kdeprintdialog.h	(revision 0)
+++ kdeui/dialogs/kdeprintdialog.h	(revision 0)
@@ -0,0 +1,67 @@
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (c) 2007 Alex Merry <huntedhacker@tiscali.co.uk>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License version 2 as published by the Free Software Foundation.
+ *
+ *  This library 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
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ **/
+
+#ifndef KDEPRINTDIALOG_H
+#define KDEPRINTDIALOG_H
+
+#include <kdeui_export.h>
+
+#include <QtCore/QList>
+
+class QAbstractPrintDialog;
+class QPrinter;
+class QWidget;
+
+/**
+ * Namespace for the KDE printing system
+ */
+namespace KdePrint
+{
+    /**
+     * Creates a printer dialog for a QPrinter with the given custom widgets
+     *
+     * Note that the custom widgets will @b not be shown on Qt versions prior to
+     * 4.3.2.
+     *
+     * The caller takes ownership of the dialog and is responsible
+     * for deleting it.
+     *
+     * @param printer the QPrinter to apply settings to
+     * @param parent the parent for the dialog
+     */
+    KDEUI_EXPORT QAbstractPrintDialog *getPrintDialog(QPrinter *printer,
+                                                      QList<QWidget> customTabs,
+                                                      QWidget *parent = 0);
+
+    /**
+     * Creates a printer dialog for a QPrinter
+     *
+     * The caller takes ownership of the dialog and is responsible
+     * for deleting it.
+     *
+     * @param printer the QPrinter to apply settings to
+     * @param parent the parent for the dialog
+     */
+    KDEUI_EXPORT QAbstractPrintDialog *getPrintDialog(QPrinter *printer,
+                                                      QWidget *parent = 0);
+};
+
+
+#endif // KDEPRINTDIALOG_H
+
Index: kdeui/CMakeLists.txt
===================================================================
--- kdeui/CMakeLists.txt	(revision 722140)
+++ kdeui/CMakeLists.txt	(working copy)
@@ -69,6 +69,7 @@ set(kdeui_LIB_SRCS
  dialogs/kconfigdialog.cpp
  dialogs/kconfigdialogmanager.cpp
  dialogs/kbugreport.cpp
+ dialogs/kdeprintdialog.cpp
  dialogs/kdialog.cpp
  dialogs/kedittoolbar.cpp
  dialogs/kinputdialog.cpp
@@ -327,6 +328,7 @@ install( FILES
  dialogs/kbugreport.h
  dialogs/kconfigdialog.h
  dialogs/kconfigdialogmanager.h
+ dialogs/kdeprintdialog.h
  dialogs/kdialog.h
  dialogs/kedittoolbar.h
  dialogs/kinputdialog.h

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic