1 #include <Browser/BreadcrumbList.h>
2 #include <QContextMenuEvent>
5 #include <QResizeEvent>
8 /* Copyright (C) 2003-2006 Jesper K. Pedersen <blackie@kde.org>
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; see the file COPYING. If not, write to
22 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA.
28 class BreadcrumbViewer
;
36 #include "DB/ImageInfoList.h"
37 #include <kmainwindow.h>
38 #include "Settings/SettingsData.h"
40 #include <kxmlguiwindow.h>
42 #include <config-kpa-kipi.h>
44 # include <libkipi/pluginloader.h>
46 #include "DB/Result.h"
47 #include "DB/ResultId.h"
49 namespace Plugins
{ class Interface
; }
50 namespace ThumbnailView
{ class ThumbnailFacade
; }
51 namespace Browser
{ class BrowserWidget
; }
52 namespace AnnotationDialog
{ class Dialog
; }
53 namespace Settings
{ class SettingsDialog
; }
54 namespace DateBar
{ class DateBarWidget
; }
55 namespace HTMLGenerator
{ class HTMLDialog
; }
64 class Window
:public KXmlGuiWindow
69 Window( QWidget
* parent
);
71 static void configureImages( const DB::ImageInfoList
& list
, bool oneAtATime
);
72 static Window
* theMainWindow();
73 DB::Result
selected(bool keepSortOrderOfDatabase
=false);
74 DB::ImageSearchInfo
currentContext();
75 QString
currentBrowseCategory() const;
76 void setStackHead( const DB::ResultId image
);
79 void showThumbNails(const DB::Result
& items
);
83 void showThumbNails();
86 void slotConfigureAllImages();
87 void slotConfigureImagesOneAtATime();
88 void slotCreateImageStack();
89 void slotUnStackImages();
90 void slotSetStackHead();
92 void slotCopySelectedURLs();
93 void slotDeleteSelected();
94 void slotReReadExifInfo();
96 void slotView( bool reuse
= true, bool slideShow
= false, bool random
= false );
97 void slotViewNewWindow();
98 void slotSortByDateAndTime();
99 void slotLimitToSelected();
100 void slotExportToHTML();
103 void slotOptionGroupChanged();
106 void lockToDefaultScope();
107 void setDefaultScopePositive();
108 void setDefaultScopeNegative();
109 void unlockFromDefaultScope();
110 void changePassword();
111 void slotConfigureKeyBindings();
112 void slotSetFileName( const DB::ResultId
& );
113 void slotThumbNailSelectionChanged(int selectionSize
);
114 void reloadThumbnails(bool flushCache
);
115 void reloadThumbnailsAndFlushCache();
116 void reloadThumbnailsAfterRotation();
117 void slotUpdateViewMenu( DB::Category::ViewType
);
118 void slotShowNotOnDisk();
119 void slotBuildThumbnails();
120 void slotRunSlideShow();
121 void slotRunRandomizedSlideShow();
122 void slotConfigureToolbars();
123 void slotNewToolbarConfig();
127 void slotReenableMessages();
128 void slotImagesChanged( const KUrl::List
& );
129 void slotSelectionChanged(int count
);
131 void slotRemoveTokens();
132 void slotShowListOfFiles();
133 void updateDateBar( const Browser::BreadcrumbList
& );
134 void updateDateBar();
135 void slotShowImagesWithInvalidDate();
136 void slotShowImagesWithChangedMD5Sum();
137 void showDateBarTip( const QString
& );
138 void slotJumpToContext();
139 void setDateRange( const DB::ImageDate
& );
140 void clearDateRange();
141 void startAutoSaveTimer();
142 void convertBackend();
143 void slotRecalcCheckSums();
144 void slotShowExifInfo();
146 void showImage( const DB::ResultId
& fileName
);
147 void slotOrderIncr();
148 void slotOrderDecr();
149 void slotRotateSelectedLeft();
150 void slotRotateSelectedRight();
151 void rotateSelected( int angle
);
153 void slotStatistics();
154 void slotRecreateExifDB();
157 void configureImages( bool oneAtATime
);
159 virtual void closeEvent( QCloseEvent
* e
);
160 virtual void resizeEvent( QResizeEvent
* );
161 virtual void moveEvent ( QMoveEvent
* );
163 void createAnnotationDialog();
165 virtual void contextMenuEvent( QContextMenuEvent
* e
);
166 void setLocked( bool b
, bool force
);
167 void configImages( const DB::ImageInfoList
& list
, bool oneAtATime
);
168 void updateStates( bool thumbNailView
);
169 DB::Result
selectedOnDisk();
170 void setupPluginMenu();
171 void launchViewer(const DB::Result
& mediaList
, bool reuse
, bool slideShow
, bool random
);
172 void setupStatusBar();
173 void setPluginMenuState( const char* name
, const QList
<QAction
*>& actions
);
174 void createSarchBar();
177 static Window
* _instance
;
179 ThumbnailView::ThumbnailFacade
* _thumbnailView
;
180 Settings::SettingsDialog
* _optionsDialog
;
181 QPointer
<AnnotationDialog::Dialog
> _annotationDialog
;
182 Q3WidgetStack
* _stack
;
184 QTimer
* _autoSaveTimer
;
185 Browser::BrowserWidget
* _browser
;
186 KTipDialog
* _tipDialog
;
187 DeleteDialog
* _deleteDialog
;
188 DirtyIndicator
* _dirtyIndicator
;
189 QLabel
* _lockedIndicator
;
192 KAction
* _setDefaultPos
;
193 KAction
* _setDefaultNeg
;
194 KAction
* _jumpToContext
;
195 HTMLGenerator::HTMLDialog
* _htmlDialog
;
196 KAction
* _configOneAtATime
;
197 KAction
* _configAllSimultaniously
;
198 KAction
* _createImageStack
;
199 KAction
* _unStackImages
;
200 KAction
* _setStackHead
;
204 KAction
* _sortByDateAndTime
;
205 KAction
* _viewInNewWindow
;
206 KActionMenu
* _viewMenu
;
207 KToggleAction
* _smallListView
;
208 KToggleAction
* _largeListView
;
209 KToggleAction
* _smallIconView
;
210 KToggleAction
* _largeIconView
;
211 KAction
* _generateHtml
;
214 KAction
* _deleteSelected
;
215 KAction
* _limitToMarked
;
217 KAction
* _runSlideShow
;
218 KAction
* _runRandomSlideShow
;
219 Plugins::Interface
* _pluginInterface
;
220 KAction
* _showExifDialog
;
222 KIPI::PluginLoader
* _pluginLoader
;
224 KAction
* _recreateThumbnails
;
225 TokenEditor
* _tokenEditor
;
226 DateBar::DateBarWidget
* _dateBar
;
227 bool _hasLoadedPlugins
;
228 ImageCounter
* _partial
;
229 BreadcrumbViewer
* _pathIndicator
;
230 QMap
<Qt::Key
, QPair
<QString
,QString
> > _viewerInputMacros
;
235 #endif /* MAINVIEW_H */