|
1 /* |
|
2 * Copyright (c) 2006-2007 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: CUpnpSharingRequest class implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 // INCLUDE FILES |
|
25 #include "upnpsharingrequest.h" |
|
26 #include "upnpcontentserverdefs.h" |
|
27 |
|
28 const TInt KDefaultItemCount = 2^32; //4294967296 |
|
29 |
|
30 using namespace UpnpContentServer; |
|
31 |
|
32 // ============================ MEMBER FUNCTIONS ============================= |
|
33 |
|
34 // -------------------------------------------------------------------------- |
|
35 // CUpnpSharingRequest::CUpnpSharingRequest |
|
36 // C++ default constructor can NOT contain any code, that |
|
37 // might leave. |
|
38 // -------------------------------------------------------------------------- |
|
39 // |
|
40 |
|
41 CUpnpSharingRequest::CUpnpSharingRequest( TInt aKind ) |
|
42 { |
|
43 iKind = aKind; |
|
44 iItemCount = KDefaultItemCount; |
|
45 } |
|
46 |
|
47 // -------------------------------------------------------------------------- |
|
48 // CUpnpSharingRequest::ConstructL |
|
49 // Symbian 2nd phase constructor can leave. |
|
50 // -------------------------------------------------------------------------- |
|
51 // |
|
52 void CUpnpSharingRequest::ConstructL( const RArray<TInt>& aArr, |
|
53 CDesCArray* aIdArray, |
|
54 CDesCArray* aNameArray ) |
|
55 { |
|
56 for ( TInt i(0); i<aArr.Count();i++ ) |
|
57 { |
|
58 iSelections.AppendL( aArr[ i ] ); |
|
59 } |
|
60 iObjectIds = aIdArray; // transfer ownership |
|
61 iObjectNames = aNameArray; |
|
62 } |
|
63 |
|
64 // -------------------------------------------------------------------------- |
|
65 // CUpnpSharingRequest::NewL |
|
66 // Two-phased constructor. |
|
67 // -------------------------------------------------------------------------- |
|
68 // |
|
69 CUpnpSharingRequest* CUpnpSharingRequest::NewL( |
|
70 TInt aKind, |
|
71 const RArray<TInt>& aArr, |
|
72 CDesCArray* aIdArray, |
|
73 CDesCArray* aNameArray ) |
|
74 { |
|
75 CUpnpSharingRequest* self = new (ELeave) CUpnpSharingRequest( aKind ); |
|
76 CleanupStack::PushL( self ); |
|
77 self->ConstructL( aArr, |
|
78 aIdArray, |
|
79 aNameArray ); |
|
80 CleanupStack::Pop( self ); |
|
81 return self; |
|
82 } |
|
83 |
|
84 // -------------------------------------------------------------------------- |
|
85 // CUpnpSharingRequest::NewL |
|
86 // Destructor |
|
87 // -------------------------------------------------------------------------- |
|
88 // |
|
89 CUpnpSharingRequest::~CUpnpSharingRequest() |
|
90 { |
|
91 iSelections.Close(); |
|
92 delete iObjectIds; |
|
93 } |
|
94 |
|
95 |
|
96 // End of File |