epoc32/include/mmf/common/mmfcontrollerframeworkbase.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 2002-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@2
     4
// 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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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
williamr@2
    17
#ifndef __MMFCONTROLLERFRAMEWORKBASE_H__
williamr@2
    18
#define __MMFCONTROLLERFRAMEWORKBASE_H__
williamr@2
    19
williamr@2
    20
#include <e32base.h>
williamr@2
    21
#include <e32std.h>
williamr@2
    22
#include <s32mem.h>
williamr@2
    23
williamr@2
    24
/**
williamr@2
    25
@publishedAll
williamr@2
    26
@released
williamr@2
    27
williamr@2
    28
Constant that can be passed into the client API OpenURL() interfaces (as the aIapId parameter)
williamr@2
    29
to request that the default Internet Access Point be used.
williamr@2
    30
*/
williamr@2
    31
const TInt KUseDefaultIap = -1;
williamr@2
    32
williamr@2
    33
williamr@2
    34
/**
williamr@2
    35
@publishedAll
williamr@2
    36
@released
williamr@2
    37
williamr@2
    38
General purpose class to describe an event.
williamr@2
    39
williamr@2
    40
Contains a UID to define the actual event type, and an integer to define the event code.
williamr@2
    41
williamr@2
    42
Controller plugins can define their own event types, but should use
williamr@2
    43
KMMFErrorCategoryControllerGeneralError for any errors that can be described by
williamr@2
    44
the standard system-wide error codes.
williamr@2
    45
williamr@2
    46
@since 7.0s
williamr@2
    47
*/
williamr@2
    48
class TMMFEvent
williamr@2
    49
	{
williamr@2
    50
public:
williamr@2
    51
williamr@2
    52
	/**
williamr@2
    53
	Constructor.
williamr@2
    54
	
williamr@2
    55
	@param  aEventType
williamr@2
    56
	        A UID to define the type of event.
williamr@2
    57
	@param  aErrorCode
williamr@2
    58
	        The error code associated with the event.
williamr@2
    59
williamr@2
    60
	@since 7.0s
williamr@2
    61
	*/
williamr@2
    62
	IMPORT_C TMMFEvent(TUid aEventType, TInt aErrorCode);
williamr@2
    63
williamr@2
    64
	/**
williamr@2
    65
	Default constructor.
williamr@2
    66
	
williamr@2
    67
	Provided so this class can be packaged in a TPckgBuf<>.
williamr@2
    68
	@since 7.0s
williamr@2
    69
	*/
williamr@2
    70
	IMPORT_C TMMFEvent();
williamr@2
    71
williamr@2
    72
	/**
williamr@2
    73
	A UID to define the event type.
williamr@2
    74
	*/
williamr@2
    75
	TUid iEventType;
williamr@2
    76
williamr@2
    77
	/**
williamr@2
    78
	The error code associated with the event.
williamr@2
    79
	*/
williamr@2
    80
	TInt iErrorCode;
williamr@2
    81
private:
williamr@2
    82
	/**
williamr@2
    83
	This member is internal and not intended for use.
williamr@2
    84
	*/
williamr@2
    85
	TInt iReserved1;
williamr@2
    86
	};
williamr@2
    87
williamr@2
    88
/**
williamr@2
    89
@publishedAll
williamr@2
    90
@released
williamr@2
    91
williamr@2
    92
Package buffer for TMMFEvent
williamr@2
    93
*/
williamr@2
    94
typedef TPckgBuf<TMMFEvent> TMMFEventPckg;
williamr@2
    95
williamr@2
    96
/**
williamr@2
    97
@publishedAll
williamr@2
    98
@released
williamr@2
    99
williamr@2
   100
Package buffer for TUid
williamr@2
   101
*/
williamr@2
   102
typedef TPckgBuf<TUid> TMMFUidPckg;
williamr@2
   103
williamr@2
   104
/**
williamr@2
   105
@publishedAll
williamr@2
   106
@released
williamr@2
   107
williamr@2
   108
Package buffer for TTimeIntervalMicroSeconds
williamr@2
   109
*/
williamr@2
   110
typedef TPckgBuf<TTimeIntervalMicroSeconds> TMMFTimeIntervalMicroSecondsPckg;
williamr@2
   111
williamr@2
   112
williamr@2
   113
/**
williamr@2
   114
@publishedAll
williamr@2
   115
@released
williamr@2
   116
williamr@2
   117
A piece of meta data.
williamr@2
   118
williamr@2
   119
Meta data is often contained in the header of multimedia clips and is used to define
williamr@2
   120
attributes such as the author and copyright details.
williamr@2
   121
williamr@2
   122
Each piece of meta data has a name, or category, and a value.
williamr@2
   123
williamr@2
   124
@since 7.0s
williamr@2
   125
*/
williamr@2
   126
class CMMFMetaDataEntry : public CBase
williamr@2
   127
	{
williamr@2
   128
public:
williamr@2
   129
williamr@2
   130
	/**
williamr@2
   131
	Constructs a new meta data object using a name and value.
williamr@2
   132
williamr@2
   133
	This method can leave with one of the standard system-wide error codes.
williamr@2
   134
williamr@2
   135
	An example of a name might be:
williamr@2
   136
	@code
williamr@2
   137
	For example, <Copyright>
williamr@2
   138
	@endcode
williamr@2
   139
williamr@2
   140
	An example of a value might be:
williamr@2
   141
	@code
williamr@2
   142
	<Symbian (c) 2002>
williamr@2
   143
	@endcode
williamr@2
   144
williamr@2
   145
	@param	aName
williamr@2
   146
	        The name, or category, to be given to this piece of meta data.
williamr@2
   147
	@param  aValue
williamr@2
   148
	        The value of this piece of meta data.
williamr@2
   149
williamr@2
   150
	@return The newly created meta data object.
williamr@2
   151
williamr@2
   152
	@since	7.0s
williamr@2
   153
	*/
williamr@2
   154
	IMPORT_C static CMMFMetaDataEntry* NewL(const TDesC& aName, const TDesC& aValue);
williamr@2
   155
williamr@2
   156
	/**
williamr@2
   157
	Copy constructor. Returns a replica of the meta data passed in.
williamr@2
   158
williamr@2
   159
	This method can leave with one of the standard system-wide error codes.
williamr@2
   160
williamr@2
   161
	@param  aOther
williamr@2
   162
	        The meta data to be copied.
williamr@2
   163
williamr@2
   164
	@return The newly created meta data object.
williamr@2
   165
williamr@2
   166
	@since	7.0s
williamr@2
   167
	*/
williamr@2
   168
	IMPORT_C static CMMFMetaDataEntry* NewL(const CMMFMetaDataEntry& aOther);
williamr@2
   169
williamr@2
   170
	/**
williamr@2
   171
	Default constructor. Returns a blank meta data object. To be used when internalizing
williamr@2
   172
	data into the object.
williamr@2
   173
williamr@2
   174
	This method can leave with one of the standard system-wide error codes.
williamr@2
   175
williamr@2
   176
	@return  The newly created meta data object.
williamr@2
   177
williamr@2
   178
	@since	7.0s
williamr@2
   179
	*/
williamr@2
   180
	IMPORT_C static CMMFMetaDataEntry* NewL();
williamr@2
   181
williamr@2
   182
	/**
williamr@2
   183
	Destructor.
williamr@2
   184
williamr@2
   185
	@since	7.0s
williamr@2
   186
	*/
williamr@2
   187
	IMPORT_C ~CMMFMetaDataEntry();
williamr@2
   188
williamr@2
   189
	/**
williamr@2
   190
	Returns the name, or category, of the meta data.
williamr@2
   191
williamr@2
   192
	@return The name of the meta data object.
williamr@2
   193
williamr@2
   194
	@since	7.0s
williamr@2
   195
	*/
williamr@2
   196
	IMPORT_C const TDesC& Name() const;
williamr@2
   197
williamr@2
   198
	/**
williamr@2
   199
	Returns the value field of the meta data.
williamr@2
   200
williamr@2
   201
	@return The value field of the meta data object.
williamr@2
   202
williamr@2
   203
	@since  7.0s
williamr@2
   204
	*/
williamr@2
   205
	IMPORT_C const TDesC& Value() const;
williamr@2
   206
williamr@2
   207
	/**
williamr@2
   208
	Sets the name, or category, of the meta data.
williamr@2
   209
williamr@2
   210
	This method can leave with one of the standard system-wide error codes.
williamr@2
   211
williamr@2
   212
	@param  aName
williamr@2
   213
	        The new name of the meta data object
williamr@2
   214
williamr@2
   215
	@since	7.0s
williamr@2
   216
	*/
williamr@2
   217
	IMPORT_C void SetNameL(const TDesC& aName);
williamr@2
   218
williamr@2
   219
	/**
williamr@2
   220
	Sets the value field of the meta data.
williamr@2
   221
williamr@2
   222
	This method can leave with one of the standard system-wide error codes.
williamr@2
   223
williamr@2
   224
	@param  aValue
williamr@2
   225
	        The new value field of the meta data object
williamr@2
   226
williamr@2
   227
	@since	7.0s
williamr@2
   228
	*/
williamr@2
   229
	IMPORT_C void SetValueL(const TDesC& aValue);
williamr@2
   230
williamr@2
   231
	/**
williamr@2
   232
	Writes the data contained within the object to a stream so it can be copied
williamr@2
   233
	over IPC or written to a file.
williamr@2
   234
	
williamr@2
   235
	This method can leave with one of the standard system-wide error codes.
williamr@2
   236
williamr@2
   237
	@param  aStream
williamr@2
   238
	        The stream to be written to.
williamr@2
   239
williamr@2
   240
	@since	7.0s
williamr@2
   241
	*/
williamr@2
   242
	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
williamr@2
   243
williamr@2
   244
	/**
williamr@2
   245
	Reads data from a stream and copies it into this object.  Used when copying
williamr@2
   246
	a meta data object over IPC or reading it from a file.
williamr@2
   247
williamr@2
   248
	This method can leave with one of the standard system-wide error codes.
williamr@2
   249
williamr@2
   250
	@param  aStream
williamr@2
   251
	        The stream to be read.
williamr@2
   252
williamr@2
   253
	@since	7.0s
williamr@2
   254
	*/
williamr@2
   255
	IMPORT_C void InternalizeL(RReadStream& aStream);
williamr@2
   256
private:
williamr@2
   257
williamr@2
   258
	/**
williamr@2
   259
	Constructor.
williamr@2
   260
williamr@2
   261
	@since 7.0s
williamr@2
   262
	*/
williamr@2
   263
	CMMFMetaDataEntry();
williamr@2
   264
williamr@2
   265
	/**
williamr@2
   266
	Second phase constructor.
williamr@2
   267
williamr@2
   268
	An example of aName might be:
williamr@2
   269
	@code
williamr@2
   270
	<Copyright>
williamr@2
   271
	@endcode
williamr@2
   272
williamr@2
   273
	An example of aValue might be:
williamr@2
   274
	@code
williamr@2
   275
	<Symbian (c) 2002>
williamr@2
   276
	@endcode
williamr@2
   277
williamr@2
   278
	This method can leave with one of the standard system-wide error codes.
williamr@2
   279
williamr@2
   280
	@param  aName
williamr@2
   281
	        The name, or category, to be given to this piece of meta data.
williamr@2
   282
	@param  aValue
williamr@2
   283
	        The value of this piece of meta data.
williamr@2
   284
williamr@2
   285
	@since	7.0s
williamr@2
   286
	*/
williamr@2
   287
	void ConstructL(const TDesC& aName, const TDesC& aValue);
williamr@2
   288
private:
williamr@2
   289
	/**
williamr@2
   290
	The name, or category, of the meta data.
williamr@2
   291
	*/
williamr@2
   292
	HBufC* iName;
williamr@2
   293
williamr@2
   294
	/**
williamr@2
   295
	The value of the meta data.
williamr@2
   296
	*/
williamr@2
   297
	HBufC* iValue;
williamr@2
   298
	};
williamr@2
   299
williamr@2
   300
williamr@2
   301
williamr@2
   302
williamr@2
   303
/**
williamr@2
   304
@publishedAll
williamr@2
   305
@released
williamr@2
   306
williamr@2
   307
Class to be used to configure a URL source or sink.
williamr@2
   308
williamr@2
   309
Contains a variable length string to represent the URL, and whether to use a specified
williamr@2
   310
Internet Access Point or use the default.
williamr@2
   311
williamr@2
   312
@since 7.0s
williamr@2
   313
*/
williamr@2
   314
class CMMFUrlParams : public CBase
williamr@2
   315
	{
williamr@2
   316
public:
williamr@2
   317
williamr@2
   318
	/**
williamr@2
   319
	Factory function to create a CMMFUrlParams object.
williamr@2
   320
williamr@2
   321
	This method can leave with one of the standard system-wide error codes.
williamr@2
   322
williamr@2
   323
	@param  aUrl
williamr@2
   324
	        The url, for example http://www.symbian.com/clip.mpg
williamr@2
   325
	@param  aIAPId
williamr@2
   326
	        The Inernet Access Point to be used.  This should be a valid IAP ID
williamr@2
   327
	        retrieved from CommDB.  A special value of KUseDefaultIap can be used
williamr@2
   328
	        to signify that the plugin should just use the default IAP.
williamr@2
   329
williamr@2
   330
	@return A pointer to the newly created object.
williamr@2
   331
williamr@2
   332
	@since	7.0s
williamr@2
   333
	*/
williamr@2
   334
	IMPORT_C static CMMFUrlParams* NewL(const TDesC& aUrl, TInt aIAPId=KUseDefaultIap);
williamr@2
   335
williamr@2
   336
	/**
williamr@2
   337
	Factory function to create a CMMFUrlParams object.
williamr@2
   338
williamr@2
   339
	This method can leave with one of the standard system-wide error codes.
williamr@2
   340
williamr@2
   341
	@param  aUrl
williamr@2
   342
	        The url, for example http://www.symbian.com/clip.mpg
williamr@2
   343
	@param  aIAPId
williamr@2
   344
	        The Inernet Access Point to be used.  This should be a valid IAP ID
williamr@2
   345
	        retrieved from CommDB.  A special value of KUseDefaultIap can be used
williamr@2
   346
	        to signify that the plugin should just use the default IAP.
williamr@2
   347
	@return A pointer to the newly created object. The object will be left on the cleanup stack.
williamr@2
   348
williamr@2
   349
	@since	7.0s
williamr@2
   350
	*/
williamr@2
   351
	IMPORT_C static CMMFUrlParams* NewLC(const TDesC& aUrl, TInt aIAPId=KUseDefaultIap);
williamr@2
   352
williamr@2
   353
	/**
williamr@2
   354
	Factory function to create a CMMFUrlParams object by internalizing data from a stream.
williamr@2
   355
williamr@2
   356
	This method can leave with one of the standard system-wide error codes.
williamr@2
   357
williamr@2
   358
	@param  aStream
williamr@2
   359
	        The stream from which the object should be internalized.
williamr@2
   360
williamr@2
   361
	@return The newly created object. The object will be left on the cleanup stack.
williamr@2
   362
williamr@2
   363
	@since	7.0s
williamr@2
   364
	*/
williamr@2
   365
	IMPORT_C static CMMFUrlParams* NewLC(RReadStream& aStream);
williamr@2
   366
williamr@2
   367
	/**
williamr@2
   368
	Externalize this object to a stream.
williamr@2
   369
williamr@2
   370
	This method can leave with one of the standard system-wide error codes.
williamr@2
   371
williamr@2
   372
	@param  aStream
williamr@2
   373
	        The stream to which the object will be externalized.
williamr@2
   374
williamr@2
   375
	@since	7.0s
williamr@2
   376
	*/
williamr@2
   377
	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
williamr@2
   378
williamr@2
   379
	/**
williamr@2
   380
	Externalize this object into a newly created CBufFlat buffer.
williamr@2
   381
	
williamr@2
   382
	This method can leave with one of the standard system-wide error codes.
williamr@2
   383
williamr@2
   384
	@return The newly created buffer containing the externalized data. The CBufFlat object will be
williamr@2
   385
	        left on the cleanup stack.
williamr@2
   386
williamr@2
   387
	@since	7.0s
williamr@2
   388
	*/
williamr@2
   389
	IMPORT_C CBufFlat* ExternalizeToCBufFlatLC() const;
williamr@2
   390
williamr@2
   391
	/**
williamr@2
   392
	Destructor.
williamr@2
   393
	*/
williamr@2
   394
	~CMMFUrlParams();
williamr@2
   395
williamr@2
   396
williamr@2
   397
	/**
williamr@2
   398
	Returns the URL string, for example http://www.symbian.com/clip/mpg.
williamr@2
   399
williamr@2
   400
	@return The URL string.
williamr@2
   401
	@since	7.0s
williamr@2
   402
	*/
williamr@2
   403
	IMPORT_C const TDesC& Url() const;
williamr@2
   404
williamr@2
   405
	/**
williamr@2
   406
	Returns the Internet Access Point ID.
williamr@2
   407
	
williamr@2
   408
	@return IAP ID.
williamr@2
   409
williamr@2
   410
	@since	7.0s
williamr@2
   411
	*/
williamr@2
   412
	IMPORT_C TInt IAPId() const;
williamr@2
   413
williamr@2
   414
	/**
williamr@2
   415
	Signifies whether the IAP ID should be used. This is determined internally by comparing
williamr@2
   416
	the IAP ID with KUseDefaultIap.
williamr@2
   417
williamr@2
   418
	@return A boolean indicating if the IAP ID should be used. ETrue if the supplied IAPId should
williamr@2
   419
	        be used, EFalse if not.
williamr@2
   420
williamr@2
   421
	@since  7.0s
williamr@2
   422
	*/
williamr@2
   423
	IMPORT_C TBool UseIAPId() const;
williamr@2
   424
private:
williamr@2
   425
	CMMFUrlParams();
williamr@2
   426
	void ConstructL(const TDesC& aUrl, TInt aIAPId);
williamr@2
   427
	void ConstructL(RReadStream& aStream);
williamr@2
   428
private:
williamr@2
   429
	HBufC* iUrl;
williamr@2
   430
	TInt iIAPId;
williamr@2
   431
	};
williamr@2
   432
williamr@2
   433
williamr@2
   434
#endif