sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Mda\Common\Base.h sl@0: // largely EMPTY - maintained for backwards compatibility sl@0: // sl@0: // sl@0: sl@0: #ifndef __MDA_COMMON_BASE_H__ sl@0: #define __MDA_COMMON_BASE_H__ sl@0: sl@0: /* sl@0: Notes: sl@0: Header file for information shared between client and server side sl@0: Contains UID definitions, function numbers sl@0: */ sl@0: sl@0: // Standard EPOC32 includes sl@0: #include sl@0: // Public Media Server includes sl@0: #include sl@0: sl@0: #ifdef ASSERT sl@0: #ifdef _DEBUG sl@0: #undef ASSERT sl@0: sl@0: // Redefine assert to be a little more useful to us, i.e. to include file & line number sl@0: #define __ASSERT_FILE__(s) _LIT(KPanicFileName,s) sl@0: #define __ASSERT_PANIC__(l) User::Panic(KPanicFileName().Right(12),l) sl@0: #define ASSERT(x) { __ASSERT_FILE__(__FILE__); __ASSERT_DEBUG(x, __ASSERT_PANIC__(__LINE__) ); } sl@0: #endif sl@0: #endif sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * sl@0: * Macro for producing different variants of Uids sl@0: */ sl@0: #define MDA_UID(uid_name) const TUint uid_name##Value = uid_name##Define; \ sl@0: const TUid uid_name = {uid_name##Value}; sl@0: sl@0: // Uids sl@0: #if defined(UNICODE) sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @deprecated sl@0: * sl@0: * Not used in MMF sl@0: */ sl@0: const TInt KUidMediaServerLibraryValue = KUidMediaServerLibraryUnicodeDefine; sl@0: #else sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @deprecated sl@0: * sl@0: * Not used in MMF sl@0: */ sl@0: const TInt KUidMediaServerLibraryValue = KUidMediaServerLibraryDefine; sl@0: #endif sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @deprecated sl@0: * sl@0: * Not used in MMF sl@0: */ sl@0: const TUid KUidMediaServerLibrary = {KUidMediaServerLibraryValue}; sl@0: sl@0: /** sl@0: * @publishedAll sl@0: * @deprecated sl@0: * sl@0: * Unknown value sl@0: */ sl@0: const TInt KMdaUnknown = -1; sl@0: sl@0: // Package classes sl@0: sl@0: /** sl@0: @publishedAll sl@0: @deprecated sl@0: sl@0: Abstract base class for all media server package types. sl@0: sl@0: This class has no user accessible functions. sl@0: */ sl@0: class TMdaRawPackage sl@0: { sl@0: public: sl@0: inline TPtr8& Package(); sl@0: inline const TPtr8& Package() const; sl@0: protected: sl@0: TMdaRawPackage(TInt aDerivedSize); sl@0: inline void SetSize(TInt aDerivedSize); sl@0: protected: sl@0: TPtr8 iThis; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @deprecated sl@0: sl@0: A data structure used to package messages (that include the package type) sent between the media server sl@0: and its clients. sl@0: sl@0: This class is abstract. It defines the attributes common to packages where the derived class's type needs sl@0: to be sent as part of the package. The attributes are a UID that identifies the package's concrete class sl@0: (so that the server can construct objects of the correct type), and a UID that identifies the package type sl@0: (the category of classes to which the package belongs). The package type is little used in practice. These sl@0: attributes and the derived class's size are set during construction of the derived class. sl@0: */ sl@0: class TMdaPackage : public TMdaRawPackage sl@0: { sl@0: public: sl@0: inline TUid Type() const; sl@0: inline TUid Uid() const; sl@0: inline void SetUid(TUid aUid); sl@0: inline TBool operator==(const TMdaPackage& aPackage); // Type&Uid comparison sl@0: protected: sl@0: inline TMdaPackage(TUid aType, TUid aUid, TInt aDerivedSize); sl@0: private: sl@0: TUid iType; sl@0: TUid iUid; sl@0: }; sl@0: sl@0: /** sl@0: * sl@0: * @publishedAll sl@0: * @deprecated sl@0: * sl@0: * Media server event identification - Not used in MMF sl@0: */ sl@0: class TMdaEvent sl@0: { sl@0: public: sl@0: TInt32 iId; sl@0: TInt32 iArg[3]; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: * sl@0: * @publishedAll sl@0: * @deprecated sl@0: * sl@0: * Not used in MMF sl@0: */ sl@0: class TMdaObjectEvent sl@0: { sl@0: public: sl@0: TInt iHandle; sl@0: TMdaEvent iEvent; sl@0: }; sl@0: sl@0: /** sl@0: * sl@0: * @publishedAll sl@0: * @deprecated sl@0: * sl@0: * Not used in MMF sl@0: */ sl@0: class TMdaEventPackage : public TMdaRawPackage sl@0: { sl@0: public: sl@0: inline TMdaEventPackage(); // For single events sl@0: // sl@0: inline TInt EventCount() const; sl@0: inline TInt MaxEvents() const; sl@0: inline const TMdaEvent& Event(); // First event only sl@0: inline const TMdaEvent& Event(TInt aIndex); sl@0: inline TInt EventFrom(); // first event only sl@0: inline TInt EventFrom(TInt aIndex); sl@0: protected: sl@0: inline TMdaEventPackage(TInt aMaxEvents); sl@0: protected: sl@0: TInt iMaxEvents; sl@0: TInt iValidEvents; sl@0: TMdaObjectEvent iFirstEvent; sl@0: }; sl@0: sl@0: #include sl@0: sl@0: #include sl@0: sl@0: #endif