diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
commit | 8362bf63dea22bbf6736609b0f49c152f975eb63 (patch) | |
tree | 0eea3928e39e50fae91d4e68b21b1e6cbae25604 /filters/kpresenter/jpeg | |
download | koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip |
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'filters/kpresenter/jpeg')
-rw-r--r-- | filters/kpresenter/jpeg/Makefile.am | 24 | ||||
-rw-r--r-- | filters/kpresenter/jpeg/jpegexport.cpp | 82 | ||||
-rw-r--r-- | filters/kpresenter/jpeg/jpegexport.h | 38 | ||||
-rw-r--r-- | filters/kpresenter/jpeg/kpresenter_jpeg_export.desktop | 52 |
4 files changed, 196 insertions, 0 deletions
diff --git a/filters/kpresenter/jpeg/Makefile.am b/filters/kpresenter/jpeg/Makefile.am new file mode 100644 index 00000000..9f5106c2 --- /dev/null +++ b/filters/kpresenter/jpeg/Makefile.am @@ -0,0 +1,24 @@ +####### General stuff + +INCLUDES= -I$(srcdir) $(KOFFICE_INCLUDES) \ + -I$(top_srcdir)/kpresenter \ + -I$(top_srcdir)/lib/kotext \ + -I$(top_srcdir)/filters/libdialogfilter \ + -I$(top_srcdir)/filters/kpresenter/libimageexport \ + $(all_includes) + +####### Files + +kde_module_LTLIBRARIES = libkpresenterjpegexport.la + +libkpresenterjpegexport_la_SOURCES = jpegexport.cpp +libkpresenterjpegexport_la_LDFLAGS = -module $(KDE_PLUGIN) -no-undefined +libkpresenterjpegexport_la_LIBADD = ../../../kpresenter/libkpresenterprivate.la ../../../filters/libdialogfilter/libdialogfilter.la ../libimageexport/libkpresenterimageexport.la $(KOFFICE_LIBS) +noinst_HEADERS = \ + jpegexport.h + +METASOURCES = AUTO + +service_DATA = kpresenter_jpeg_export.desktop +servicedir = $(kde_servicesdir) + diff --git a/filters/kpresenter/jpeg/jpegexport.cpp b/filters/kpresenter/jpeg/jpegexport.cpp new file mode 100644 index 00000000..b62d985d --- /dev/null +++ b/filters/kpresenter/jpeg/jpegexport.cpp @@ -0,0 +1,82 @@ +/* This file is part of the KDE project + Copyright (C) 2005 Laurent Montel <montel@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + 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 <qpixmap.h> +#include <qpainter.h> + +#include <kmessagebox.h> + +#include <KoFilterChain.h> +#include <KoStore.h> +#include <kgenericfactory.h> +#include <KoDocument.h> + +#include "KPrDocument.h" +#include "KPrView.h" +#include "KPrCanvas.h" +#include "jpegexport.h" +#include "exportsizedia.h" + +typedef KGenericFactory<JpegExport, KoFilter> jpegExportFactory; +K_EXPORT_COMPONENT_FACTORY( libkpresenterjpegexport, jpegExportFactory( "jpegexport" ) ) + +JpegExport::JpegExport(KoFilter *fil, const char *name, const QStringList&lst) + : ImageExport(fil,name,lst) +{ +} + +JpegExport::~JpegExport() +{ +} + +bool JpegExport::extraImageAttribute() +{ + bool ret = false; + ExportSizeDia *exportDialog = new ExportSizeDia( width, height, + 0, "exportdialog"); + if (exportDialog->exec()) { + width = exportDialog->width(); + height = exportDialog->height(); + + kdDebug() << "MNG Export: size = [" << width << "," << height << "]" << endl; + ret = true; + } + delete exportDialog; + return ret; +} + + +bool JpegExport::saveImage( QString fileName) +{ + bool ret = pixmap.save( fileName, "JPEG" ); + // Save the image. + if ( !ret ) { + KMessageBox::error( 0, i18n( "Failed to write file." ), + i18n( "JPEG Export Error" ) ); + } + return ret; +} + +const char * JpegExport::exportFormat() +{ + return "image/jpeg"; +} + +#include "jpegexport.moc" + diff --git a/filters/kpresenter/jpeg/jpegexport.h b/filters/kpresenter/jpeg/jpegexport.h new file mode 100644 index 00000000..873e463f --- /dev/null +++ b/filters/kpresenter/jpeg/jpegexport.h @@ -0,0 +1,38 @@ +/* This file is part of the KDE project + Copyright (C) 2005 Laurent Montel <montel@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + 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 __XPMEXPORT_H__ +#define __XPMEXPORT_H__ + +#include "imageexport.h" + +class JpegExport : public ImageExport +{ + Q_OBJECT + +public: + JpegExport(KoFilter *parent, const char *name, const QStringList&); + virtual ~JpegExport(); + virtual bool saveImage( QString fileName); + virtual bool extraImageAttribute(); + virtual const char * exportFormat(); +}; + +#endif // __XPMEXPORT_H__ + diff --git a/filters/kpresenter/jpeg/kpresenter_jpeg_export.desktop b/filters/kpresenter/jpeg/kpresenter_jpeg_export.desktop new file mode 100644 index 00000000..868eac79 --- /dev/null +++ b/filters/kpresenter/jpeg/kpresenter_jpeg_export.desktop @@ -0,0 +1,52 @@ +[Desktop Entry] +Type=Service +Name=KPresenter JPEG Export Filter +Name[ar]=مرشح تصدير JPEG لدى KPresenter +Name[bg]=Филтър за експортиране от Kpresenter в JPEG +Name[br]=Sil ezporzh JPEG evit KPresenter +Name[ca]=Filtre d'exportació JPEG per a KPresenter +Name[da]=KPræsenter JPEG-eksportfilter +Name[de]=KPresenter JPEG-Exportfilter +Name[el]=Φίλτρο εξαγωγής JPEG του KPresenter +Name[eo]=KPresenter JPEG-eksportfiltrilo +Name[es]=Filtro de exportación a JPEG para KPresenter +Name[et]=KPresenteri JPEG ekspordifilter +Name[fa]=پالایۀ صادرات KPresenter JPEG +Name[fi]=KPresenter JPEG -vientisuodin +Name[fr]=Filtre d'exportation JPEG de KPresenter +Name[fy]=JPEG-Eksportfilter foar KPresenter +Name[ga]=Scagaire Easpórtála JPEG KPresenter +Name[gl]=Filtro de Exportación de JPEG para KPresenter +Name[he]=KPresenter JPEG מסנן יצוא +Name[hr]=KPresenter JPEG filtar izvoza +Name[hu]=KPresenter JPEG exportszűrő +Name[is]=KPresenter JPEG útflutningssía +Name[it]=Filtro di esportazione JPEG per KPresenter +Name[ja]=KPresenter JPEG エクスポートフィルタ +Name[km]=តម្រងនាំចេញ JPEG សម្រាប់ KPresenter +Name[lt]=KPresenter JPEG eksportavimo filtras +Name[lv]=KPresenter JPEG eksporta filtrs +Name[nb]=JPEG-eksportfilter for KPresenter +Name[nds]=JPEG-Exportfilter för KPresenter +Name[ne]=केडीई प्रस्तुतकर्ता जेपीईजी निर्यात फिल्टर +Name[nl]=JPEG-exportfilter voor KPresenter +Name[pl]=Filtr eksportu do formatu JPEG z KPresenter +Name[pt]=Filtro de Exportação de JPEG para o KPresenter +Name[pt_BR]=Filtro de Exportação de JPEG para o KPresenter +Name[ru]=Фильтр экспорта презентаций KPresenter в JPEG +Name[se]=KPresnter JPEG-olggosfievrridansilli +Name[sk]=Exportný filter KPresenter JPEG +Name[sl]=Izvozni filter JPEG za KPresenter +Name[sr]=KChart-ов филтер за извоз у JPEG +Name[sr@Latn]=KChart-ov filter za izvoz u JPEG +Name[sv]=Kpresenter JPEG-exportfilter +Name[uk]=Фільтр експорту JPEG для KPresenter +Name[uz]=KPresenter JPEG eksport filteri +Name[uz@cyrillic]=KPresenter JPEG экспорт филтери +Name[zh_CN]=KPresenter JPEG 导出过滤器 +Name[zh_TW]=KPresenter JPEG 匯出過濾程式 +X-KDE-Import=application/x-kpresenter +X-KDE-Export=image/jpeg +X-KDE-Weight=1 +X-KDE-Library=libkpresenterjpegexport +ServiceTypes=KOfficeFilter |