mmlibs/mmfw/inc/Mda/Common/Base.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 1997-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 // Mda\Common\Base.h
       
    15 // largely EMPTY - maintained for backwards compatibility
       
    16 // 
       
    17 //
       
    18 
       
    19 #ifndef __MDA_COMMON_BASE_H__
       
    20 #define __MDA_COMMON_BASE_H__
       
    21 
       
    22 /*
       
    23 Notes:
       
    24 Header file for information shared between client and server side
       
    25 Contains UID definitions, function numbers
       
    26 */
       
    27 
       
    28 // Standard EPOC32 includes
       
    29 #include <e32base.h>
       
    30 // Public Media Server includes
       
    31 #include <mda/common/base.hrh>
       
    32 
       
    33 #ifdef ASSERT
       
    34 #ifdef _DEBUG
       
    35 #undef ASSERT
       
    36 
       
    37 // Redefine assert to be a little more useful to us, i.e. to include file & line number
       
    38 #define __ASSERT_FILE__(s) _LIT(KPanicFileName,s)
       
    39 #define __ASSERT_PANIC__(l) User::Panic(KPanicFileName().Right(12),l)
       
    40 #define ASSERT(x) { __ASSERT_FILE__(__FILE__); __ASSERT_DEBUG(x, __ASSERT_PANIC__(__LINE__) ); }
       
    41 #endif
       
    42 #endif
       
    43 
       
    44 /**
       
    45  * @publishedAll
       
    46  *
       
    47  * Macro for producing different variants of Uids
       
    48  */
       
    49 #define MDA_UID(uid_name)	const TUint uid_name##Value = uid_name##Define; \
       
    50 							const TUid uid_name = {uid_name##Value};
       
    51 
       
    52 // Uids
       
    53 #if defined(UNICODE)
       
    54 
       
    55 /**
       
    56  * @publishedAll
       
    57  * @deprecated 
       
    58  *
       
    59  * Not used in MMF
       
    60  */
       
    61 const TInt KUidMediaServerLibraryValue = KUidMediaServerLibraryUnicodeDefine;
       
    62 #else
       
    63 
       
    64 /**
       
    65  * @publishedAll
       
    66  * @deprecated 
       
    67  *
       
    68  * Not used in MMF
       
    69  */
       
    70 const TInt KUidMediaServerLibraryValue = KUidMediaServerLibraryDefine;
       
    71 #endif
       
    72 
       
    73 /**
       
    74  * @publishedAll
       
    75  * @deprecated
       
    76  *
       
    77  * Not used in MMF
       
    78  */
       
    79 const TUid KUidMediaServerLibrary = {KUidMediaServerLibraryValue};
       
    80 
       
    81 /** 
       
    82  * @publishedAll
       
    83  * @deprecated 
       
    84  *
       
    85  * Unknown value
       
    86  */
       
    87 const TInt KMdaUnknown = -1;
       
    88 
       
    89 // Package classes
       
    90 
       
    91 /**
       
    92 @publishedAll
       
    93 @deprecated
       
    94 
       
    95 Abstract base class for all media server package types.
       
    96 
       
    97 This class has no user accessible functions.
       
    98 */
       
    99 class TMdaRawPackage
       
   100 	{
       
   101 public:
       
   102 	inline TPtr8& Package();
       
   103 	inline const TPtr8& Package() const;
       
   104 protected:
       
   105 	TMdaRawPackage(TInt aDerivedSize);
       
   106 	inline void SetSize(TInt aDerivedSize);
       
   107 protected:
       
   108 	TPtr8 iThis;
       
   109 	};
       
   110 
       
   111 /**
       
   112 @publishedAll
       
   113 @deprecated
       
   114 
       
   115 A data structure used to package messages (that include the package type) sent between the media server 
       
   116 and its clients.
       
   117 
       
   118 This class is abstract. It defines the attributes common to packages where the derived class's type needs 
       
   119 to be sent as part of the package. The attributes are a UID that identifies the package's concrete class 
       
   120 (so that the server can construct objects of the correct type), and a UID that identifies the package type 
       
   121 (the category of classes to which the package belongs). The package type is little used in practice. These 
       
   122 attributes and the derived class's size are set during construction of the derived class.
       
   123 */
       
   124 class TMdaPackage : public TMdaRawPackage
       
   125 	{
       
   126 public:
       
   127 	inline TUid Type() const;
       
   128 	inline TUid Uid() const;
       
   129 	inline void SetUid(TUid aUid);
       
   130 	inline TBool operator==(const TMdaPackage& aPackage); // Type&Uid comparison
       
   131 protected:
       
   132 	inline TMdaPackage(TUid aType, TUid aUid, TInt aDerivedSize);
       
   133 private:
       
   134 	TUid iType;
       
   135 	TUid iUid;
       
   136 	};
       
   137 
       
   138 /** 
       
   139  *  
       
   140  * @publishedAll
       
   141  * @deprecated
       
   142  *
       
   143  * Media server event identification - Not used in MMF
       
   144  */
       
   145 class TMdaEvent
       
   146 	{
       
   147 public:
       
   148 	TInt32 iId;
       
   149 	TInt32 iArg[3];
       
   150 	};
       
   151 
       
   152 
       
   153 /** 
       
   154  *  
       
   155  * @publishedAll
       
   156  * @deprecated
       
   157  *
       
   158  * Not used in MMF
       
   159  */
       
   160 class TMdaObjectEvent
       
   161 	{
       
   162 public:
       
   163 	TInt iHandle;
       
   164 	TMdaEvent iEvent;
       
   165 	};
       
   166 
       
   167 /** 
       
   168  *  
       
   169  * @publishedAll
       
   170  * @deprecated
       
   171  *
       
   172  * Not used in MMF
       
   173  */
       
   174 class TMdaEventPackage : public TMdaRawPackage
       
   175 	{
       
   176 public:
       
   177 	inline TMdaEventPackage(); // For single events
       
   178 	//
       
   179 	inline TInt EventCount() const;
       
   180 	inline TInt MaxEvents() const;
       
   181 	inline const TMdaEvent& Event(); // First event only
       
   182 	inline const TMdaEvent& Event(TInt aIndex);
       
   183 	inline TInt EventFrom(); // first event only
       
   184 	inline TInt EventFrom(TInt aIndex);
       
   185 protected:
       
   186 	inline TMdaEventPackage(TInt aMaxEvents);
       
   187 protected:
       
   188 	TInt iMaxEvents;
       
   189 	TInt iValidEvents;
       
   190 	TMdaObjectEvent iFirstEvent;
       
   191 	};
       
   192 
       
   193 #include <mda/common/base.inl>
       
   194 
       
   195 #include <mmf/common/mmfbase.h>
       
   196 
       
   197 #endif