|
1 /* |
|
2 * Copyright (c) 2002 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCMSContentInfo_H |
|
21 #define CCMSContentInfo_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "CCMSSequence.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 // Extension |
|
28 class MCMSContentInfoExtension; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * ContentInfo module |
|
33 * |
|
34 * ASN.1 Definition: |
|
35 * ContentInfo ::= SEQUENCE { |
|
36 * contentType ContentType, |
|
37 * content [0] EXPLICIT ANY DEFINED BY contentType } |
|
38 * |
|
39 * ContentType ::= OBJECT IDENTIFIER |
|
40 * |
|
41 * |
|
42 * @lib cms.lib |
|
43 * @since 2.8 |
|
44 */ |
|
45 class CCMSContentInfo : public CCMSSequence |
|
46 { |
|
47 public: // Destructor |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. Leaves the created object in cleanup stack. |
|
51 */ |
|
52 IMPORT_C static CCMSContentInfo* NewLC(); |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * Takes copy of the both contetn type and content. Leaves the |
|
57 * created object in cleanup stack. |
|
58 * @param aAttributeType The attribute type in desc e.g. |
|
59 * content type = "1.2.840.113549.1.7.1" (ID-Data). |
|
60 * @param aContent Content of this ContentInfo. |
|
61 */ |
|
62 IMPORT_C static CCMSContentInfo* NewLC( const TDesC& aContentType, |
|
63 const TDesC8& aContent ); |
|
64 |
|
65 /** |
|
66 * Destructor. |
|
67 */ |
|
68 virtual ~CCMSContentInfo(); |
|
69 |
|
70 public: // New functions |
|
71 |
|
72 /** |
|
73 * Getter for content type |
|
74 * @since 2,8 |
|
75 * @return Content type in TDesC reference |
|
76 */ |
|
77 IMPORT_C const TDesC& ContentType() const; |
|
78 |
|
79 |
|
80 /** |
|
81 * Setter for content type, takes copy |
|
82 * @since 2.8 |
|
83 * @param aContentType Content type to be set as TDesC. |
|
84 */ |
|
85 IMPORT_C void SetContentTypeL( const TDesC& aAttributeType ); |
|
86 |
|
87 /** |
|
88 * Getter for content |
|
89 * @since 3.0 |
|
90 * @return Content in TDesC8 reference |
|
91 */ |
|
92 IMPORT_C const TDesC8& Content() const; |
|
93 |
|
94 /** |
|
95 * Setter for content, takes copy |
|
96 * @since 3.0 |
|
97 * @param aContent Content to be set |
|
98 */ |
|
99 IMPORT_C void SetContentL( const TDesC8& aContent ); |
|
100 |
|
101 public: // Functions from base classes |
|
102 |
|
103 /** |
|
104 * From MCMSModule |
|
105 * @since 3.0 |
|
106 * @param aRawData raw-data to be parsed in this instance |
|
107 */ |
|
108 void DecodeL( const TDesC8& aRawData ); |
|
109 |
|
110 /** |
|
111 * From MCMSModule |
|
112 * @since 3.0 |
|
113 * @return Returns ASN1 encoder and leaves it in CleanupStack |
|
114 */ |
|
115 CASN1EncBase* EncoderLC() const; |
|
116 |
|
117 |
|
118 protected: // New functions |
|
119 |
|
120 /** |
|
121 * Protected construction to allow derivation |
|
122 */ |
|
123 IMPORT_C void ConstructL(); |
|
124 |
|
125 /** |
|
126 * Protected construction to allow derivation |
|
127 */ |
|
128 IMPORT_C void ConstructL( const TDesC& aContentType ); |
|
129 |
|
130 /** |
|
131 * Protected construction to allow derivation |
|
132 */ |
|
133 IMPORT_C void ConstructL( const TDesC& aContentType, |
|
134 const TDesC8& aContent ); |
|
135 |
|
136 /** |
|
137 * C++ default constructor. |
|
138 */ |
|
139 IMPORT_C CCMSContentInfo(); |
|
140 |
|
141 protected: // Data |
|
142 // Content Type, owned |
|
143 HBufC* iContentType; |
|
144 |
|
145 // Content, owned. |
|
146 HBufC8* iContent; |
|
147 |
|
148 // Reserved for extensions |
|
149 MCMSContentInfoExtension* iReserved; |
|
150 }; |
|
151 |
|
152 #endif // CCMSContentInfo_H |
|
153 |
|
154 // End of File |