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