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