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
27 class ThumbnailPainter
;
28 class ThumbnailToolTip
;
30 class ThumbnailFacade
:public QObject
, public ThumbnailFactory
34 static ThumbnailFacade
* instance();
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
);
47 void gotoDate( const DB::ImageDate
& date
, bool includeRanges
);
49 void showToolTipsOnImages( bool b
);
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();
59 void showImage( const DB::ResultId
& id
);
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
);
68 OVERRIDE ThumbnailModel
* model();
69 OVERRIDE CellGeometry
* cellGeometry();
70 OVERRIDE ThumbnailWidget
* widget();
71 OVERRIDE ThumbnailPainter
* painter();
72 OVERRIDE ThumbnailCache
* cache();
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 */