00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KFILE_IVI_DESKTOP
00025 #define KFILE_IVI_DESKTOP
00026
00027 #include <tqcolor.h>
00028 #include <tqpixmap.h>
00029 #include <tqimage.h>
00030 #include <tqstring.h>
00031 #include <kfileivi.h>
00032
00033
00034
00035
00036 #define DITHER_FLAGS (Qt::DiffuseAlphaDither | Qt::ColorOnly | Qt::AvoidDither)
00037
00038
00039 class TQFont;
00040 class KShadowEngine;
00041
00048 class KFileIVIDesktop : public KFileIVI
00049 {
00050 public:
00059 KFileIVIDesktop(KonqIconViewWidget *iconview, KFileItem* fileitem, int
00060 size, KShadowEngine *shadow = 0L);
00061
00065 ~KFileIVIDesktop();
00066
00067 protected:
00072 virtual void calcRect( const TQString& _text );
00073
00080 virtual void paintItem(TQPainter *p, const TQColorGroup &cg);
00081
00088 virtual void drawShadowedText(TQPainter *p, const TQColorGroup &cg);
00089
00097 virtual TQImage *buildShadow(TQPainter *p, const int align, TQColor &shadowColor);
00098
00099 protected:
00100 void setNormalImage(TQImage *newImage) { delete m_normalImage; m_normalImage = newImage; };
00101 void setSelectedImage(TQImage *newImage) { delete m_selectedImage; m_selectedImage = newImage; };
00102
00103 TQImage *normalImage() { return m_normalImage; };
00104 TQImage *selectedImage() { return m_selectedImage; };
00105
00106 private:
00107 bool shouldUpdateShadow(bool selected);
00108 int shadowThickness() const;
00109
00110 KShadowEngine *m_shadow;
00111
00112 TQImage *m_selectedImage;
00113 TQImage *m_normalImage;
00114
00115 TQString oldText;
00116
00117 unsigned long _selectedUID;
00118 unsigned long _normalUID;
00119
00120 };
00121
00122 #endif