1 // Copyright (c) 2009 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 * @file apmstd.h |
|
17 * |
|
18 * @internalComponent |
|
19 * @released |
|
20 */ |
|
21 #if !defined (__APMSTD_H__) |
|
22 #define __APMSTD_H__ |
|
23 |
|
24 #include "commontypes.h" |
|
25 |
|
26 /** |
|
27 @publishedAll |
|
28 @released |
|
29 |
|
30 The largest possible value for a TInt16. |
|
31 */ |
|
32 const TInt KMaxTInt16=0x7fff; |
|
33 |
|
34 /** |
|
35 @publishedAll |
|
36 @released |
|
37 |
|
38 The smallest possible value for a TInt16. |
|
39 */ |
|
40 const TInt KMinTInt16=(-32768); |
|
41 |
|
42 /** |
|
43 @publishedAll |
|
44 @released |
|
45 */ |
|
46 const TInt KMaxDataTypeLength=256; |
|
47 |
|
48 /** Defines the priority associated with a data type. |
|
49 |
|
50 The priority is used by a device to resolve the current preferred handler |
|
51 of a data type, in the absence of any user preferences. |
|
52 |
|
53 @publishedAll |
|
54 @released |
|
55 @see TDataTypeWithPriority */ |
|
56 typedef TInt32 TDataTypePriority; |
|
57 |
|
58 /** Reserved for future use. |
|
59 |
|
60 @publishedAll |
|
61 @released */ |
|
62 const TInt32 KDataTypePriorityUserSpecified=KMaxTInt16; |
|
63 |
|
64 /** Trusted applications may use this priority value to ensure |
|
65 their MIME type associations cannot be overridden by |
|
66 self signed (untrusted) applications. |
|
67 |
|
68 @publishedAll |
|
69 @released |
|
70 @see TDataTypeWithPriority */ |
|
71 const TInt32 KDataTypePriorityTrustedHigh = 0xC000; |
|
72 |
|
73 /** This is Threshold priority for Un-Trusted apps i.e., for the applications which reside |
|
74 in \\private\\10003a3f\\import\\apps and have a SID which is in the unprotected range. This is to avoid Un-Trusted app's claiming for priority higher |
|
75 than the threshold, if they claim for priority higher than the Threshold then it would be |
|
76 reduced to KDataTypeUnTrustedPriorityThreshold. |
|
77 |
|
78 @publishedAll |
|
79 @released */ |
|
80 const TInt32 KDataTypeUnTrustedPriorityThreshold=KMaxTInt16; |
|
81 |
|
82 /** A priority value associated with a data (MIME) type. Associating an application |
|
83 with a data type at this priority means that this application, and no other, |
|
84 should ever handle the data type. Use sparingly. |
|
85 |
|
86 @publishedAll |
|
87 @released |
|
88 @see TDataTypeWithPriority */ |
|
89 const TInt32 KDataTypePriorityHigh=10000; |
|
90 |
|
91 /** A priority value associated with a data (MIME) type. Associating an application |
|
92 with a data type at this priority means that the data type is the primary |
|
93 type for that application. For example, "text/plain" files for a text editor. |
|
94 |
|
95 @publishedAll |
|
96 @released |
|
97 @see TDataTypeWithPriority */ |
|
98 const TInt32 KDataTypePriorityNormal=0; |
|
99 |
|
100 /** A priority value associated with a data (MIME) type. Associating an application |
|
101 with a data type at this priority means that the data type is a secondary |
|
102 type for that application. For example, "text/plain" files for a web browser. |
|
103 |
|
104 @publishedAll |
|
105 @released |
|
106 @see TDataTypeWithPriority */ |
|
107 const TInt32 KDataTypePriorityLow=-10000; |
|
108 |
|
109 /** A priority value associated with a data (MIME) type. Associating an application |
|
110 with a data type at this priority means that the data type is a last resort |
|
111 for that application. Use sparingly. |
|
112 |
|
113 @publishedAll |
|
114 @released |
|
115 @see TDataTypeWithPriority */ |
|
116 const TInt32 KDataTypePriorityLastResort=-20000; |
|
117 |
|
118 /** Reserved for future use. |
|
119 |
|
120 @publishedAll |
|
121 @released */ |
|
122 const TInt32 KDataTypePriorityNotSupported=KMinTInt16; |
|
123 |
|
124 /** This is a special priority that overrides any user settings. Applications must |
|
125 have EWriteDeviceData to use this priority. If they have not then they will be |
|
126 downgraded to KDataTypePriorityNormal. |
|
127 |
|
128 @publishedPartner |
|
129 @released |
|
130 @see TDataTypeWithPriority */ |
|
131 const TInt32 KDataTypePrioritySystem = 0xFFF9; |
|
132 |
|
133 |
|
134 /** A data type. |
|
135 |
|
136 The class maintains a string that describes the data type and an associated |
|
137 UID. |
|
138 |
|
139 A data type is also referred to as a MIME type. |
|
140 |
|
141 @publishedAll |
|
142 @released */ |
|
143 class TDataType |
|
144 { |
|
145 public: |
|
146 TDataType(); |
|
147 ~TDataType(); |
|
148 TDataType(const PtrC8* aDataType); |
|
149 Ptr8* GetDataType(); |
|
150 |
|
151 private: |
|
152 Ptr8* iDataType; |
|
153 TUid iUid; |
|
154 }; |
|
155 |
|
156 class TDataTypeWithPriority |
|
157 /** A data (MIME) type and a priority value for that data type. |
|
158 |
|
159 The priority is used to resolve the current preferred handler of a data type, |
|
160 in the absence of any user preferences. An AIF file can associate an application |
|
161 with a data (MIME) type that is not native to Symbian OS. A priority value |
|
162 can be specified that allows the device to choose the highest priority application |
|
163 that can handle that data type. |
|
164 |
|
165 @publishedAll |
|
166 @released |
|
167 @see TDataType |
|
168 @see TDataTypePriority */ |
|
169 { |
|
170 public: |
|
171 TDataTypeWithPriority(); |
|
172 TDataTypeWithPriority(const TDataType& aDataType, TDataTypePriority aPriority); |
|
173 |
|
174 public: |
|
175 /** The data type. */ |
|
176 TDataType iDataType; |
|
177 /** The priority value. */ |
|
178 TDataTypePriority iPriority; |
|
179 }; |
|
180 |
|
181 #endif |
|