~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/utilities/imageeditor/imagewindow.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.3.2 upstream) (37 hardy)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20080717202539-1bw3w3nrsso7yj4z
* New upstream release
  - digiKam 0.9.4 Release Plan (KDE3) ~ 13 July 08 (Closes: #490144)
* DEB_CONFIGURE_EXTRA_FLAGS := --without-included-sqlite3
* Debhelper compatibility level V7
* Install pixmaps in debian/*.install
* Add debian/digikam.lintian-overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ============================================================
2
 
 * Author: Renchi Raju <renchi@pooh.tam.uiuc.edu>
3
 
 *         Gilles Caulier <caulier dot gilles at free.fr>
4
 
 * Date  : 2004-02-12
5
 
 * Description : 
6
 
 * 
7
 
 * Copyright 2004-2005 by Renchi Raju, Gilles Caulier
8
 
 * Copyright 2006 by Gilles Caulier
9
 
 *
10
 
 * This program is free software; you can redistribute it
11
 
 * and/or modify it under the terms of the GNU General
12
 
 * Public License as published by the Free Software Foundation;
13
 
 * either version 2, or (at your option)
14
 
 * any later version.
15
 
 * 
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.
20
 
 * 
21
 
 * ============================================================ */
22
 
 
23
 
#ifndef IMAGEWINDOW_H
24
 
#define IMAGEWINDOW_H
25
 
 
26
 
// Qt includes.
27
 
 
28
 
#include <kmainwindow.h>
29
 
#include <qstring.h>
30
 
 
31
 
// Kde includes.
32
 
 
33
 
#include <kurl.h>
34
 
 
35
 
class QPopupMenu;
36
 
class QLabel;
37
 
class QStringList;
38
 
 
39
 
class KAccel;
40
 
class KAction;
41
 
class KActionMenu;
42
 
class KToolBarPopupAction;
43
 
class KToggleAction;
44
 
class KSelectAction;
45
 
 
46
 
class Canvas;
47
 
class AlbumIconView;
48
 
 
49
 
class ImageWindow : public KMainWindow
50
 
{
51
 
    Q_OBJECT
52
 
 
53
 
public:
54
 
 
55
 
    ~ImageWindow();
56
 
 
57
 
    void loadURL(const KURL::List& urlList, const KURL& urlCurrent,
58
 
                 const QString& caption=QString::null,
59
 
                 bool allowSaving=true,
60
 
                 AlbumIconView* view=0L);
61
 
                 
62
 
    void applySettings();
63
 
    
64
 
    static ImageWindow* imagewindow();
65
 
    
66
 
private:
67
 
 
68
 
    Canvas*                m_canvas;
69
 
    
70
 
    QPopupMenu*            m_contextMenu;
71
 
    
72
 
    KAccel*                m_accel;
73
 
 
74
 
    QLabel*                m_nameLabel;
75
 
    QLabel*                m_zoomLabel;
76
 
    QLabel*                m_resLabel;
77
 
    
78
 
    KURL::List             m_urlList;
79
 
    KURL                   m_urlCurrent;
80
 
    
81
 
    // Allow to use Image properties and Comments/Tags dialogs from main window.
82
 
    AlbumIconView*         m_view;
83
 
    
84
 
    // If image editor is launched by camera interface, current
85
 
    // image cannot be saved.
86
 
    bool                   m_allowSaving;
87
 
 
88
 
    // If current image file format is only available in read only,
89
 
    // typicially all RAW image file formats.
90
 
    bool                   m_isReadOnly;
91
 
    
92
 
    int                    m_JPEGCompression;
93
 
    int                    m_PNGCompression;
94
 
    
95
 
    bool                   m_TIFFCompression;
96
 
    bool                   m_rotatedOrFlipped;
97
 
    bool                   m_fullScreen;
98
 
    bool                   m_fullScreenHideToolBar;
99
 
    bool                   m_removeFullScreenButton;
100
 
 
101
 
    // Actions
102
 
 
103
 
    KAction               *m_navNextAction;
104
 
    KAction               *m_navPrevAction;
105
 
    KAction               *m_navFirstAction;
106
 
    KAction               *m_navLastAction;
107
 
 
108
 
    KAction               *m_saveAction;
109
 
    KAction               *m_saveAsAction;
110
 
    KAction               *m_restoreAction;
111
 
    
112
 
    KAction               *m_zoomPlusAction;
113
 
    KAction               *m_zoomMinusAction;
114
 
    KToggleAction         *m_zoomFitAction;
115
 
    KToggleAction         *m_fullScreenAction;
116
 
    KSelectAction         *m_viewHistogramAction;
117
 
 
118
 
    KActionMenu           *m_rotateAction;
119
 
    KActionMenu           *m_flipAction;
120
 
    KAction               *m_rotate90Action;
121
 
    KAction               *m_rotate180Action;
122
 
    KAction               *m_rotate270Action;
123
 
    KAction               *m_flipHorzAction;
124
 
    KAction               *m_flipVertAction;
125
 
 
126
 
    KAction               *m_resizeAction;
127
 
    KAction               *m_cropAction;
128
 
    
129
 
    KAction               *m_fileprint;    
130
 
    KAction               *m_fileproperties;
131
 
    KAction               *m_fileDelete;
132
 
    KAction               *m_commentedit;
133
 
    
134
 
    KAction               *m_copyAction;
135
 
    KToolBarPopupAction   *m_undoAction;
136
 
    KToolBarPopupAction   *m_redoAction;
137
 
    
138
 
    KAction               *m_imagePluginsHelp;
139
 
    
140
 
    static ImageWindow    *m_instance;
141
 
 
142
 
private:
143
 
 
144
 
    ImageWindow();
145
 
    void buildGUI();
146
 
    void readSettings();
147
 
    void saveSettings();
148
 
    bool promptUserSave();
149
 
    void plugActionAccel(KAction* action);
150
 
    void unplugActionAccel(KAction* action);
151
 
    bool save();
152
 
    bool saveAs();
153
 
 
154
 
signals:
155
 
 
156
 
    void signalFileDeleted(const KURL& url);
157
 
    void signalFileAdded(const KURL& url);
158
 
    void signalFileModified(const KURL& url);
159
 
    
160
 
private slots:
161
 
 
162
 
    void slotLoadCurrent();
163
 
    
164
 
    void slotLoadNext();
165
 
    void slotLoadPrev();
166
 
    void slotLoadFirst();
167
 
    void slotLoadLast();
168
 
 
169
 
    void slotToggleAutoZoom();
170
 
    void slotViewHistogram();
171
 
    void slotToggleFullScreen();
172
 
    void slotEscapePressed();
173
 
 
174
 
    void slotResize();
175
 
    
176
 
    void slotContextMenu();
177
 
    void slotZoomChanged(float zoom);
178
 
    void slotChanged(bool, bool);
179
 
    void slotSelected(bool);
180
 
 
181
 
    void slotRotatedOrFlipped();
182
 
 
183
 
    void slotSave()   { if (m_isReadOnly) saveAs(); else save(); };
184
 
    void slotSaveAs() { saveAs(); };
185
 
 
186
 
    void slotAboutToShowUndoMenu();
187
 
    void slotAboutToShowRedoMenu();
188
 
    
189
 
    void slotFilePrint();
190
 
    void slotFileProperties();
191
 
    void slotCommentsEdit();
192
 
    
193
 
    void slotDeleteCurrentItem();
194
 
 
195
 
    void slotImagePluginsHelp();
196
 
 
197
 
    void slotEditKeys();
198
 
    void slotConfToolbars();
199
 
    void slotNewToolbarConfig();
200
 
 
201
 
    void slotAssignTag(int tagID);
202
 
    void slotRemoveTag(int tagID);
203
 
    
204
 
protected:
205
 
 
206
 
    void closeEvent(QCloseEvent *e);
207
 
 
208
 
};
209
 
 
210
 
#endif /* IMAGEWINDOW_H */