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