00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MEDIAAPPLET_H
00021 #define MEDIAAPPLET_H
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026
00027 #include <kpanelapplet.h>
00028 #include <tqstring.h>
00029 #include <kconfig.h>
00030 #include <kurl.h>
00031 #include <kfileitem.h>
00032 #include <kdirlister.h>
00033
00034 #include <tqptrlist.h>
00035 #include "mediumbutton.h"
00036 typedef TQValueList<MediumButton*> MediumButtonList;
00037
00038
00039 class MediaApplet : public KPanelApplet
00040 {
00041 Q_OBJECT
00042
00043 public:
00044 MediaApplet(const TQString& configFile, Type t = Normal, int actions = 0,
00045 TQWidget *parent = 0, const char *name = 0);
00046 ~MediaApplet();
00047
00048 int widthForHeight(int height) const;
00049 int heightForWidth(int width) const;
00050 void about();
00051 void preferences();
00052
00053 protected:
00054 void arrangeButtons();
00055 void resizeEvent(TQResizeEvent *e);
00056 void positionChange(Position p);
00057 void reloadList();
00058 void loadConfig();
00059 void saveConfig();
00060 void mousePressEvent(TQMouseEvent *e);
00061
00062 protected slots:
00063 void slotClear();
00064 void slotStarted(const KURL &url);
00065 void slotCompleted();
00066 void slotNewItems(const KFileItemList &entries);
00067 void slotDeleteItem(KFileItem *fileItem);
00068 void slotRefreshItems(const KFileItemList &entries);
00069
00070 private:
00071 KDirLister *mpDirLister;
00072 MediumButtonList mButtonList;
00073 TQStringList mExcludedTypesList;
00074 TQStringList mExcludedList;
00075 KFileItemList mMedia;
00076 int mButtonSizeSum;
00077 };
00078
00079 #endif