61
|
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: Example implementation of contact card extension.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "contactcardextension.h"
|
|
19 |
#include <HbMessageBox>
|
|
20 |
|
|
21 |
ContactCardExtension::ContactCardExtension()
|
|
22 |
{
|
|
23 |
}
|
|
24 |
|
|
25 |
ContactCardExtension::~ContactCardExtension()
|
|
26 |
{
|
|
27 |
delete mDetail;
|
|
28 |
}
|
|
29 |
|
|
30 |
void ContactCardExtension::prepare( QContact& /*aContact*/, bool /*aMyCard*/ )
|
|
31 |
{
|
|
32 |
// You should examine the contact here and decide what actions are to be offered.
|
|
33 |
|
|
34 |
mDetail = new QContactDetail();
|
|
35 |
}
|
|
36 |
|
|
37 |
int ContactCardExtension::actionCount() const
|
|
38 |
{
|
|
39 |
return 1;
|
|
40 |
}
|
|
41 |
|
|
42 |
const CntUiContactCardExtAction& ContactCardExtension::actionAt( int /*aIndex*/ ) const
|
|
43 |
{
|
|
44 |
return *this;
|
|
45 |
}
|
|
46 |
|
|
47 |
|
|
48 |
void ContactCardExtension::handleShortPress( int /*aActionId*/ )
|
|
49 |
{
|
|
50 |
HbMessageBox::information("Jumping");
|
|
51 |
}
|
|
52 |
|
|
53 |
//====================================================
|
|
54 |
//======= from CntUiContactCardExtAction =============
|
|
55 |
|
|
56 |
|
|
57 |
QString ContactCardExtension::firstTextLine() const
|
|
58 |
{
|
|
59 |
return QString("Jump");
|
|
60 |
}
|
|
61 |
|
|
62 |
QString ContactCardExtension::secondTextLine() const
|
|
63 |
{
|
|
64 |
return QString("over the fence");
|
|
65 |
}
|
|
66 |
|
|
67 |
const QIcon ContactCardExtension::icon() const
|
|
68 |
{
|
|
69 |
return QIcon("c:/jump_icon.jpg");
|
|
70 |
}
|
|
71 |
|
|
72 |
const QContactDetail& ContactCardExtension::detailUsedForChoosingPosition() const
|
|
73 |
{
|
|
74 |
// This is not a proper example.
|
|
75 |
return *mDetail;
|
|
76 |
}
|
|
77 |
|
|
78 |
|
|
79 |
// end of file
|