epoc32/include/apmstd.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#if !defined (__APMSTD_H__)
williamr@2
    17
#define __APMSTD_H__
williamr@2
    18
williamr@2
    19
#if !defined(__E32STD_H__)
williamr@2
    20
#include <e32std.h>
williamr@2
    21
#endif
williamr@2
    22
williamr@2
    23
/**
williamr@2
    24
@publishedAll
williamr@2
    25
@released
williamr@2
    26
*/
williamr@2
    27
const TInt KMaxDataTypeLength=256;
williamr@2
    28
williamr@2
    29
// classes referenced
williamr@2
    30
class RReadStream;
williamr@2
    31
class RWriteStream;
williamr@2
    32
williamr@2
    33
/** Defines the priority associated with a data type.
williamr@2
    34
williamr@2
    35
The priority is used by a device to resolve the current preferred handler 
williamr@2
    36
of a data type, in the absence of any user preferences.
williamr@2
    37
williamr@2
    38
@publishedAll
williamr@2
    39
@released
williamr@2
    40
@see TDataTypeWithPriority */
williamr@2
    41
typedef TInt32 TDataTypePriority;
williamr@2
    42
williamr@2
    43
/** Reserved for future use. 
williamr@2
    44
williamr@2
    45
@publishedAll
williamr@2
    46
@released */
williamr@2
    47
const TInt32 KDataTypePriorityUserSpecified=KMaxTInt16;
williamr@2
    48
williamr@4
    49
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@2
    50
/** This is a special priority that overrides any user settings. Applications must
williamr@2
    51
have EWriteDeviceData to use this priority. If they have not then they will be
williamr@2
    52
downgraded to KDataTypePriorityNormal.
williamr@2
    53
williamr@2
    54
@publishedPartner
williamr@2
    55
@released
williamr@2
    56
@see TDataTypeWithPriority */
williamr@2
    57
const TInt32 KDataTypePrioritySystem = 0xFFF9;
williamr@2
    58
williamr@4
    59
#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@4
    60
williamr@2
    61
/** Trusted applications may use this priority value to ensure 
williamr@2
    62
    their MIME type associations cannot be overridden by 
williamr@2
    63
    self signed (untrusted) applications.
williamr@2
    64
williamr@2
    65
@publishedAll
williamr@2
    66
@released
williamr@2
    67
@see TDataTypeWithPriority */
williamr@2
    68
const TInt32 KDataTypePriorityTrustedHigh = 0xC000;
williamr@2
    69
williamr@2
    70
/** This is Threshold priority for Un-Trusted apps i.e., for the applications which reside 
williamr@2
    71
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 
williamr@2
    72
than the threshold, if they claim for priority higher than the Threshold then it would be 
williamr@2
    73
reduced to KDataTypeUnTrustedPriorityThreshold.
williamr@2
    74
williamr@2
    75
@publishedAll
williamr@2
    76
@released */
williamr@2
    77
const TInt32 KDataTypeUnTrustedPriorityThreshold=KMaxTInt16;
williamr@2
    78
williamr@2
    79
/** A priority value associated with a data (MIME) type. Associating an application 
williamr@2
    80
with a data type at this priority means that this application, and no other, 
williamr@2
    81
should ever handle the data type. Use sparingly.
williamr@2
    82
williamr@2
    83
@publishedAll
williamr@2
    84
@released
williamr@2
    85
@see TDataTypeWithPriority */
williamr@2
    86
const TInt32 KDataTypePriorityHigh=10000;
williamr@2
    87
williamr@2
    88
/** A priority value associated with a data (MIME) type. Associating an application 
williamr@2
    89
with a data type at this priority means that the data type is the primary 
williamr@2
    90
type for that application. For example, "text/plain" files for a text editor.
williamr@2
    91
williamr@2
    92
@publishedAll
williamr@2
    93
@released
williamr@2
    94
@see TDataTypeWithPriority */
williamr@2
    95
const TInt32 KDataTypePriorityNormal=0;
williamr@2
    96
williamr@2
    97
/** A priority value associated with a data (MIME) type. Associating an application 
williamr@2
    98
with a data type at this priority means that the data type is a secondary 
williamr@2
    99
type for that application. For example, "text/plain" files for a web browser.
williamr@2
   100
williamr@2
   101
@publishedAll
williamr@2
   102
@released
williamr@2
   103
@see TDataTypeWithPriority */
williamr@2
   104
const TInt32 KDataTypePriorityLow=-10000;
williamr@2
   105
williamr@2
   106
/** A priority value associated with a data (MIME) type. Associating an application 
williamr@2
   107
with a data type at this priority means that the data type is a last resort 
williamr@2
   108
for that application. Use sparingly.
williamr@2
   109
williamr@2
   110
@publishedAll
williamr@2
   111
@released
williamr@2
   112
@see TDataTypeWithPriority */
williamr@2
   113
const TInt32 KDataTypePriorityLastResort=-20000;
williamr@2
   114
williamr@2
   115
/** Reserved for future use. 
williamr@2
   116
williamr@2
   117
@publishedAll
williamr@2
   118
@released */
williamr@2
   119
const TInt32 KDataTypePriorityNotSupported=KMinTInt16;
williamr@2
   120
williamr@2
   121
williamr@2
   122
class TDataType
williamr@2
   123
/** A data type.
williamr@2
   124
williamr@2
   125
The class maintains a string that describes the data type and an associated 
williamr@2
   126
UID.
williamr@2
   127
williamr@2
   128
A data type is also referred to as a MIME type. 
williamr@2
   129
williamr@2
   130
@publishedAll
williamr@2
   131
@released */
williamr@2
   132
	{
williamr@2
   133
public:
williamr@2
   134
	IMPORT_C TDataType();
williamr@2
   135
	IMPORT_C TDataType(const TDataType& aDataType);
williamr@2
   136
	IMPORT_C TDataType(const TDesC8& aDataType);
williamr@2
   137
	IMPORT_C TDataType(TUid aUid);
williamr@2
   138
	// enquiry
williamr@2
   139
	IMPORT_C TInt operator==(const TDataType& aDataType) const;
williamr@2
   140
	IMPORT_C TInt operator!=(const TDataType& aDataType) const;
williamr@2
   141
	IMPORT_C TBool IsNative() const;
williamr@2
   142
	// 
williamr@2
   143
	IMPORT_C TBuf<KMaxDataTypeLength> Des() const;
williamr@2
   144
	IMPORT_C TPtrC8 Des8() const;
williamr@2
   145
	IMPORT_C TUid Uid() const;
williamr@2
   146
	//
williamr@2
   147
	IMPORT_C void InternalizeL(RReadStream& aReadStream);
williamr@2
   148
	IMPORT_C void ExternalizeL(RWriteStream& aWriteStream) const;
williamr@2
   149
private:
williamr@2
   150
	void ParseDes();
williamr@2
   151
private:
williamr@2
   152
	TBuf8<KMaxDataTypeLength> iDataType;
williamr@2
   153
	TUid iUid;
williamr@2
   154
	};
williamr@4
   155
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@2
   156
/**
williamr@2
   157
@internalComponent
williamr@2
   158
*/
williamr@2
   159
#define KApaAppTypeDes _L8("x-epoc/x-app")
williamr@2
   160
williamr@2
   161
/**
williamr@2
   162
@internalComponent
williamr@2
   163
*/
williamr@2
   164
_LIT8(KEpocUrlDataTypeHeader, "X-Epoc-Url/");
williamr@2
   165
williamr@4
   166
#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@2
   167
williamr@2
   168
class TDataTypeWithPriority
williamr@2
   169
/** A data (MIME) type and a priority value for that data type.
williamr@2
   170
williamr@2
   171
The priority is used to resolve the current preferred handler of a data type, 
williamr@2
   172
in the absence of any user preferences. An AIF file can associate an application 
williamr@2
   173
with a data (MIME) type that is not native to Symbian OS. A priority value 
williamr@2
   174
can be specified that allows the device to choose the highest priority application 
williamr@2
   175
that can handle that data type.
williamr@2
   176
williamr@2
   177
@publishedAll 
williamr@2
   178
@released 
williamr@2
   179
@see TDataType
williamr@2
   180
@see TDataTypePriority */
williamr@2
   181
	{
williamr@2
   182
public:
williamr@2
   183
	IMPORT_C TDataTypeWithPriority();
williamr@2
   184
	IMPORT_C TDataTypeWithPriority(const TDataType& aDataType, TDataTypePriority aPriority);
williamr@2
   185
	//
williamr@2
   186
	IMPORT_C void InternalizeL(RReadStream& aReadStream);
williamr@2
   187
	IMPORT_C void ExternalizeL(RWriteStream& aWriteStream) const;
williamr@2
   188
public:
williamr@2
   189
	/** The data type. */
williamr@2
   190
	TDataType iDataType;
williamr@2
   191
	/** The priority value. */
williamr@2
   192
	TDataTypePriority iPriority;
williamr@2
   193
	};
williamr@2
   194
williamr@2
   195
#endif