sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <ups/dialogcreator.h>
|
sl@0
|
20 |
#include <ups/upserr.h>
|
sl@0
|
21 |
#include <ecom/ecom.h>
|
sl@0
|
22 |
#include "upslog.h"
|
sl@0
|
23 |
|
sl@0
|
24 |
using namespace UserPromptService;
|
sl@0
|
25 |
|
sl@0
|
26 |
EXPORT_C CDialogCreator::CDialogCreator()
|
sl@0
|
27 |
/**
|
sl@0
|
28 |
Constructor
|
sl@0
|
29 |
*/
|
sl@0
|
30 |
: CActive(EPriorityStandard)
|
sl@0
|
31 |
{
|
sl@0
|
32 |
}
|
sl@0
|
33 |
|
sl@0
|
34 |
EXPORT_C CDialogCreator::~CDialogCreator()
|
sl@0
|
35 |
/**
|
sl@0
|
36 |
Destructor
|
sl@0
|
37 |
*/
|
sl@0
|
38 |
{
|
sl@0
|
39 |
REComSession::DestroyedImplementation(iDtor_ID_Key);
|
sl@0
|
40 |
}
|
sl@0
|
41 |
|
sl@0
|
42 |
EXPORT_C CDialogCreator* CDialogCreator::NewL(const TUid& aDialogCreatorImplementationId)
|
sl@0
|
43 |
/**
|
sl@0
|
44 |
Creates a new dialog creator.
|
sl@0
|
45 |
@param aDialogCreatorImplementationId The UID of the dialog creator implemenation
|
sl@0
|
46 |
as specified in the policy file.
|
sl@0
|
47 |
|
sl@0
|
48 |
@return A pointer to the new dialog creator implementation.
|
sl@0
|
49 |
*/
|
sl@0
|
50 |
{
|
sl@0
|
51 |
TAny* plugin(0);
|
sl@0
|
52 |
DEBUG_PRINTF2(_L8("Instantiating dialog creator 0x%08x"), aDialogCreatorImplementationId);
|
sl@0
|
53 |
TRAPD(err, plugin =
|
sl@0
|
54 |
REComSession::CreateImplementationL(aDialogCreatorImplementationId,
|
sl@0
|
55 |
_FOFF(CDialogCreator,iDtor_ID_Key)));
|
sl@0
|
56 |
|
sl@0
|
57 |
if (err != KErrNone)
|
sl@0
|
58 |
{
|
sl@0
|
59 |
DEBUG_PRINTF3(_L8("Failed to instantiate dialog creator 0x%08x, err = %d"),
|
sl@0
|
60 |
aDialogCreatorImplementationId.iUid, err);
|
sl@0
|
61 |
}
|
sl@0
|
62 |
|
sl@0
|
63 |
if (err == KErrNotFound)
|
sl@0
|
64 |
{
|
sl@0
|
65 |
err = KErrUpsMissingDialogCreator;
|
sl@0
|
66 |
}
|
sl@0
|
67 |
User::LeaveIfError(err);
|
sl@0
|
68 |
return reinterpret_cast<CDialogCreator*>(plugin);
|
sl@0
|
69 |
}
|
sl@0
|
70 |
|
sl@0
|
71 |
EXPORT_C TInt CDialogCreator::GetExtension(TUint aExtensionId, TAny*& a0, TAny* a1)
|
sl@0
|
72 |
/**
|
sl@0
|
73 |
Allows extension of this interface. Calls Extension_
|
sl@0
|
74 |
|
sl@0
|
75 |
@param aExtensionId The UID of the interface to instantiate.
|
sl@0
|
76 |
@param a0 A reference to a pointer that should be set to the newly
|
sl@0
|
77 |
instantiated object.
|
sl@0
|
78 |
@param a1 Data specific to the instantiate of the specified interface.
|
sl@0
|
79 |
|
sl@0
|
80 |
@return KErrNone if the extension is supported or KErrNotSupported if the extension is not
|
sl@0
|
81 |
recognised; otherwise, a system wide error may be returned.
|
sl@0
|
82 |
*/
|
sl@0
|
83 |
{
|
sl@0
|
84 |
return Extension_(aExtensionId, a0, a1);
|
sl@0
|
85 |
}
|
sl@0
|
86 |
|
sl@0
|
87 |
EXPORT_C TInt CDialogCreator::Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
|
sl@0
|
88 |
{
|
sl@0
|
89 |
return CActive::Extension_(aExtensionId, a0, a1);
|
sl@0
|
90 |
}
|