1
/***************************************************************************
2
* Copyright (C) 2003 by S�bastien Lao�t *
3
* sebastient.laout@tuxfamily.org *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19
***************************************************************************/
38
#include <kapplication.h>
40
/**Store the style of links
41
*@author S�bastien Lao�t
46
LinkLook( bool underline = true, bool italic = false, bool bold = false, bool hoverUnder = true,
47
QColor color = QColor("blue"), QColor hoverColor = QColor("red"),
48
bool showIcon = true, int iconSize = 16, bool onTopIcon = false );
49
void setLook( bool underline = true, bool italic = false, bool bold = false, bool hoverUnder = true,
50
QColor color = QColor("blue"), QColor hoverColor = QColor("red"),
51
bool showIcon = true, int iconSize = 16, bool onTopIcon = false );
52
inline bool underline() { return m_underline; }
53
inline bool italic() { return m_italic; }
54
inline bool bold() { return m_bold; }
55
inline bool hoverUnder() { return m_hoverUnder; }
56
inline QColor color() { return m_color; }
57
inline QColor hoverColor() { return m_hoverColor; }
58
inline bool showIcon() { return m_showIcon; }
59
inline int iconSize() { return m_iconSize; }
60
inline bool onTopIcon() { return m_onTopIcon; }
73
static LinkLook *localLook;
74
static LinkLook *urlLook;
75
static LinkLook *noUrlLook;
76
/* Static method to get a LinkLook from an URL */
77
static LinkLook* lookForURL(const KURL &url); // Item::ContentType type,
80
/**Used to represent links with icon and specific look
81
*Note : This label will appear blank while LinkLook willn't be set
82
*@author S�bastien Lao�t
84
class LinkLabel : public QFrame
88
LinkLabel(int hAlign, int vAlign, QWidget *parent = 0, const char *name = 0, WFlags f = 0);
89
LinkLabel(const QString &title, const QString &icon, LinkLook *look, int hAlign, int vAlign,
90
QWidget *parent = 0, const char *name = 0, WFlags f = 0);
93
void initLabel(int hAlign, int vAlign);
95
void setLink(const QString &title, const QString &icon, LinkLook *look = 0);
96
void setLook(LinkLook *look);
97
void setAlign(int hAlign, int vAlign);
99
void enterEvent(QEvent*);
100
void leaveEvent(QEvent*);
102
void setPaletteBackgroundColor(const QColor &color);
104
QBoxLayout *m_layout;
107
QSpacerItem *m_spacer1;
108
QSpacerItem *m_spacer2;
115
class LinkLookEditWidget : public QWidget
119
LinkLookEditWidget(LinkLook *look, QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
120
~LinkLookEditWidget();
123
void slotShowIcon(bool show);
126
QPushButton *m_underline;
127
QPushButton *m_italic;
129
KColorButton *m_color;
130
KColorButton *m_hoverColor;
131
QCheckBox *m_hoverUnder;
132
QCheckBox *m_showIcon;
133
QWidget *m_iconProperties;
134
QComboBox *m_onTopIcon;
135
IconSizeCombo *m_iconSize;
138
#endif // LINKLABEL_H