viewmode.h 2.63 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/***************************************************************************
                          viewmode.h
                             -------------------
    begin                : Sat Jun 7 2003
    copyright            : (C) 2003 by Scott Wheeler, 
    email                : wheeler@kde.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef VIEWMODE_H
#define VIEWMODE_H

#include <klocale.h>

#include <qstring.h>
24
#include <qdict.h>
25

26 27
#include "playlistbox.h"

28 29 30 31 32 33 34 35 36 37 38 39
class QPainter;
class QColorGroup;

class ViewMode
{
public:
    ViewMode(PlaylistBox *b);
    virtual ~ViewMode();

    virtual QString name() const      { return i18n("Default"); }
    virtual void setShown(bool shown);

40
    virtual void paintCell(PlaylistBox::Item *item,
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
                           QPainter *painter, 
                           const QColorGroup &colorGroup,
                           int column, int width, int align);
    
protected:
    PlaylistBox *playlistBox() const { return m_playlistBox; }
    bool visible() const             { return m_visible; }
    void updateIcons(int size);

private:
    PlaylistBox *m_playlistBox;
    bool m_visible;
};

////////////////////////////////////////////////////////////////////////////////

class CompactViewMode : public ViewMode
{
public:
    CompactViewMode(PlaylistBox *b);
    virtual ~CompactViewMode();
    
    virtual QString name() const { return i18n("Compact"); }
    virtual void setShown(bool shown);

66
    virtual void paintCell(PlaylistBox::Item *item,
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
                           QPainter *painter,
                           const QColorGroup &colorGroup,
                           int column, int width, int align);
};

////////////////////////////////////////////////////////////////////////////////

class TreeViewMode : public CompactViewMode
{
public:
    TreeViewMode(PlaylistBox *l);
    virtual ~TreeViewMode();

    virtual QString name() const { return i18n("Tree"); }
    virtual void setShown(bool shown);
82 83

private:
84
    QDict<PlaylistBox::Item> m_categories;
85 86 87
};

#endif