blob: c3c3f9bf23163d270d51ac07faf693b644a837da (
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
|
// Own
#include "flashplayer_part.h"
// Local
#include "flashplayerwidget.h"
extern "C"
{
// entry point for the swfdec-based flash player part library,
// returns a new factory which can be used to construct Konsole parts
KDE_EXPORT void* init_libflashplayerpart()
{
return new FlashPlayer::PartFactory;
}
}
using namespace FlashPlayer;
KParts::Part* PartFactory::createPartObject( QWidget* parentWidget,
QObject* parent,
const char* /*classname*/,
const QStringList& /*args*/)
{
return new Part(parentWidget,parent);
}
class Part::Private
{
public:
FlashPlayerWidget* player;
};
Part::Part(QWidget* parentWidget , QObject* parent)
: KParts::ReadOnlyPart(parent)
, d(new Private)
{
d->player = new FlashPlayerWidget(parentWidget);
setWidget(d->player);
}
bool Part::openFile()
{
d->player->load(localFilePath());
d->player->play();
return true;
}
#include "flashplayer_part.moc"
|