summaryrefslogtreecommitdiffstats
path: root/sidebar/listboxlink.h
blob: 66149206dc7e138fd845641763c25f3a2ac4ab82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

#ifndef LISTBOXLINK_H
#define LISTBOXLINK_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <qlistbox.h>

class KListBox;
class QPainter;
class QPixmap;
class QStringList;
class KURL;

class ListBoxLink : public QListBoxPixmap
{
friend class DnDListBox;

public:
   ListBoxLink(const QString & icon, uint size, const QString & title, const QString & url);
   ListBoxLink(const QPixmap & pixmap, const QString & title, const QString & url);
   ListBoxLink(ListBoxLink & link);
   ~ListBoxLink();
   QString & URL(){return url_;}
   void setURL(const QString & url);
   QString & icon(){return icon_;}
   void setIcon(const QString & icon);
   int height ( const QListBox * lb ) const;

private:
   QString url_; //TODO: make this KURL?!
   QString icon_;
};

class ListBoxDevice : public ListBoxLink
{
   friend class MediaListBox;
public:
   ListBoxDevice(const QString & icon, uint size, const QString & title, const QString & url, const QString & name, const QString & mountPoint, bool mounted, bool ejectable = FALSE, bool removable = FALSE, int id = 0);
   ListBoxDevice(const QPixmap & pixmap, const QString & title, const QString & url, const QString & name, const QString & mountPoint, bool mounted, bool ejectable = FALSE, bool removable = FALSE, int id = 0);
   ~ListBoxDevice(){};
   QString & name(){return name_;}
   bool mounted(){return mounted_;}
   bool ejectable(){return ejectable_;}
   bool removable(){return removable_;}
   QString & mountPoint(){return mountPoint_;}
   int id(){return id_;}
   int width ( const QListBox * lb ) const;

protected:
   void paint( QPainter * p );

private:
   QString name_;
   QString mountPoint_;
   bool mounted_;
   bool ejectable_;
   bool removable_;
   int id_;
};

#endif