1.1 --- a/epoc32/include/apmstd.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/apmstd.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,192 @@
1.4 -apmstd.h
1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#if !defined (__APMSTD_H__)
1.21 +#define __APMSTD_H__
1.22 +
1.23 +#if !defined(__E32STD_H__)
1.24 +#include <e32std.h>
1.25 +#endif
1.26 +
1.27 +/**
1.28 +@publishedAll
1.29 +@released
1.30 +*/
1.31 +const TInt KMaxDataTypeLength=256;
1.32 +
1.33 +// classes referenced
1.34 +class RReadStream;
1.35 +class RWriteStream;
1.36 +
1.37 +/** Defines the priority associated with a data type.
1.38 +
1.39 +The priority is used by a device to resolve the current preferred handler
1.40 +of a data type, in the absence of any user preferences.
1.41 +
1.42 +@publishedAll
1.43 +@released
1.44 +@see TDataTypeWithPriority */
1.45 +typedef TInt32 TDataTypePriority;
1.46 +
1.47 +/** Reserved for future use.
1.48 +
1.49 +@publishedAll
1.50 +@released */
1.51 +const TInt32 KDataTypePriorityUserSpecified=KMaxTInt16;
1.52 +
1.53 +/** This is a special priority that overrides any user settings. Applications must
1.54 +have EWriteDeviceData to use this priority. If they have not then they will be
1.55 +downgraded to KDataTypePriorityNormal.
1.56 +
1.57 +@publishedPartner
1.58 +@released
1.59 +@see TDataTypeWithPriority */
1.60 +const TInt32 KDataTypePrioritySystem = 0xFFF9;
1.61 +
1.62 +/** Trusted applications may use this priority value to ensure
1.63 + their MIME type associations cannot be overridden by
1.64 + self signed (untrusted) applications.
1.65 +
1.66 +@publishedAll
1.67 +@released
1.68 +@see TDataTypeWithPriority */
1.69 +const TInt32 KDataTypePriorityTrustedHigh = 0xC000;
1.70 +
1.71 +/** This is Threshold priority for Un-Trusted apps i.e., for the applications which reside
1.72 +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
1.73 +than the threshold, if they claim for priority higher than the Threshold then it would be
1.74 +reduced to KDataTypeUnTrustedPriorityThreshold.
1.75 +
1.76 +@publishedAll
1.77 +@released */
1.78 +const TInt32 KDataTypeUnTrustedPriorityThreshold=KMaxTInt16;
1.79 +
1.80 +/** A priority value associated with a data (MIME) type. Associating an application
1.81 +with a data type at this priority means that this application, and no other,
1.82 +should ever handle the data type. Use sparingly.
1.83 +
1.84 +@publishedAll
1.85 +@released
1.86 +@see TDataTypeWithPriority */
1.87 +const TInt32 KDataTypePriorityHigh=10000;
1.88 +
1.89 +/** A priority value associated with a data (MIME) type. Associating an application
1.90 +with a data type at this priority means that the data type is the primary
1.91 +type for that application. For example, "text/plain" files for a text editor.
1.92 +
1.93 +@publishedAll
1.94 +@released
1.95 +@see TDataTypeWithPriority */
1.96 +const TInt32 KDataTypePriorityNormal=0;
1.97 +
1.98 +/** A priority value associated with a data (MIME) type. Associating an application
1.99 +with a data type at this priority means that the data type is a secondary
1.100 +type for that application. For example, "text/plain" files for a web browser.
1.101 +
1.102 +@publishedAll
1.103 +@released
1.104 +@see TDataTypeWithPriority */
1.105 +const TInt32 KDataTypePriorityLow=-10000;
1.106 +
1.107 +/** A priority value associated with a data (MIME) type. Associating an application
1.108 +with a data type at this priority means that the data type is a last resort
1.109 +for that application. Use sparingly.
1.110 +
1.111 +@publishedAll
1.112 +@released
1.113 +@see TDataTypeWithPriority */
1.114 +const TInt32 KDataTypePriorityLastResort=-20000;
1.115 +
1.116 +/** Reserved for future use.
1.117 +
1.118 +@publishedAll
1.119 +@released */
1.120 +const TInt32 KDataTypePriorityNotSupported=KMinTInt16;
1.121 +
1.122 +
1.123 +class TDataType
1.124 +/** A data type.
1.125 +
1.126 +The class maintains a string that describes the data type and an associated
1.127 +UID.
1.128 +
1.129 +A data type is also referred to as a MIME type.
1.130 +
1.131 +@publishedAll
1.132 +@released */
1.133 + {
1.134 +public:
1.135 + IMPORT_C TDataType();
1.136 + IMPORT_C TDataType(const TDataType& aDataType);
1.137 + IMPORT_C TDataType(const TDesC8& aDataType);
1.138 + IMPORT_C TDataType(TUid aUid);
1.139 + // enquiry
1.140 + IMPORT_C TInt operator==(const TDataType& aDataType) const;
1.141 + IMPORT_C TInt operator!=(const TDataType& aDataType) const;
1.142 + IMPORT_C TBool IsNative() const;
1.143 + //
1.144 + IMPORT_C TBuf<KMaxDataTypeLength> Des() const;
1.145 + IMPORT_C TPtrC8 Des8() const;
1.146 + IMPORT_C TUid Uid() const;
1.147 + //
1.148 + IMPORT_C void InternalizeL(RReadStream& aReadStream);
1.149 + IMPORT_C void ExternalizeL(RWriteStream& aWriteStream) const;
1.150 +private:
1.151 + void ParseDes();
1.152 +private:
1.153 + TBuf8<KMaxDataTypeLength> iDataType;
1.154 + TUid iUid;
1.155 + };
1.156 +
1.157 +/**
1.158 +@internalComponent
1.159 +*/
1.160 +#define KApaAppTypeDes _L8("x-epoc/x-app")
1.161 +
1.162 +/**
1.163 +@internalComponent
1.164 +*/
1.165 +_LIT8(KEpocUrlDataTypeHeader, "X-Epoc-Url/");
1.166 +
1.167 +
1.168 +
1.169 +class TDataTypeWithPriority
1.170 +/** A data (MIME) type and a priority value for that data type.
1.171 +
1.172 +The priority is used to resolve the current preferred handler of a data type,
1.173 +in the absence of any user preferences. An AIF file can associate an application
1.174 +with a data (MIME) type that is not native to Symbian OS. A priority value
1.175 +can be specified that allows the device to choose the highest priority application
1.176 +that can handle that data type.
1.177 +
1.178 +@publishedAll
1.179 +@released
1.180 +@see TDataType
1.181 +@see TDataTypePriority */
1.182 + {
1.183 +public:
1.184 + IMPORT_C TDataTypeWithPriority();
1.185 + IMPORT_C TDataTypeWithPriority(const TDataType& aDataType, TDataTypePriority aPriority);
1.186 + //
1.187 + IMPORT_C void InternalizeL(RReadStream& aReadStream);
1.188 + IMPORT_C void ExternalizeL(RWriteStream& aWriteStream) const;
1.189 +public:
1.190 + /** The data type. */
1.191 + TDataType iDataType;
1.192 + /** The priority value. */
1.193 + TDataTypePriority iPriority;
1.194 + };
1.195 +
1.196 +#endif