kradio4
r778
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
src
to-be-ported
aboutwidget.h
Go to the documentation of this file.
1
/***************************************************************************
2
aboutwidget.h - description
3
-------------------
4
begin : Sa Sep 13 2003
5
copyright : (C) 2003 by Martin Witte
6
email : emw-kradio@nocabal.de
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef KRADIO_ABOUT_WIDGET_H
19
#define KRADIO_ABOUT_WIDGET_H
20
21
#ifdef HAVE_CONFIG_H
22
#include <config.h>
23
#endif
24
25
26
//#include <QtGui/QWidget>
27
#include <QtGui/QLabel>
28
29
/* Unfortunately KDE doesn't provide the class KAboutContainerBase
30
to public programming, so we have to copy most of that code into
31
an own class :(
32
*/
33
34
class
QFrame;
35
class
KAboutContainer;
36
class
QTabWidget;
37
class
QVBoxLayout;
38
class
KAboutData;
39
40
#include <QtGui/QLabel>
41
42
// copied (and renamed) from kaboutdialog_private.h
43
// original: KImageTrackLabel
44
45
class
KRadioImageTrackLabel
:
public
QLabel
46
{
47
Q_OBJECT
48
49
public
:
50
enum
MouseMode
51
{
52
MousePress
= 1,
53
MouseRelease
,
54
MouseDoubleClick
,
55
MouseMove
56
};
57
58
public
:
59
KRadioImageTrackLabel
( QWidget * parent,
const
char
* name=0);
60
61
signals:
62
void
mouseTrack
(
int
mode,
const
QMouseEvent *e );
63
64
protected
:
65
virtual
void
mousePressEvent
( QMouseEvent *e );
66
virtual
void
mouseReleaseEvent
( QMouseEvent *e );
67
virtual
void
mouseDoubleClickEvent
( QMouseEvent *e );
68
virtual
void
mouseMoveEvent
( QMouseEvent *e );
69
};
70
71
// copied (and renamed) from kaboutdialog_private.h
72
// original: KAboutContainerBase
73
74
class
KRadioAboutWidget
:
public
QWidget
75
{
76
Q_OBJECT
77
78
public
:
79
enum
LayoutType
80
{
81
AbtPlain
= 0x0001,
82
AbtTabbed
= 0x0002,
83
AbtTitle
= 0x0004,
84
AbtImageLeft
= 0x0008,
85
AbtImageRight
= 0x0010,
86
AbtImageOnly
= 0x0020,
87
AbtProduct
= 0x0040,
88
AbtKDEStandard
=
AbtTabbed
|
AbtTitle
|
AbtImageLeft
,
89
AbtAppStandard
=
AbtTabbed
|
AbtTitle
|
AbtProduct
,
90
AbtImageAndTitle
=
AbtPlain
|
AbtTitle
|
AbtImageOnly
91
};
92
93
public
:
94
KRadioAboutWidget
(
const
KAboutData &abtData,
int
layoutType, QWidget *parent = 0,
char
*name = 0);
95
virtual
void
show
(
void
);
96
virtual
QSize
sizeHint
(
void
)
const
;
97
98
void
setAboutData
(
const
KAboutData &abtData);
99
100
void
setTitle
(
const
QString &title );
101
void
setImage
(
const
QString &fileName );
102
void
setImageBackgroundColor
(
const
QColor &color );
103
void
setImageFrame
(
bool
state );
104
void
setProduct
(
const
QString &appName,
const
QString &version,
105
const
QString &author,
const
QString &year );
106
107
QFrame *
addTextPage
(
const
QString &title,
const
QString &text,
108
bool
richText=
false
,
int
numLines=10 );
109
QFrame *
addLicensePage
(
const
QString &title,
const
QString &text,
110
int
numLines=10 );
111
KAboutContainer *
addContainerPage
(
const
QString &title,
112
int
childAlignment = AlignCenter,
int
innerAlignment = AlignCenter );
113
KAboutContainer *
addScrolledContainerPage
(
const
QString &title,
114
int
childAlignment = AlignCenter,
int
innerAlignment = AlignCenter );
115
116
QFrame *
addEmptyPage
(
const
QString &title );
117
118
KAboutContainer *
addContainer
(
int
childAlignment,
int
innerAlignment );
119
120
public
slots:
121
virtual
void
slotMouseTrack
(
int
mode,
const
QMouseEvent *e );
122
virtual
void
slotUrlClick
(
const
QString &url );
123
virtual
void
slotMailClick
(
const
QString &name,
const
QString &address );
124
125
protected
:
126
virtual
void
fontChange
(
const
QFont &oldFont );
127
128
signals:
129
void
mouseTrack
(
int
mode,
const
QMouseEvent *e );
130
void
urlClick
(
const
QString &url );
131
void
mailClick
(
const
QString &name,
const
QString &address );
132
133
private
:
134
QMemArray<QWidget*>
mContainerList
;
135
136
QVBoxLayout *
mTopLayout
;
137
KRadioImageTrackLabel
*
mImageLabel
;
138
QLabel *
mTitleLabel
;
139
QLabel *
mIconLabel
;
140
QLabel *
mVersionLabel
;
141
QLabel *
mAuthorLabel
;
142
QFrame *
mImageFrame
;
143
QTabWidget *
mPageTab
;
144
QFrame *
mPlainSpace
;
145
};
146
147
148
#endif
Generated by
1.8.4