1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : Qt item view for images - category drawer
9
* Copyright (C) 2012 by Islam Wazery <wazery at ubuntu dot com>
11
* This program is free software; you can redistribute it
12
* and/or modify it under the terms of the GNU General
13
* Public License as published by the Free Software Foundation;
14
* either version 2, or (at your option)
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
22
* ============================================================ */
24
#ifndef IMPORTCATEGORYDRAWER_H
25
#define IMPORTCATEGORYDRAWER_H
29
#include <QStyleOptionViewItem>
33
#include <kdeversion.h>
34
#include <kcategorydrawer.h>
39
class ImportCategorizedView;
41
class ImportCategoryDrawer :
42
#if KDE_IS_VERSION(4,5,0)
43
public KCategoryDrawerV3
45
public KCategoryDrawerV2
50
ImportCategoryDrawer(ImportCategorizedView* const parent);
51
~ImportCategoryDrawer();
53
void setLowerSpacing(int spacing);
54
void setDefaultViewOptions(const QStyleOptionViewItem& option);
55
void invalidatePaintingCache();
57
virtual int categoryHeight(const QModelIndex& index, const QStyleOption& option) const;
58
virtual void drawCategory(const QModelIndex& index, int sortRole, const QStyleOption& option, QPainter* painter) const;
59
virtual int maximumHeight() const;
63
void updateRectsAndPixmaps(int width);
64
void viewHeaderText(const QModelIndex& index, QString* header, QString* subLine) const;
65
void textForFormat(const QModelIndex& index, QString* header, QString* subLine) const;
73
} // namespace Digikam
75
#endif // IMPORTCATEGORYDRAWER_H