1
//////////////////////////////////////////////////////////////////////////////
5
// Copyright (C) 2003-2004 Renchi Raju <renchi at pooh.tam.uiuc.edu>
6
// Gilles CAULIER <caulier dot gilles at free.fr>
8
// Original printing code from Kuickshow program.
9
// Copyright (C) 2002 Carsten Pfeiffer <pfeiffer at kde.org>
11
// This program is free software; you can redistribute it and/or modify
12
// it under the terms of the GNU General Public License as published by
13
// the Free Software Foundation; either version 2 of the License, or
14
// (at your option) any later version.
16
// This program is distributed in the hope that it will be useful,
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
// GNU General Public License for more details.
21
// You should have received a copy of the GNU General Public License
22
// along with this program; if not, write to the Free Software
23
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
//////////////////////////////////////////////////////////////////////////////
33
#include <qfontmetrics.h>
35
#include <qguardedptr.h>
41
#include <kdeprint/kprintdialogpage.h>
45
#include "thumbnailjob.h"
57
class ImageViewPrivate;
59
class ImageView : public QWidget
65
// For a list of items
66
ImageView(QWidget* parent, const KURL::List& urlList,
67
const KURL& urlCurrent, bool fromCameraUI=false);
70
ImageView(QWidget* parent, const KURL& urlCurrent,
71
bool fromCameraUI=false);
81
void setupConnections();
84
void setupPopupMenu();
85
void addMenuItem(QPopupMenu *menu, CAction *action);
86
void addKeyInDict(const QString& key);
87
void promptUserSave();
88
void loadCurrentItem();
89
void setPrevAction(bool val);
90
void setNextAction(bool val);
94
bool printImageWithQt( const QString& filename, KPrinter& printer,
95
const QString& originalFileName );
96
void addConfigPages();
97
QString minimizeString( QString text, const QFontMetrics& metrics,
103
bool fromCameraUIFlag; // Flag used for to limit ImageViewer options
104
// when the images are opened from the cameraUI
105
// interface (like 'Image Comments Editor'
106
// and 'Remove From Album').
108
QGuardedPtr<Digikam::ThumbnailJob> m_thumbJob;
112
void closeEvent(QCloseEvent *e);
116
void slotNextImage();
117
void slotPrevImage();
118
void slotShowRotateMenu();
119
void slotShowFlipMenu();
120
void slotShowContextMenu();
123
void slotSaveResult(KIO::Job *job);
124
void slotSaveAsResult(KIO::Job *job);
125
void slotToggleAutoZoom();
126
void slotToggleFullScreen();
127
void slotZoomChanged(double zoom);
128
void slotCropSelected(bool val);
129
void slotChanged(bool val);
132
void slotCommentsEdit();
134
void slotRemoveCurrentItemfromAlbum();
135
void slot_onDeleteCurrentItemFinished(KIO::Job *job);
136
void slotKeyPress(int key);
137
void slotPrintImage();
138
void slotImageProperties();
139
void slotImageNameActived(const QString & filename);
141
void slotAbout(void);
142
void slotGotPreview(const KURL &url, const QPixmap &pixmap);
143
void slotPreviewCompleted(void);
147
///////////////////////////////////////////////////////////////////////////////////
149
class ImageViewPrintDialogPage : public KPrintDialogPage
155
ImageViewPrintDialogPage( QWidget *parent = 0L, const char *name = 0 );
156
~ImageViewPrintDialogPage();
158
virtual void getOptions(QMap<QString,QString>& opts, bool incldef = false);
159
virtual void setOptions(const QMap<QString,QString>& opts);
163
void toggleScaling( bool enable );
167
// return values in pixels!
168
int scaleWidth() const;
169
int scaleHeight() const;
171
void setScaleWidth( int pixels );
172
void setScaleHeight( int pixels );
174
int fromUnitToPixels( float val ) const;
175
float pixelsToUnit( int pixels ) const;
177
QCheckBox *m_shrinkToFit;
178
QRadioButton *m_scale;
179
KIntNumInput *m_width;
180
KIntNumInput *m_height;
182
QCheckBox *m_addFileName;
183
QCheckBox *m_blackwhite;
186
#endif // IMAGEVIEW_H