|
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: |
|
15 * Defines implementation of CUniObjectsInfo class methods. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // ========== INCLUDE FILES ================================ |
|
22 |
|
23 #include "UniObjectsInfo.h" |
|
24 |
|
25 #include <MsgMediaInfo.h> |
|
26 #include <MsgAttachmentInfo.h> |
|
27 |
|
28 #include "uniobject.h" |
|
29 |
|
30 // ========== EXTERNAL DATA STRUCTURES ===================== |
|
31 |
|
32 // ========== EXTERNAL FUNCTION PROTOTYPES ================= |
|
33 |
|
34 // ========== CONSTANTS ==================================== |
|
35 |
|
36 // ========== MACROS ======================================= |
|
37 |
|
38 // ========== LOCAL CONSTANTS AND MACROS =================== |
|
39 |
|
40 // ========== MODULE DATA STRUCTURES ======================= |
|
41 |
|
42 // ========== LOCAL FUNCTION PROTOTYPES ==================== |
|
43 |
|
44 // ========== LOCAL FUNCTIONS ============================== |
|
45 |
|
46 // ========== MEMBER FUNCTIONS ============================= |
|
47 |
|
48 // --------------------------------------------------------- |
|
49 // CUniObjectsInfo::NewLC |
|
50 // --------------------------------------------------------- |
|
51 // |
|
52 CUniObjectsInfo* CUniObjectsInfo::NewLC( CMsgAttachmentModel& aAttachmentModel, |
|
53 CUniObject& aObject, |
|
54 TInt aDRMType, |
|
55 TBool aAttachmentObject, |
|
56 TInt aSlideNumber ) |
|
57 { |
|
58 CUniObjectsInfo* self = new ( ELeave ) CUniObjectsInfo( aAttachmentModel, |
|
59 aObject, |
|
60 aAttachmentObject, |
|
61 aSlideNumber ); |
|
62 |
|
63 CleanupStack::PushL( self ); |
|
64 self->ConstructL( aDRMType ); |
|
65 return self; |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------- |
|
69 // CUniObjectsInfo::NewEmptySlideLC |
|
70 // --------------------------------------------------------- |
|
71 // |
|
72 CUniObjectsInfo* CUniObjectsInfo::NewEmptySlideLC( CMsgAttachmentModel& aAttachmentModel, |
|
73 const TDesC& aEmptySlideName ) |
|
74 { |
|
75 CUniObjectsInfo* self = new ( ELeave ) CUniObjectsInfo( aAttachmentModel, |
|
76 aEmptySlideName ); |
|
77 CleanupStack::PushL( self ); |
|
78 self->ConstructL( CMsgAttachmentInfo::ENoLimitations ); |
|
79 return self; |
|
80 } |
|
81 |
|
82 // --------------------------------------------------------- |
|
83 // CUniObjectsInfo::CUniObjectsInfo |
|
84 // --------------------------------------------------------- |
|
85 // |
|
86 CUniObjectsInfo::CUniObjectsInfo( CMsgAttachmentModel& aAttachmentModel, |
|
87 CUniObject& aObject, |
|
88 TBool aAttachmentObject, |
|
89 TInt aSlideNumber ) : |
|
90 CMsgAttachmentInfo( aAttachmentModel, |
|
91 aObject.MediaInfo()->FullFilePath(), |
|
92 aObject.MediaInfo()->FileSize(), |
|
93 ETrue, |
|
94 ETrue ), |
|
95 iFlags( 0 ), |
|
96 iObject( &aObject ), |
|
97 iAttachmentObject( aAttachmentObject ), |
|
98 iSlideNumber( aSlideNumber ) |
|
99 { |
|
100 this->SetSaved( aObject.IsSaved() ); |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------- |
|
104 // CUniObjectsInfo::CUniObjectsInfo |
|
105 // --------------------------------------------------------- |
|
106 // |
|
107 CUniObjectsInfo::CUniObjectsInfo( CMsgAttachmentModel& aAttachmentModel, |
|
108 const TDesC& aEmptySlideName ) : |
|
109 CMsgAttachmentInfo( aAttachmentModel, |
|
110 aEmptySlideName, |
|
111 0, |
|
112 ETrue, |
|
113 ETrue ), |
|
114 iFlags( EMmsSlide ), |
|
115 iObject( NULL ) |
|
116 { |
|
117 SetEmptyAttachment( ETrue ); |
|
118 } |
|
119 |
|
120 // --------------------------------------------------------- |
|
121 // CUniObjectsInfo::ConstructL |
|
122 // --------------------------------------------------------- |
|
123 // |
|
124 void CUniObjectsInfo::ConstructL( TInt aDRMType ) |
|
125 { |
|
126 TDataType dataType; |
|
127 CMsgAttachmentInfo::TDRMDataType drmType( CMsgAttachmentInfo::ENoLimitations ); |
|
128 TMsvAttachmentId attachmentId( 0 ); |
|
129 |
|
130 if ( iObject ) |
|
131 { |
|
132 dataType = iObject->MimeType(); |
|
133 attachmentId = iObject->AttachmentId(); |
|
134 drmType = static_cast<CMsgAttachmentInfo::TDRMDataType>( aDRMType ); |
|
135 } |
|
136 |
|
137 CMsgAttachmentInfo::ConstructL( dataType, drmType ); |
|
138 SetAttachmentId( attachmentId ); |
|
139 } |
|
140 |
|
141 // --------------------------------------------------------- |
|
142 // Destructor |
|
143 // --------------------------------------------------------- |
|
144 // |
|
145 CUniObjectsInfo::~CUniObjectsInfo() |
|
146 { |
|
147 } |
|
148 |
|
149 // End of File |