summaryrefslogtreecommitdiffstats
path: root/tdeprint/ext
diff options
context:
space:
mode:
Diffstat (limited to 'tdeprint/ext')
-rw-r--r--tdeprint/ext/CMakeLists.txt50
-rw-r--r--tdeprint/ext/Makefile.am15
-rw-r--r--tdeprint/ext/ext.print84
-rw-r--r--tdeprint/ext/kextprinterimpl.cpp52
-rw-r--r--tdeprint/ext/kextprinterimpl.h35
-rw-r--r--tdeprint/ext/kmextfactory.cpp28
-rw-r--r--tdeprint/ext/kmextmanager.cpp49
-rw-r--r--tdeprint/ext/kmextmanager.h40
-rw-r--r--tdeprint/ext/kmextuimanager.cpp44
-rw-r--r--tdeprint/ext/kmextuimanager.h35
10 files changed, 432 insertions, 0 deletions
diff --git a/tdeprint/ext/CMakeLists.txt b/tdeprint/ext/CMakeLists.txt
new file mode 100644
index 000000000..9f4b2d629
--- /dev/null
+++ b/tdeprint/ext/CMakeLists.txt
@@ -0,0 +1,50 @@
+#################################################
+#
+# (C) 2010 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+add_definitions(
+ -D_KDEPRINT_COMPILE
+)
+
+include_directories(
+ ${TQT_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/tdecore
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/tdecore
+ ${CMAKE_SOURCE_DIR}/tdeui
+ ${CMAKE_SOURCE_DIR}/tdeprint
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+##### other data ################################
+
+install( FILES ext.print DESTINATION ${DATA_INSTALL_DIR}/tdeprint/plugins )
+
+
+##### tdeprint_ext ##############################
+
+set( target tdeprint_ext )
+
+set( ${target}_SRCS
+ kmextfactory.cpp kmextmanager.cpp kextprinterimpl.cpp
+ kmextuimanager.cpp
+)
+
+tde_add_kpart( ${target} AUTOMOC
+ SOURCES ${${target}_SRCS}
+ LINK tdeprint-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
diff --git a/tdeprint/ext/Makefile.am b/tdeprint/ext/Makefile.am
new file mode 100644
index 000000000..66e547c9d
--- /dev/null
+++ b/tdeprint/ext/Makefile.am
@@ -0,0 +1,15 @@
+AM_CPPFLAGS = -D_KDEPRINT_COMPILE
+
+INCLUDES= -I$(top_srcdir) -I$(top_srcdir)/tdeprint $(all_includes)
+
+kde_module_LTLIBRARIES = tdeprint_ext.la
+
+tdeprint_ext_la_SOURCES = kmextfactory.cpp kmextmanager.cpp kextprinterimpl.cpp kmextuimanager.cpp
+tdeprint_ext_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
+tdeprint_ext_la_LIBADD = $(LIB_KDEPRINT) $(LIB_QT) $(LIB_KDECORE)
+tdeprint_ext_la_METASOURCES = AUTO
+
+noinst_HEADERS = kmextmanager.h kextprinterimpl.h kmextuimanager.h
+
+entry_DATA = ext.print
+entrydir = $(kde_datadir)/tdeprint/plugins
diff --git a/tdeprint/ext/ext.print b/tdeprint/ext/ext.print
new file mode 100644
index 000000000..ce300e5ae
--- /dev/null
+++ b/tdeprint/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/tdeprint/ext/kextprinterimpl.cpp b/tdeprint/ext/kextprinterimpl.cpp
new file mode 100644
index 000000000..c976f54e0
--- /dev/null
+++ b/tdeprint/ext/kextprinterimpl.cpp
@@ -0,0 +1,52 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
+ *
+ * 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 <tqfile.h>
+#include <kstandarddirs.h>
+#include <kconfig.h>
+#include <klocale.h>
+
+KExtPrinterImpl::KExtPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/)
+: KPrinterImpl(parent,name)
+{
+}
+
+KExtPrinterImpl::~KExtPrinterImpl()
+{
+}
+
+void KExtPrinterImpl::preparePrinting(KPrinter *printer)
+{
+ printer->setOption("kde-qtcopies",TQString::number(printer->numCopies()));
+}
+
+bool KExtPrinterImpl::setupCommand(TQString& 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/tdeprint/ext/kextprinterimpl.h b/tdeprint/ext/kextprinterimpl.h
new file mode 100644
index 000000000..169e06bf4
--- /dev/null
+++ b/tdeprint/ext/kextprinterimpl.h
@@ -0,0 +1,35 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
+ *
+ * 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(TQObject *parent, const char *name, const TQStringList & /*args*/);
+ ~KExtPrinterImpl();
+
+ void preparePrinting(KPrinter*);
+ bool setupCommand(TQString&, KPrinter*);
+};
+
+#endif
diff --git a/tdeprint/ext/kmextfactory.cpp b/tdeprint/ext/kmextfactory.cpp
new file mode 100644
index 000000000..de8c58dfe
--- /dev/null
+++ b/tdeprint/ext/kmextfactory.cpp
@@ -0,0 +1,28 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
+ *
+ * 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 <kgenericfactory.h>
+
+typedef K_TYPELIST_3( KMExtManager, KMExtUiManager, KExtPrinterImpl ) Products;
+K_EXPORT_COMPONENT_FACTORY( tdeprint_ext, KGenericFactory< Products > )
+
diff --git a/tdeprint/ext/kmextmanager.cpp b/tdeprint/ext/kmextmanager.cpp
new file mode 100644
index 000000000..598dd6648
--- /dev/null
+++ b/tdeprint/ext/kmextmanager.cpp
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
+ *
+ * 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 <klocale.h>
+
+KMExtManager::KMExtManager(TQObject *parent, const char *name, const TQStringList & /*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/tdeprint/ext/kmextmanager.h b/tdeprint/ext/kmextmanager.h
new file mode 100644
index 000000000..c7faab6cf
--- /dev/null
+++ b/tdeprint/ext/kmextmanager.h
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
+ *
+ * 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 <tqdict.h>
+#include <tqdatetime.h>
+
+class KMExtManager : public KMManager
+{
+public:
+ KMExtManager(TQObject *parent, const char *name, const TQStringList & /*args*/);
+ ~KMExtManager();
+
+protected:
+ void listPrinters();
+
+private:
+ KMPrinter *m_psprinter;
+};
+
+#endif
diff --git a/tdeprint/ext/kmextuimanager.cpp b/tdeprint/ext/kmextuimanager.cpp
new file mode 100644
index 000000000..2fa200848
--- /dev/null
+++ b/tdeprint/ext/kmextuimanager.cpp
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
+ *
+ * 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 <klocale.h>
+
+KMExtUiManager::KMExtUiManager(TQObject *parent, const char *name, const TQStringList & /*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/tdeprint/ext/kmextuimanager.h b/tdeprint/ext/kmextuimanager.h
new file mode 100644
index 000000000..bca161c60
--- /dev/null
+++ b/tdeprint/ext/kmextuimanager.h
@@ -0,0 +1,35 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
+ *
+ * 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(TQObject *parent, const char *name, const TQStringList & /*args*/);
+ ~KMExtUiManager();
+
+ int pluginPageCap();
+ void setupPrinterPropertyDialog( KPrinterPropertyDialog* );
+};
+
+#endif