File indexing completed on 2024-04-28 04:21:21
0001 // SPDX-FileCopyrightText: 2003-2010 Jesper K. Pedersen <blackie@kde.org> 0002 // SPDX-FileCopyrightText: 2022 Johannes Zarl-Zierl <johannes@zarl-zierl.at> 0003 // 0004 // SPDX-License-Identifier: GPL-2.0-or-later 0005 0006 #ifndef CELLGEOMETRY_H 0007 #define CELLGEOMETRY_H 0008 #include "ThumbnailComponent.h" 0009 0010 #include <QRect> 0011 #include <QSize> 0012 0013 class QPixmap; 0014 class QRect; 0015 class QSize; 0016 0017 namespace DB 0018 { 0019 class Id; 0020 } 0021 0022 namespace ThumbnailView 0023 { 0024 class ThumbnailFactory; 0025 0026 class CellGeometry : public ThumbnailComponent 0027 { 0028 public: 0029 void flushCache(); 0030 explicit CellGeometry(ThumbnailFactory *factory); 0031 QSize cellSize() const; 0032 static QSize preferredIconSize(); 0033 static QSize baseIconSize(); 0034 QRect iconGeometry(const QPixmap &pixmap) const; 0035 int textHeight() const; 0036 QRect cellTextGeometry() const; 0037 void calculateCellSize(); 0038 0039 private: 0040 void calculateTextHeight(); 0041 void calculateCellTextGeometry(); 0042 0043 bool m_cacheInitialized = false; 0044 int m_textHeight = 0; 0045 QSize m_cellSize; 0046 QRect m_cellTextGeometry; 0047 }; 0048 0049 } 0050 0051 #endif /* CELLGEOMETRY_H */ 0052 0053 // vi:expandtab:tabstop=4 shiftwidth=4: