diff options
Diffstat (limited to 'filters/kchart/bmp')
-rw-r--r-- | filters/kchart/bmp/Makefile.am | 24 | ||||
-rw-r--r-- | filters/kchart/bmp/bmpexport.cpp | 76 | ||||
-rw-r--r-- | filters/kchart/bmp/bmpexport.h | 38 | ||||
-rw-r--r-- | filters/kchart/bmp/kchart_bmp_export.desktop | 52 |
4 files changed, 190 insertions, 0 deletions
diff --git a/filters/kchart/bmp/Makefile.am b/filters/kchart/bmp/Makefile.am new file mode 100644 index 00000000..de6eedf5 --- /dev/null +++ b/filters/kchart/bmp/Makefile.am @@ -0,0 +1,24 @@ +####### General stuff + +INCLUDES= -I$(srcdir) $(KOFFICE_INCLUDES) \ + -I$(top_srcdir)/kchart \ + -I$(top_srcdir)/kchart/kdchart \ + -I$(top_srcdir)/interfaces \ + -I$(top_srcdir)/filters/libdialogfilter \ + -I$(top_srcdir)/filters/kchart/libimageexport \ + $(all_includes) +####### Files + +kde_module_LTLIBRARIES = libkchartbmpexport.la + +libkchartbmpexport_la_SOURCES = bmpexport.cpp +libkchartbmpexport_la_LDFLAGS = -module $(KDE_PLUGIN) -no-undefined +libkchartbmpexport_la_LIBADD = ../../../kchart/libkchartcommon.la ../libimageexport/libkchartimageexport.la ../../../filters/libdialogfilter/libdialogfilter.la $(KOFFICE_LIBS) +noinst_HEADERS = \ + bmpexport.h + +METASOURCES = AUTO + +service_DATA = kchart_bmp_export.desktop +servicedir = $(kde_servicesdir) + diff --git a/filters/kchart/bmp/bmpexport.cpp b/filters/kchart/bmp/bmpexport.cpp new file mode 100644 index 00000000..26ff2fe1 --- /dev/null +++ b/filters/kchart/bmp/bmpexport.cpp @@ -0,0 +1,76 @@ +/* This file is part of the KDE project + Copyright (C) 2005 Laurent Montel <[email protected]> + + 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 "bmpexport.h" +#include "exportsizedia.h" + +typedef KGenericFactory<BmpExport, KoFilter> bmpExportFactory; +K_EXPORT_COMPONENT_FACTORY( libkchartbmpexport, bmpExportFactory( "bmpexport" ) ) + +BmpExport::BmpExport(KoFilter *fil, const char *name, const QStringList&lst) + : ImageExport(fil,name,lst) +{ +} + +BmpExport::~BmpExport() +{ +} + +void BmpExport::extraImageAttribute() +{ + ExportSizeDia *exportDialog = new ExportSizeDia( width, height, + 0, "exportdialog"); + if (exportDialog->exec()) { + width = exportDialog->width(); + height = exportDialog->height(); + + kdDebug() << "PNG Export: size = [" << width << "," << height << "]" << endl; + } + delete exportDialog; +} + + +bool BmpExport::saveImage( QString fileName) +{ + bool ret = pixmap.save( fileName, "BMP" ); + // Save the image. + if ( !ret ) { + KMessageBox::error( 0, i18n( "Failed to write file." ), + i18n( "BMP Export Error" ) ); + } + return ret; +} + +const char * BmpExport::exportFormat() +{ + return "image/x-bmp"; +} + +#include "bmpexport.moc" + diff --git a/filters/kchart/bmp/bmpexport.h b/filters/kchart/bmp/bmpexport.h new file mode 100644 index 00000000..89afa941 --- /dev/null +++ b/filters/kchart/bmp/bmpexport.h @@ -0,0 +1,38 @@ +/* This file is part of the KDE project + Copyright (C) 2005 Laurent Montel <[email protected]> + + 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 __BMPEXPORT_H__ +#define __BMPEXPORT_H__ + +#include "imageexport.h" + +class BmpExport : public ImageExport +{ + Q_OBJECT + +public: + BmpExport(KoFilter *parent, const char *name, const QStringList&); + virtual ~BmpExport(); + virtual bool saveImage( QString fileName); + virtual void extraImageAttribute(); + virtual const char * exportFormat(); +}; + +#endif // __PNGEXPORT_H__ + diff --git a/filters/kchart/bmp/kchart_bmp_export.desktop b/filters/kchart/bmp/kchart_bmp_export.desktop new file mode 100644 index 00000000..008fd000 --- /dev/null +++ b/filters/kchart/bmp/kchart_bmp_export.desktop @@ -0,0 +1,52 @@ +[Desktop Entry] +Type=Service +Name=KChart BMP Export Filter +Name[ar]=مِرْشَح تصدير BMP لدى Karbon14 +Name[bg]=Филтър за експортиране от KChart в BMP +Name[br]=Sil ezporzh BMP evit KChart +Name[ca]=Filtre d'exportació BMP per a KChart +Name[da]=KChart BMP-eksportfilter +Name[de]=KChart BMP-Exportfilter +Name[el]=Φίλτρο εξαγωγής BMP του KChart +Name[eo]=KChart-BMP-eksportfiltrilo +Name[es]=Filtro de exportación a BMP para KChart +Name[et]=KCharti BMP ekspordifilter +Name[fa]=پالایۀ صادرات KChart BMP +Name[fi]=KChart BMP -vientisuodin +Name[fr]=Filtre d'exportation BMP de KChart +Name[fy]=BMP-Eksportfilter foar Kchart +Name[ga]=Scagaire Easpórtála BMP KChart +Name[gl]=Filtro de Exportación de BMP para KChart +Name[he]=KChart BMP מסנן יצוא +Name[hr]=KChart BMP filtar izvoza +Name[hu]=KChart BMP exportszűrő +Name[is]=KChart BMP útflutningssía +Name[it]=Filtro di esportazione BMP per KChart +Name[ja]=KChar BMP エクスポートフィルタ +Name[km]=តម្រងនាំចេញ BMP សម្រាប់ KChart +Name[lt]=KChart BMP eksportavimo filtras +Name[lv]=KChart BMP eksporta filtrs +Name[nb]=BMP-eksportfilter for KChart +Name[nds]=BMP-Exportfilter för KChart +Name[ne]=केडीई चित्रपट बीएमपी निर्यात फिल्टर +Name[nl]=BMP-exportfilter voor KChart +Name[pl]=Filtr eksportu do formatu BMP z KChart +Name[pt]=Filtro de Exportação de BMP para o KChart +Name[pt_BR]=Filtro de Exportação de BMP para o KChart +Name[ru]=Фильтр экспорта диаграмм KChart в BMP +Name[se]=KChart:a BMP-olggosfievrridansilli +Name[sk]=Exportný filter KChart BMP +Name[sl]=Izvozni filter BMP za KChart +Name[sr]=KChart-ов филтер за извоз у BMP +Name[sr@Latn]=KChart-ov filter za izvoz u BMP +Name[sv]=Kchart BMP-exportfilter +Name[uk]=Фільтр експорту BMP для KChart +Name[uz]=KChart BMP eksport filteri +Name[uz@cyrillic]=KChart BMP экспорт филтери +Name[zh_CN]=KChart BMP 导出过滤器 +Name[zh_TW]=KChart BMP 匯出過濾程式 +X-KDE-Import=application/x-kchart +X-KDE-Export=image/x-bmp +X-KDE-Weight=1 +X-KDE-Library=libkchartbmpexport +ServiceTypes=KOfficeFilter |