hxengin.h
来自「symbian 下的helix player源代码」· C头文件 代码 · 共 2,476 行 · 第 1/5 页
H
2,476 行
/* ***** BEGIN LICENSE BLOCK *****
* Source last modified: $Id: hxengin.h,v 1.4.2.3 2004/07/09 01:45:08 hubbe Exp $
*
* Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
*
* The contents of this file, and the files included with this file,
* are subject to the current version of the RealNetworks Public
* Source License (the "RPSL") available at
* http://www.helixcommunity.org/content/rpsl unless you have licensed
* the file under the current version of the RealNetworks Community
* Source License (the "RCSL") available at
* http://www.helixcommunity.org/content/rcsl, in which case the RCSL
* will apply. You may also obtain the license terms directly from
* RealNetworks. You may not use this file except in compliance with
* the RPSL or, if you have a valid RCSL with RealNetworks applicable
* to this file, the RCSL. Please see the applicable RPSL or RCSL for
* the rights, obligations and limitations governing use of the
* contents of the file.
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL") in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your version of
* this file only under the terms of the GPL, and not to allow others
* to use your version of this file under the terms of either the RPSL
* or RCSL, indicate your decision by deleting the provisions above
* and replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient may
* use your version of this file under the terms of any one of the
* RPSL, the RCSL or the GPL.
*
* This file is part of the Helix DNA Technology. RealNetworks is the
* developer of the Original Code and owns the copyrights in the
* portions it created.
*
* This file, and the files included with this file, is distributed
* and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
* KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
* ENJOYMENT OR NON-INFRINGEMENT.
*
* Technology Compatibility Kit Test Suite(s) Location:
* http://www.helixcommunity.org/content/tck
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** */
#ifndef _HXENGIN_H_
#define _HXENGIN_H_
#include "hxcom.h"
/*
* Forward declarations of some interfaces used here-in.
*/
typedef _INTERFACE IHXBuffer IHXBuffer;
typedef _INTERFACE IHXCallback IHXCallback;
typedef _INTERFACE IHXScheduler IHXScheduler;
typedef _INTERFACE IHXTCPResponse IHXTCPResponse;
typedef _INTERFACE IHXLBoundTCPSocket IHXLBoundTCPSocket;
typedef _INTERFACE IHXTCPSocket IHXTCPSocket;
typedef _INTERFACE IHXListenResponse IHXListenResponse;
typedef _INTERFACE IHXListenSocket IHXListenSocket;
typedef _INTERFACE IHXNetworkServices IHXNetworkServices;
typedef _INTERFACE IHXNetworkServices2 IHXNetworkServices2;
typedef _INTERFACE IHXUDPResponse IHXUDPResponse;
typedef _INTERFACE IHXUDPSocket IHXUDPSocket;
typedef _INTERFACE IHXResolver IHXResolver;
typedef _INTERFACE IHXResolverResponse IHXResolverResponse;
typedef _INTERFACE IHXInterruptSafe IHXInterruptSafe;
typedef _INTERFACE IHXAsyncIOSelection IHXAsyncIOSelection;
typedef _INTERFACE IHXUDPMulticastInit IHXUDPMulticastInit;
typedef _INTERFACE IHXInterruptState IHXInterruptState;
typedef _INTERFACE IHXOptimizedScheduler IHXOptimizedScheduler;
// $Private:
typedef _INTERFACE IHXThreadSafeScheduler IHXThreadSafeScheduler;
typedef _INTERFACE IHXBufferedSocket IHXBufferedSocket;
typedef _INTERFACE IHXNetInterfaces IHXNetInterfaces;
typedef _INTERFACE IHXNetInterfacesAdviseSink IHXNetInterfacesAdviseSink;
// $EndPrivate.
typedef _INTERFACE IHXNetworkInterfaceEnumerator IHXNetworkInterfaceEnumerator;
typedef _INTERFACE IHXUDPConnectedSocket IHXUDPConnectedSocket;
/*
* Address flags starting with PNR are depricated.
*/
#define HXR_INADDR_ANY (UINT32)0x00000000 //THIS FLAG IS DEPRICATED
#define HX_INADDR_ANY (UINT32)0x00000000
/*
* 255.255.255.254
*
* Bind to all ports in IPBindings list from
* server config.
*/
#define HXR_INADDR_IPBINDINGS (UINT32)0xfffffffe //THIS FLAG IS DEPRICATED
#define HX_INADDR_IPBINDINGS (UINT32)0xfffffffe
/* Async IO Selection Type (Unix Only) */
#define PNAIO_READ 1
#define PNAIO_WRITE 2
#define PNAIO_EXCEPTION 4
/****************************************************************************
*
* Interface:
*
* IHXCallback
*
* Purpose:
*
* This interface defines a simple callback which will be used in
* various interfaces such as IHXScheduler.
*
* IID_IHXCallback:
*
* {00000100-0901-11d1-8B06-00A024406D59}
*
*/
DEFINE_GUID(IID_IHXCallback, 0x00000100, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
0xa0, 0x24, 0x40, 0x6d, 0x59);
#undef INTERFACE
#define INTERFACE IHXCallback
DECLARE_INTERFACE_(IHXCallback, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/*
* IHXCallback methods
*/
/************************************************************************
* Method:
* IHXCallback::Func
* Purpose:
* This is the function that will be called when a callback is
* to be executed.
*/
STDMETHOD(Func) (THIS) PURE;
};
/****************************************************************************
*
* Interface:
*
* IHXScheduler
*
* Purpose:
*
* This interface provides the user with a way of scheduling callbacks
* that will be executed at some time in the future.
*
* IID_IHXScheduler:
*
* {00000101-0901-11d1-8B06-00A024406D59}
*
*/
DEFINE_GUID(IID_IHXScheduler, 0x00000101, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
0xa0, 0x24, 0x40, 0x6d, 0x59);
#undef INTERFACE
#define INTERFACE IHXScheduler
typedef ULONG32 CallbackHandle;
typedef struct _HXTimeval
{
UINT32 tv_sec;
UINT32 tv_usec;
} HXTimeval;
DECLARE_INTERFACE_(IHXScheduler, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/*
* IHXScheduler methods
*/
/************************************************************************
* Method:
* IHXScheduler::RelativeEnter
* Purpose:
* Schedule a callback to be executed "ms" milliseconds from now
* This function is less percise then AbsoluteEnter and should only
* be used when accurate timing is not critical.
*/
STDMETHOD_(CallbackHandle,RelativeEnter) (THIS_
IHXCallback* pCallback,
UINT32 ms) PURE;
/************************************************************************
* Method:
* IHXScheduler::AbsoluteEnter
* Purpose:
* Schedule a callback to be executed at time "tVal".
*/
STDMETHOD_(CallbackHandle,AbsoluteEnter) (THIS_
IHXCallback* pCallback,
HXTimeval tVal) PURE;
/************************************************************************
* Method:
* IHXScheduler::Remove
* Purpose:
* Remove a callback from the scheduler.
*/
STDMETHOD(Remove) (THIS_
CallbackHandle Handle) PURE;
/************************************************************************
* Method:
* IHXScheduler::GetCurrentSchedulerTime
* Purpose:
* Gives the current time (in the timeline of the scheduler).
*/
STDMETHOD_(HXTimeval,GetCurrentSchedulerTime) (THIS) PURE;
};
/****************************************************************************
*
* Interface:
*
* IHXTCPResponse
*
* Purpose:
*
* This is the response interface for the asynchronous TCP networking
* interface.
*
* IID_IHXTCPResponse:
*
* {00000102-0901-11d1-8B06-00A024406D59}
*
*/
DEFINE_GUID(IID_IHXTCPResponse, 0x00000102, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
0xa0, 0x24, 0x40, 0x6d, 0x59);
#undef INTERFACE
#define INTERFACE IHXTCPResponse
DECLARE_INTERFACE_(IHXTCPResponse, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/*
* IHXTCPResponse methods
*/
/************************************************************************
* Method:
* IHXTCPResponse::ConnectDone
* Purpose:
* A Connect operation has been completed or an error has occurred.
*/
STDMETHOD(ConnectDone) (THIS_
HX_RESULT status) PURE;
/************************************************************************
* Method:
* IHXTCPResponse::ReadDone
* Purpose:
* A Read operation has been completed or an error has occurred.
* The data is returned in the IHXBuffer.
*/
STDMETHOD(ReadDone) (THIS_
HX_RESULT status,
IHXBuffer* pBuffer) PURE;
/************************************************************************
* Method:
* IHXTCPResponse::WriteReady
* Purpose:
* This is the response method for WantWrite.
* If HX_RESULT is ok, then the TCP channel is ok to Write to.
*/
STDMETHOD(WriteReady) (THIS_
HX_RESULT status) PURE;
/************************************************************************
* Method:
* IHXTCPResponse::Closed
* Purpose:
* This method is called to inform you that the TCP channel has
* been closed by the peer or closed due to error.
*/
STDMETHOD(Closed) (THIS_
HX_RESULT status) PURE;
};
/****************************************************************************
*
* Interface:
*
* IHXTCPSocket
*
* Purpose:
*
* Provides the user with an asynchronous TCP networking interface.
*
* IID_IHXTCPSocket:
*
* {00000103-0901-11d1-8B06-00A024406D59}
*
*/
DEFINE_GUID(IID_IHXTCPSocket, 0x00000103, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
0xa0, 0x24, 0x40, 0x6d, 0x59);
#undef INTERFACE
#define INTERFACE IHXTCPSocket
DECLARE_INTERFACE_(IHXTCPSocket, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/*
* IHXTCPSocket methods
*
* Network addresses and ports are in native byte order
*
*/
STDMETHOD(Init) (THIS_
IHXTCPResponse* /*IN*/ pTCPResponse) PURE;
STDMETHOD(SetResponse) (THIS_
IHXTCPResponse* pTCPResponse) PURE;
STDMETHOD(Bind) (THIS_
UINT32 ulLocalAddr,
UINT16 nPort) PURE;
/*
* pDestination is a string containing host name or dotted-ip notation
*/
STDMETHOD(Connect) (THIS_
const char* pDestination,
UINT16 nPort) PURE;
STDMETHOD(Read) (THIS_
UINT16 Size) PURE;
STDMETHOD(Write) (THIS_
IHXBuffer* pBuffer) PURE;
/************************************************************************
* Method:
* IHXTCPSocket::WantWrite
* Purpose:
* This method is called when you wish to write a large amount of
* data. If you are only writing small amounts of data, you can
* just call Write (all data not ready to be transmitted will be
* buffered on your behalf). When the TCP channel is ready to be
* written to, the response interfaces WriteReady method will be
* called.
*/
STDMETHOD(WantWrite) (THIS) PURE;
/************************************************************************
* Method:
* IHXTCPSocket::GetForeignAddress
* Purpose:
* Returns the address of the other end of the TCP socket as a
* ULONG32 in local host order
*/
STDMETHOD(GetForeignAddress) (THIS_
REF(ULONG32) lAddress) PURE;
STDMETHOD(GetLocalAddress) (THIS_
REF(ULONG32) lAddress) PURE;
/************************************************************************
* Method:
* IHXTCPSocket::GetForeignPort
* Purpose:
* Returns the port of the other end of the TCP socket in local
* host order.
*/
STDMETHOD(GetForeignPort) (THIS_
REF(UINT16) port) PURE;
STDMETHOD(GetLocalPort) (THIS_
REF(UINT16) port) PURE;
};
// $Private:
/****************************************************************************
*
* Interface:
*
* IHXTCPSecureSocket
*
* Purpose:
*
* When an IHXTCPSocket also supports this interface,
* it allows you to say it's secure so it tries to use
* SSL.
*
*/
DEFINE_GUID(IID_IHXTCPSecureSocket, 0x00000203, 0x911, 0x21d1, 0x8c, 0x4, 0x0,
0xa0, 0x24, 0x40, 0x6d, 0x54);
#undef INTERFACE
#define INTERFACE IHXTCPSecureSocket
DECLARE_INTERFACE_(IHXTCPSecureSocket, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/*
* IHXTCPSecureSocket method
*/
STDMETHOD(SetSecure) (THIS_
BOOL bSecure) PURE;
};
// $EndPrivate.
// $Private:
/****************************************************************************
*
* Interface:
*
* IHXSSL
*
* Purpose:
*
* This is the interface to an SSL library.
*
*/
DEFINE_GUID(IID_IHXSSL, 0x34e171d4, 0xa8f0,
0x4832, 0xbc, 0x7d, 0x06, 0xdf, 0xe3, 0xae, 0x58, 0xfd);
DECLARE_INTERFACE_(IHXSSL, IUnknown)
{
/*
* IUnknown methods
*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?