|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "univiewermediawidget.h" |
|
19 |
|
20 // SYSTEM INCLUDES |
|
21 #include <HbIconItem> |
|
22 #include <HbTextItem> |
|
23 #include <HbPushButton> |
|
24 #include <HbFrameDrawer> |
|
25 |
|
26 // USER INCLUDES |
|
27 #include "debugtraces.h" |
|
28 |
|
29 // LOCAL CONSTANTS |
|
30 |
|
31 //---------------------------------------------------------------------------- |
|
32 // UniViewerMediaWidget::UniViewerMediaWidget |
|
33 // @see header file |
|
34 //---------------------------------------------------------------------------- |
|
35 UniViewerMediaWidget::UniViewerMediaWidget(QGraphicsItem *parent): |
|
36 HbWidget(parent), mMediaIcon(0), mName(0), mInfo(0), mFrameItem(0) |
|
37 { |
|
38 init(); |
|
39 } |
|
40 |
|
41 //---------------------------------------------------------------------------- |
|
42 // UniViewerMediaWidget::~UniViewerMediaWidget |
|
43 // @see header file |
|
44 //---------------------------------------------------------------------------- |
|
45 UniViewerMediaWidget::~UniViewerMediaWidget() |
|
46 { |
|
47 } |
|
48 |
|
49 //---------------------------------------------------------------------------- |
|
50 // UniViewerMediaWidget::init |
|
51 // @see header file |
|
52 //---------------------------------------------------------------------------- |
|
53 void UniViewerMediaWidget::init() |
|
54 { |
|
55 mMediaIcon = new HbIconItem(this); |
|
56 HbStyle::setItemName(mMediaIcon, "mediaIcon"); |
|
57 |
|
58 mName = new HbTextItem(this); |
|
59 HbStyle::setItemName(mName, "text-1"); |
|
60 |
|
61 mInfo = new HbTextItem(this); |
|
62 HbStyle::setItemName(mInfo, "text-2"); |
|
63 |
|
64 mFrameItem = new HbPushButton(this); |
|
65 HbStyle::setItemName(mFrameItem, "bgFrame"); |
|
66 |
|
67 connect(mFrameItem, SIGNAL(clicked(bool)), this, SIGNAL(clicked())); |
|
68 } |
|
69 |
|
70 //---------------------------------------------------------------------------- |
|
71 // UniViewerMediaWidget::populate |
|
72 // @see header file |
|
73 //---------------------------------------------------------------------------- |
|
74 void UniViewerMediaWidget::populate(const QString &icon, const QString &name, |
|
75 const QString &info, const QString &bgFrame) |
|
76 { |
|
77 HbFrameDrawer *fd = new HbFrameDrawer(bgFrame, |
|
78 HbFrameDrawer::NinePieces); |
|
79 mFrameItem->setFrameBackground(fd); |
|
80 |
|
81 mMediaIcon->setIconName(icon); |
|
82 mName->setText(name); |
|
83 mInfo->setText(info); |
|
84 |
|
85 } |
|
86 |
|
87 //---------------------------------------------------------------------------- |
|
88 // UniViewerMediaWidget::clearContent |
|
89 // @see header file |
|
90 //---------------------------------------------------------------------------- |
|
91 void UniViewerMediaWidget::clearContent() |
|
92 { |
|
93 mMediaIcon->setIconName(""); |
|
94 mName->setText(""); |
|
95 mInfo->setText(""); |
|
96 } |
|
97 |
|
98 // EOF |