29
|
1 |
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file
|
|
18 |
@internalComponent
|
|
19 |
*/
|
|
20 |
|
|
21 |
#include "cmtpplaybackevent.h"
|
|
22 |
#include "mtpplaybackcontrolpanic.h"
|
49
|
23 |
#include "OstTraceDefinitions.h"
|
|
24 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
25 |
#include "cmtpplaybackeventTraces.h"
|
|
26 |
#endif
|
29
|
27 |
|
|
28 |
|
|
29 |
CMTPPbEventParam* CMTPPbEventParam::NewL(TMTPPbCategory aCategory, const TDesC& aSuid)
|
|
30 |
{
|
49
|
31 |
OstTraceFunctionEntry0( CMTPPBEVENTPARAM_NEWL_ENTRY );
|
29
|
32 |
CMTPPbEventParam* self = new (ELeave) CMTPPbEventParam(aCategory, aSuid);
|
|
33 |
CleanupStack::PushL(self);
|
|
34 |
self->ConstructL(aCategory, aSuid);
|
|
35 |
CleanupStack::Pop(self);
|
49
|
36 |
OstTraceFunctionExit0( CMTPPBEVENTPARAM_NEWL_EXIT );
|
29
|
37 |
return self;
|
|
38 |
}
|
|
39 |
|
|
40 |
CMTPPbEventParam* CMTPPbEventParam::NewL(TInt32 aValue)
|
|
41 |
{
|
49
|
42 |
OstTraceFunctionEntry0( DUP1_CMTPPBEVENTPARAM_NEWL_ENTRY );
|
29
|
43 |
CMTPPbEventParam* self = new (ELeave) CMTPPbEventParam(aValue);
|
|
44 |
CleanupStack::PushL(self);
|
|
45 |
self->ConstructL(aValue);
|
|
46 |
CleanupStack::Pop(self);
|
49
|
47 |
OstTraceFunctionExit0( DUP1_CMTPPBEVENTPARAM_NEWL_EXIT );
|
29
|
48 |
return self;
|
|
49 |
}
|
|
50 |
|
|
51 |
CMTPPbEventParam* CMTPPbEventParam::NewL(TUint32 aValue)
|
|
52 |
{
|
49
|
53 |
OstTraceFunctionEntry0( DUP2_CMTPPBEVENTPARAM_NEWL_ENTRY );
|
29
|
54 |
CMTPPbEventParam* self = new (ELeave) CMTPPbEventParam(aValue);
|
|
55 |
CleanupStack::PushL(self);
|
|
56 |
self->ConstructL(aValue);
|
|
57 |
CleanupStack::Pop(self);
|
49
|
58 |
OstTraceFunctionExit0( DUP2_CMTPPBEVENTPARAM_NEWL_EXIT );
|
29
|
59 |
return self;
|
|
60 |
}
|
|
61 |
|
|
62 |
CMTPPbEventParam::~CMTPPbEventParam()
|
|
63 |
{
|
49
|
64 |
OstTraceFunctionEntry0( CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_ENTRY );
|
|
65 |
OstTraceFunctionExit0( CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_EXIT );
|
29
|
66 |
}
|
|
67 |
|
|
68 |
CMTPPbEventParam::CMTPPbEventParam(TMTPPbCategory aCategory, const TDesC& aSuid):
|
|
69 |
CMTPPbParamBase(aCategory, aSuid)
|
|
70 |
{
|
49
|
71 |
OstTraceFunctionEntry0( DUP1_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_ENTRY );
|
|
72 |
OstTraceFunctionExit0( DUP1_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_EXIT );
|
29
|
73 |
}
|
|
74 |
|
|
75 |
CMTPPbEventParam::CMTPPbEventParam(TInt32 aValue):
|
|
76 |
CMTPPbParamBase(aValue)
|
|
77 |
{
|
49
|
78 |
OstTraceFunctionEntry0( DUP2_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_ENTRY );
|
|
79 |
OstTraceFunctionExit0( DUP2_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_EXIT );
|
29
|
80 |
}
|
|
81 |
|
|
82 |
CMTPPbEventParam::CMTPPbEventParam(TUint32 aValue):
|
|
83 |
CMTPPbParamBase(aValue)
|
|
84 |
{
|
49
|
85 |
OstTraceFunctionEntry0( DUP3_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_ENTRY );
|
|
86 |
OstTraceFunctionExit0( DUP3_CMTPPBEVENTPARAM_CMTPPBEVENTPARAM_EXIT );
|
29
|
87 |
}
|
|
88 |
|
|
89 |
/**
|
|
90 |
Two-phase constructor.
|
|
91 |
*/
|
|
92 |
CMTPPlaybackEvent* CMTPPlaybackEvent::NewL(TMTPPlaybackEvent aEvent, CMTPPbEventParam* aParam)
|
|
93 |
{
|
49
|
94 |
OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_NEWL_ENTRY );
|
29
|
95 |
__ASSERT_DEBUG((aEvent > EPlaybackEventNone && aEvent < EPlaybackEventEnd), Panic(EMTPPBArgumentErr));
|
49
|
96 |
__ASSERT_ALWAYS_OST((aEvent > EPlaybackEventNone && aEvent < EPlaybackEventEnd), OstTrace0( TRACE_ERROR, CMTPPLAYBACKEVENT_NEWL, "Error argument" ), User::Leave(KErrArgument));
|
29
|
97 |
|
|
98 |
CMTPPlaybackEvent* self = new (ELeave) CMTPPlaybackEvent(aEvent, aParam);
|
|
99 |
CleanupStack::PushL(self);
|
|
100 |
self->ConstructL();
|
|
101 |
CleanupStack::Pop(self);
|
49
|
102 |
OstTraceFunctionExit0( CMTPPLAYBACKEVENT_NEWL_EXIT );
|
29
|
103 |
return self;
|
|
104 |
}
|
|
105 |
|
|
106 |
/**
|
|
107 |
Destructor.
|
|
108 |
*/
|
|
109 |
CMTPPlaybackEvent::~CMTPPlaybackEvent()
|
|
110 |
{
|
49
|
111 |
OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_CMTPPLAYBACKEVENT_ENTRY );
|
29
|
112 |
delete iParam;
|
49
|
113 |
OstTraceFunctionExit0( CMTPPLAYBACKEVENT_CMTPPLAYBACKEVENT_EXIT );
|
29
|
114 |
}
|
|
115 |
|
|
116 |
/**
|
|
117 |
Constructor.
|
|
118 |
*/
|
|
119 |
CMTPPlaybackEvent::CMTPPlaybackEvent(TMTPPlaybackEvent aEvent,
|
|
120 |
CMTPPbEventParam* aParam):
|
|
121 |
iPbEvent(aEvent),iParam(aParam)
|
|
122 |
{
|
49
|
123 |
OstTraceFunctionEntry0( DUP1_CMTPPLAYBACKEVENT_CMTPPLAYBACKEVENT_ENTRY );
|
|
124 |
OstTraceFunctionExit0( DUP1_CMTPPLAYBACKEVENT_CMTPPLAYBACKEVENT_EXIT );
|
29
|
125 |
}
|
|
126 |
|
|
127 |
/**
|
|
128 |
Second-phase constructor.
|
|
129 |
*/
|
|
130 |
void CMTPPlaybackEvent::ConstructL()
|
|
131 |
{
|
49
|
132 |
OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_CONSTRUCTL_ENTRY );
|
|
133 |
OstTraceFunctionExit0( CMTPPLAYBACKEVENT_CONSTRUCTL_EXIT );
|
29
|
134 |
}
|
|
135 |
|
|
136 |
void CMTPPlaybackEvent::SetParam(CMTPPbEventParam* aParam)
|
|
137 |
{
|
49
|
138 |
OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_SETPARAM_ENTRY );
|
29
|
139 |
delete iParam;
|
|
140 |
iParam = aParam;
|
49
|
141 |
OstTraceFunctionExit0( CMTPPLAYBACKEVENT_SETPARAM_EXIT );
|
29
|
142 |
}
|
|
143 |
|
|
144 |
TMTPPlaybackEvent CMTPPlaybackEvent::PlaybackEvent()
|
|
145 |
{
|
49
|
146 |
OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_PLAYBACKEVENT_ENTRY );
|
29
|
147 |
__ASSERT_DEBUG((iPbEvent > EPlaybackEventNone && iPbEvent < EPlaybackEventEnd), Panic(EMTPPBArgumentErr));
|
49
|
148 |
OstTraceFunctionExit0( CMTPPLAYBACKEVENT_PLAYBACKEVENT_EXIT );
|
29
|
149 |
return iPbEvent;
|
|
150 |
}
|
|
151 |
|
|
152 |
const CMTPPbEventParam& CMTPPlaybackEvent::ParamL()
|
|
153 |
{
|
49
|
154 |
OstTraceFunctionEntry0( CMTPPLAYBACKEVENT_PARAML_ENTRY );
|
29
|
155 |
__ASSERT_DEBUG((iParam != NULL), Panic(EMTPPBDataNullErr));
|
49
|
156 |
__ASSERT_ALWAYS_OST((iParam != NULL), OstTrace0( TRACE_ERROR, CINTERNETCONNECTIONHANDLER_CONSTRUCTL, "Error argument" ), User::Leave(KErrArgument));
|
29
|
157 |
|
49
|
158 |
|
|
159 |
OstTraceFunctionExit0( CMTPPLAYBACKEVENT_PARAML_EXIT );
|
29
|
160 |
return *iParam;
|
|
161 |
}
|