From ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdeprint/ext/Makefile.am | 15 +++++++ kdeprint/ext/ext.print | 84 ++++++++++++++++++++++++++++++++++++++++ kdeprint/ext/kextprinterimpl.cpp | 52 +++++++++++++++++++++++++ kdeprint/ext/kextprinterimpl.h | 35 +++++++++++++++++ kdeprint/ext/kmextfactory.cpp | 28 ++++++++++++++ kdeprint/ext/kmextmanager.cpp | 49 +++++++++++++++++++++++ kdeprint/ext/kmextmanager.h | 40 +++++++++++++++++++ kdeprint/ext/kmextuimanager.cpp | 44 +++++++++++++++++++++ kdeprint/ext/kmextuimanager.h | 35 +++++++++++++++++ 9 files changed, 382 insertions(+) create mode 100644 kdeprint/ext/Makefile.am create mode 100644 kdeprint/ext/ext.print create mode 100644 kdeprint/ext/kextprinterimpl.cpp create mode 100644 kdeprint/ext/kextprinterimpl.h create mode 100644 kdeprint/ext/kmextfactory.cpp create mode 100644 kdeprint/ext/kmextmanager.cpp create mode 100644 kdeprint/ext/kmextmanager.h create mode 100644 kdeprint/ext/kmextuimanager.cpp create mode 100644 kdeprint/ext/kmextuimanager.h (limited to 'kdeprint/ext') diff --git a/kdeprint/ext/Makefile.am b/kdeprint/ext/Makefile.am new file mode 100644 index 000000000..a280e1451 --- /dev/null +++ b/kdeprint/ext/Makefile.am @@ -0,0 +1,15 @@ +AM_CPPFLAGS = -D_KDEPRINT_COMPILE + +INCLUDES= -I$(top_srcdir) -I$(top_srcdir)/kdeprint $(all_includes) + +kde_module_LTLIBRARIES = kdeprint_ext.la + +kdeprint_ext_la_SOURCES = kmextfactory.cpp kmextmanager.cpp kextprinterimpl.cpp kmextuimanager.cpp +kdeprint_ext_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +kdeprint_ext_la_LIBADD = $(top_builddir)/kdeprint/libkdeprint.la +kdeprint_ext_la_METASOURCES = AUTO + +noinst_HEADERS = kmextmanager.h kextprinterimpl.h kmextuimanager.h + +entry_DATA = ext.print +entrydir = $(kde_datadir)/kdeprint/plugins diff --git a/kdeprint/ext/ext.print b/kdeprint/ext/ext.print new file mode 100644 index 000000000..ce300e5ae --- /dev/null +++ b/kdeprint/ext/ext.print @@ -0,0 +1,84 @@ +[KDE Print Entry] +PrintSystem=ext +Comment=Print Through an External Program (generic) +Comment[af]=Druk Deur 'n Eksterne Program (generies) +Comment[ar]=اطبع من خلال برنامج خارجي (شائع) +Comment[az]=Xarici Proqram Vasitəsilə Çap Et (ümumi) +Comment[be]=Друкаваць праз вонкавую праграму (прадвызначана) +Comment[bn]=বহিঃস্থ প্রোগ্রামের (generic) সাহায্যে ছাপানো হোক +Comment[bs]=Štampajte pomoću eksternog programa (generic) +Comment[ca]=Impressió mitjançant un programa extern (genèric) +Comment[cs]=Tisk pomocí externího programu (obecné) +Comment[csb]=Drëkùjë brëkùjąc bùtnowi programë +Comment[cy]=Argraffu drwy Raglen Allanol (cyffredinol) +Comment[da]=Udskriv gennem et eksternt program (generisk) +Comment[de]=Über externes Programm drucken +Comment[el]=Εκτύπωση μέσω ενός εξωτερικού προγράμματος (γενικό) +Comment[eo]=Presi per ekstera programo (ĝenerala) +Comment[es]=Imprime a través de un programa externo (genérico) +Comment[et]=Trükkimine läbi välise rakenduse (üldine) +Comment[eu]=Inprimatu kanpoko programa bat erabiliz (orokorra) +Comment[fa]=چاپ از طریق یک برنامۀ خارجی)عمومی( +Comment[fi]=Tulosta ulkoisen sovelluksen kautta (yleinen) +Comment[fr]=Imprimer via un programme externe (générique) +Comment[fy]=Printsje mei help fan een ekstern programma (algemien) +Comment[ga]=Priontáil trí chlár eachtrach (cineálach) +Comment[gl]=Imprimir Mediante un Programa Externo (xenérico) +Comment[he]=הדפסה באמצעות תוכנית חיצונית +Comment[hi]=एक बाहरी प्रोग्राम के द्वारा छापें(जेनरिक) +Comment[hr]=Ispis putem vanjskog programa (generički) +Comment[hsb]=přez eksterny program ćišćeć (generisce) +Comment[hu]=Külső nyomtatóprogram +Comment[id]=Cetak dengan Program Eksternal (generik) +Comment[is]=Prenta í gegnum utanaðkomandi forrit (almennt) +Comment[it]=Stampa attraverso un programma esterno (generico) +Comment[ja]=外部プログラムを通して印刷 (一般的) +Comment[ka]=ბეჭდვა გარე პროგრამიდან (საზოგადო) +Comment[kk]=Сыртқы жалпы бағдарлама арқылы басып шығару +Comment[km]=បោះពុម្ព​តាម​រយៈ​កម្មវិធី​ខាង​ក្រៅ​មួយ (ទូទៅ) +Comment[ko]=바깥 프로그램을 통해 인쇄 (일반) +Comment[lb]=Duerch en externe Programm drécken (allgemeng) +Comment[lt]=Spausdinti naudojant išorinę programą (bendra) +Comment[lv]=Drukāt caur ārēju programmu (vispārēji) +Comment[mk]=Печатење преку надворешен програм (општо) +Comment[mn]=Гадаад программаар дамжуулан хэвлэх +Comment[ms]=Cetak Melalui Program Luaran (biasa) +Comment[mt]=Printja permezz ta' programm estern (ġeneriku) +Comment[nb]=Skriv ut gjennom et eksternt program (generisk) +Comment[nds]=Över extern Programm drucken +Comment[ne]=बाह्य कार्यक्रम (जेनेरिक) बाट मुद्रण गर्नुहोस् +Comment[nl]=Afdrukken met behulp van een extern programma (algemeen) +Comment[nn]=Skriv ut gjennom eit eksternt program (generelt) +Comment[nso]=Gatisetsa go Lenaneo la Kantle (kakaretso) +Comment[pa]=ਬਾਹਰੀ ਕਾਰਜ ਨਾਲ ਛਪਾਈ (ਸਧਾਰਨ) +Comment[pl]=Drukuj używając zewnętrznego programu +Comment[pt]=Imprimir através dum programa externo (genérico) +Comment[pt_BR]=Imprime através de um programa externo (genérico) +Comment[ro]=Tipăreşte prin intermediul unui program extern (generic) +Comment[ru]=Печать посредством внешней программы (общая) +Comment[rw]=Gucapa uciye muri Porogaramu y'Inyuma (rusange) +Comment[se]=Čálit olggoldas prográmma bokte (oppalaš) +Comment[sk]=Tlač pomocou externého programu (generické) +Comment[sl]=Tiskanje skozi zunanji program (splošno) +Comment[sq]=Shtyp përmes një programi të jashtëm (përgjithshëm) +Comment[sr]=Штампање преко спољњег програма (генерички) +Comment[sr@Latn]=Štampanje preko spoljnjeg programa (generički) +Comment[ss]=Shicelela ngekusebentisa luhlelo lwangaphandle (banti) +Comment[sv]=Skriv ut genom ett externt program (generellt) +Comment[ta]=ஒரு புற நிரலை முழுவதும் அச்சிடவும் (பொது) +Comment[te]=బయటి కార్యము (సాధరణ) ద్వారా ప్రచురించు +Comment[tg]=Чоп ба воситаи барномаи зоҳирӣ (умумӣ) +Comment[th]=พิมพ์ผ่านโปรแกรมภายนอก (โปรแกรมทั่วไป) +Comment[tr]=Harici program kullanarak yazdır (genel) +Comment[tt]=Tışqı Yazılım aşa Bastıru (töp) +Comment[uk]=Друк через зовнішню програму (загальна) +Comment[uz]=Tashqi dastur yordamida bosib chiqarish (umumiy) +Comment[uz@cyrillic]=Ташқи дастур ёрдамида босиб чиқариш (умумий) +Comment[ven]=Phirinthani nga Mbekanyamushumo yanga nnda (tshigwada) +Comment[vi]=In bằng một chương trình bên ngoài (giống loài). +Comment[wa]=Imprimer åd truviè d' on dfoûtrin programe (djenerike) +Comment[xh]=Shicilela Ngapha Kodweliso lwenkqubo olungaphandle (ngokubanzi) +Comment[zh_CN]=通过外部程序打印(通用) +Comment[zh_HK]=使用外部程式進行列印 (通用) +Comment[zh_TW]=使用外部程式進行列印 (一般) +Comment[zu]=Shicilela Ngokwedlulela Kuhlelo lwemisebenzi Langaphandle (okukawonke wonke) diff --git a/kdeprint/ext/kextprinterimpl.cpp b/kdeprint/ext/kextprinterimpl.cpp new file mode 100644 index 000000000..09dc74832 --- /dev/null +++ b/kdeprint/ext/kextprinterimpl.cpp @@ -0,0 +1,52 @@ +/* + * This file is part of the KDE libraries + * Copyright (c) 2001 Michael Goffioul + * + * 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 "kextprinterimpl.h" +#include "kprinter.h" + +#include +#include +#include +#include + +KExtPrinterImpl::KExtPrinterImpl(QObject *parent, const char *name, const QStringList & /*args*/) +: KPrinterImpl(parent,name) +{ +} + +KExtPrinterImpl::~KExtPrinterImpl() +{ +} + +void KExtPrinterImpl::preparePrinting(KPrinter *printer) +{ + printer->setOption("kde-qtcopies",QString::number(printer->numCopies())); +} + +bool KExtPrinterImpl::setupCommand(QString& cmd, KPrinter *printer) +{ + cmd = printer->option("kde-printcommand").stripWhiteSpace(); + if (cmd.isEmpty()) + { + printer->setErrorMessage(i18n("Empty print command.")); + return false; + } + + return true; +} diff --git a/kdeprint/ext/kextprinterimpl.h b/kdeprint/ext/kextprinterimpl.h new file mode 100644 index 000000000..b73c6d1c9 --- /dev/null +++ b/kdeprint/ext/kextprinterimpl.h @@ -0,0 +1,35 @@ +/* + * This file is part of the KDE libraries + * Copyright (c) 2001 Michael Goffioul + * + * 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 KEXTPRINTERIMPL_H +#define KEXTPRINTERIMPL_H + +#include "kprinterimpl.h" + +class KExtPrinterImpl : public KPrinterImpl +{ +public: + KExtPrinterImpl(QObject *parent, const char *name, const QStringList & /*args*/); + ~KExtPrinterImpl(); + + void preparePrinting(KPrinter*); + bool setupCommand(QString&, KPrinter*); +}; + +#endif diff --git a/kdeprint/ext/kmextfactory.cpp b/kdeprint/ext/kmextfactory.cpp new file mode 100644 index 000000000..3360774fa --- /dev/null +++ b/kdeprint/ext/kmextfactory.cpp @@ -0,0 +1,28 @@ +/* + * This file is part of the KDE libraries + * Copyright (c) 2001 Michael Goffioul + * + * 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 "kmextmanager.h" +#include "kmextuimanager.h" +#include "kextprinterimpl.h" + +#include + +typedef K_TYPELIST_3( KMExtManager, KMExtUiManager, KExtPrinterImpl ) Products; +K_EXPORT_COMPONENT_FACTORY( kdeprint_ext, KGenericFactory< Products > ) + diff --git a/kdeprint/ext/kmextmanager.cpp b/kdeprint/ext/kmextmanager.cpp new file mode 100644 index 000000000..94e126e09 --- /dev/null +++ b/kdeprint/ext/kmextmanager.cpp @@ -0,0 +1,49 @@ +/* + * This file is part of the KDE libraries + * Copyright (c) 2001 Michael Goffioul + * + * 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 "kmextmanager.h" +#include "kmprinter.h" + +#include + +KMExtManager::KMExtManager(QObject *parent, const char *name, const QStringList & /*args*/) +: KMManager(parent,name) +{ + setHasManagement(false); + m_psprinter = 0; +} + +KMExtManager::~KMExtManager() +{ +} + +void KMExtManager::listPrinters() +{ + if (!m_psprinter) + { + m_psprinter = new KMPrinter; + m_psprinter->setName(i18n("PS_printer")); + m_psprinter->setPrinterName(m_psprinter->name()); + m_psprinter->setDescription(i18n("PostScript file generator")); + m_psprinter->setState(KMPrinter::Idle); + addPrinter(m_psprinter); + } + else + m_psprinter->setDiscarded(false); +} diff --git a/kdeprint/ext/kmextmanager.h b/kdeprint/ext/kmextmanager.h new file mode 100644 index 000000000..56094acee --- /dev/null +++ b/kdeprint/ext/kmextmanager.h @@ -0,0 +1,40 @@ +/* + * This file is part of the KDE libraries + * Copyright (c) 2001 Michael Goffioul + * + * 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 KMEXTMANAGER_H +#define KMEXTMANAGER_H + +#include "kmmanager.h" +#include +#include + +class KMExtManager : public KMManager +{ +public: + KMExtManager(QObject *parent, const char *name, const QStringList & /*args*/); + ~KMExtManager(); + +protected: + void listPrinters(); + +private: + KMPrinter *m_psprinter; +}; + +#endif diff --git a/kdeprint/ext/kmextuimanager.cpp b/kdeprint/ext/kmextuimanager.cpp new file mode 100644 index 000000000..55981231b --- /dev/null +++ b/kdeprint/ext/kmextuimanager.cpp @@ -0,0 +1,44 @@ +/* + * This file is part of the KDE libraries + * Copyright (c) 2001 Michael Goffioul + * + * 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 "kmextuimanager.h" +#include "kpqtpage.h" +#include "kprinterpropertydialog.h" + +#include + +KMExtUiManager::KMExtUiManager(QObject *parent, const char *name, const QStringList & /*args*/) +: KMUiManager(parent,name) +{ + m_printdialogflags |= KMUiManager::PrintCommand; +} + +KMExtUiManager::~KMExtUiManager() +{ +} + +int KMExtUiManager::pluginPageCap() +{ + return KMUiManager::NoAutoCollate; +} + +void KMExtUiManager::setupPrinterPropertyDialog( KPrinterPropertyDialog *dlg ) +{ + dlg->addPage( new KPQtPage( dlg, "QtPage" ) ); +} diff --git a/kdeprint/ext/kmextuimanager.h b/kdeprint/ext/kmextuimanager.h new file mode 100644 index 000000000..daf31a406 --- /dev/null +++ b/kdeprint/ext/kmextuimanager.h @@ -0,0 +1,35 @@ +/* + * This file is part of the KDE libraries + * Copyright (c) 2001 Michael Goffioul + * + * 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 KMEXTUIMANAGER_H +#define KMEXTUIMANAGER_H + +#include "kmuimanager.h" + +class KMExtUiManager : public KMUiManager +{ +public: + KMExtUiManager(QObject *parent, const char *name, const QStringList & /*args*/); + ~KMExtUiManager(); + + int pluginPageCap(); + void setupPrinterPropertyDialog( KPrinterPropertyDialog* ); +}; + +#endif -- cgit v1.2.1