Kraxy/EBN: missing Q_OBJECT
[kphotoalbum.git] / ThumbnailView / ThumbnailFacade.h
bloba9fe4ceac942a581d8a013fef385fcef6a21974c
1 /* Copyright (C) 2003-2009 Jesper K. Pedersen <blackie@kde.org>
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public
5 License as published by the Free Software Foundation; either
6 version 2 of the License, or (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; see the file COPYING. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
18 #ifndef THUMBNAILFACADE_H
19 #define THUMBNAILFACADE_H
20 #include "ThumbnailFactory.h"
21 #include "ThumbnailWidget.h"
23 namespace ThumbnailView
25 class ThumbnailModel;
26 class CellGeometry;
27 class ThumbnailPainter;
28 class ThumbnailToolTip;
30 class ThumbnailFacade :public QObject, public ThumbnailFactory
32 Q_OBJECT
33 public:
34 static ThumbnailFacade* instance();
35 ThumbnailFacade();
36 QWidget* gui();
37 void setCurrentItem( const DB::ResultId& id );
38 void reload( bool flushCache, bool clearSelection=true );
39 DB::Result selection(bool keepSortOrderOfDatabase=false) const;
40 DB::Result imageList(Order) const;
41 DB::ResultId mediaIdUnderCursor() const;
42 DB::ResultId currentItem() const;
43 void setImageList(const DB::Result& list);
44 void setSortDirection( SortDirection );
46 public slots:
47 void gotoDate( const DB::ImageDate& date, bool includeRanges );
48 void selectAll();
49 void showToolTipsOnImages( bool b );
50 void repaintScreen();
51 void toggleStackExpansion(const DB::ResultId& id);
52 void collapseAllStacks();
53 void expandAllStacks();
54 void updateDisplayModel();
55 void changeSingleSelection(const DB::ResultId& id);
56 void slotRecreateThumbnail();
58 signals:
59 void showImage( const DB::ResultId& id );
60 void showSelection();
61 void fileIdUnderCursorChanged( const DB::ResultId& id );
62 void currentDateChanged( const QDateTime& );
63 void selectionChanged(int numberOfItemsSelected );
64 void collapseAllStacksEnabled(bool enabled);
65 void expandAllStacksEnabled(bool enabled);
67 private:
68 OVERRIDE ThumbnailModel* model();
69 OVERRIDE CellGeometry* cellGeometry();
70 OVERRIDE ThumbnailWidget* widget();
71 OVERRIDE ThumbnailPainter* painter();
72 OVERRIDE ThumbnailCache* cache();
74 private:
75 static ThumbnailFacade* _instance;
76 CellGeometry* _cellGeometry;
77 ThumbnailModel* _model;
78 ThumbnailCache* _thumbnailCache;
79 ThumbnailWidget* _widget;
80 ThumbnailPainter* _painter;
81 ThumbnailToolTip* _toolTip;
85 #endif /* THUMBNAILFACADE_H */