hxlvtxt.h
Upload User: dangjiwu
Upload Date: 2013-07-19
Package Size: 42019k
Code Size: 13k
Category:

Symbian

Development Platform:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: hxlvtxt.h,v 1.1.32.3 2004/07/09 01:45:12 hubbe Exp $
  3.  * 
  4.  * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
  5.  * 
  6.  * The contents of this file, and the files included with this file,
  7.  * are subject to the current version of the RealNetworks Public
  8.  * Source License (the "RPSL") available at
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed
  10.  * the file under the current version of the RealNetworks Community
  11.  * Source License (the "RCSL") available at
  12.  * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
  13.  * will apply. You may also obtain the license terms directly from
  14.  * RealNetworks.  You may not use this file except in compliance with
  15.  * the RPSL or, if you have a valid RCSL with RealNetworks applicable
  16.  * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
  17.  * the rights, obligations and limitations governing use of the
  18.  * contents of the file.
  19.  * 
  20.  * Alternatively, the contents of this file may be used under the
  21.  * terms of the GNU General Public License Version 2 or later (the
  22.  * "GPL") in which case the provisions of the GPL are applicable
  23.  * instead of those above. If you wish to allow use of your version of
  24.  * this file only under the terms of the GPL, and not to allow others
  25.  * to use your version of this file under the terms of either the RPSL
  26.  * or RCSL, indicate your decision by deleting the provisions above
  27.  * and replace them with the notice and other provisions required by
  28.  * the GPL. If you do not delete the provisions above, a recipient may
  29.  * use your version of this file under the terms of any one of the
  30.  * RPSL, the RCSL or the GPL.
  31.  * 
  32.  * This file is part of the Helix DNA Technology. RealNetworks is the
  33.  * developer of the Original Code and owns the copyrights in the
  34.  * portions it created.
  35.  * 
  36.  * This file, and the files included with this file, is distributed
  37.  * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
  38.  * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
  39.  * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
  40.  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
  41.  * ENJOYMENT OR NON-INFRINGEMENT.
  42.  * 
  43.  * Technology Compatibility Kit Test Suite(s) Location:
  44.  *    http://www.helixcommunity.org/content/tck
  45.  * 
  46.  * Contributor(s):
  47.  * 
  48.  * ***** END LICENSE BLOCK ***** */
  49. #ifndef _HXLVTXT_H_
  50. #define _HXLVTXT_H_
  51. /* These need to be visible to rtlive and to exlvtext: */
  52. /* For live, duration is max allowed val, or max ulong:
  53.  */
  54. #if !defined(MAX_ULONG32)
  55. # define MAX_ULONG32     0xFFFFFFFF
  56. #endif
  57. #if !defined(MIN_LONG32)
  58. # define MIN_LONG32                 0xFFFFFFFF
  59. #endif
  60. /* These, too, need to be visible to rtlive and to exlvtext: */
  61. #define MAX_PACKET_SIZE     500
  62. #define USE_DEFAULT_TYPE     NULL
  63. #define USE_DEFAULT_HEIGHT          MAX_ULONG32
  64. #define USE_DEFAULT_WIDTH     MAX_ULONG32
  65. #define USE_DEFAULT_SCROLLRATE     MIN_LONG32
  66. #define USE_DEFAULT_CRAWLRATE     MIN_LONG32
  67. #define USE_DEFAULT_BGCOLOR     NULL
  68. #define USE_DEFAULT_LINKCOLOR     NULL
  69. #define USE_DEFAULT_LINKUNDERLINING 0x2
  70. #define USE_DEFAULT_WORDWRAP     0x2
  71. #define USE_DEFAULT_DOLOOPING     0L     
  72. #define USE_DEFAULT_IGNOREEXTRASPACES FALSE
  73. typedef _INTERFACE IUnknown IUnknown;
  74. typedef _INTERFACE IHXValues IHXValues;
  75. typedef _INTERFACE IHXPacket IHXPacket;
  76. typedef _INTERFACE IHXLiveText IHXLiveText;
  77. typedef _INTERFACE IHXLiveText2 IHXLiveText2;
  78. STDAPI
  79. CreateLiveText(IHXLiveText**);
  80. typedef HX_RESULT (HXEXPORT_PTR FPRMCREATELIVETEXT)(IHXLiveText** ppLiveText);
  81. DEFINE_GUID(IID_IHXLiveText,  0x00001b00, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  82. #undef INTERFACE
  83. #define INTERFACE IHXLiveText
  84. DECLARE_INTERFACE_(IHXLiveText, IUnknown)
  85. {
  86.     /***********************************************************************/
  87.     /*
  88.      * IUnknown methods
  89.      */
  90.     STDMETHOD(QueryInterface) (THIS_
  91.  REFIID riid,
  92.  void** ppvObj) PURE;
  93.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  94.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  95.     /***********************************************************************/
  96.     /*
  97.      * IHXLiveText methods
  98.      */
  99.     /*
  100.      * InitLiveText() must be called before any of the other IHXLiveText
  101.      * methods:
  102.      */
  103.     STDMETHOD(InitLiveText) (THIS_
  104. /*
  105.  * This is the computer where the
  106.  * RMServer is running:
  107.  */
  108. char* pAddress,
  109. /*
  110.  * This is the port number defined in
  111.  * the config file where the FSMount
  112.  * option has the following entry:
  113.  * { /encoder/, pn-encoder, Port=#### }
  114.  * where #### is the port number that
  115.  * encoders will use:
  116.  */
  117. UINT16 port,
  118. char* pUsername,
  119. char* pPassword,
  120. /*
  121.  * This is the "file" name that
  122.  * RMPlayers can use to view the
  123.  * stream.  For example, if your
  124.  * server was called "srv1" and the
  125.  * rtsp port in the config file was
  126.  * 8080, and the filename from the
  127.  * encoder was "foo.rtx", then a
  128.  * player could view the stream by
  129.  * opening the following location:
  130.  * "rtsp://srv1:8080/encoder/foo.rtx"
  131.  */
  132. char* pFilename) PURE;
  133.     /* ******************************************************************* */
  134.     /* The following methods are to be called prior to sending any data
  135.      * and exist as overrides to the default attributes of a RealText
  136.      * presentation.  Please see the section on the <WINDOW> header tag
  137.      * in the realtext.htm in the SDK's doc directory for more information.
  138.      * Note: with live text, you do not need a <WINDOW> tag; you must use
  139.      * the following methods to set the stream type (e.g., "tickertape"),
  140.      * window width, height, background color, ...etc.
  141.      */
  142.     
  143.     STDMETHOD(SetType) (THIS_
  144. char* szType) PURE;
  145.     STDMETHOD(SetWindowDimensions) (THIS_
  146. ULONG32 width,
  147. ULONG32 height) PURE;
  148.     STDMETHOD(SetTextMotion) (THIS_
  149. LONG32 scrollrate,
  150. LONG32 crawlrate) PURE;
  151.     STDMETHOD(SetBackgroundColor) (THIS_
  152. char* szBackgroundColor) PURE;
  153.     STDMETHOD(SetHyperlinkInfo) (THIS_
  154. BOOL underlineHyperlinks,
  155. char* szLinkColor) PURE;
  156.     STDMETHOD(UseWordwrap) (THIS_
  157. BOOL useWordwrap) PURE;
  158.     /*
  159.      * This is for "TickerTape"-type windows only; it is ignored by all
  160.      * other types:
  161.      */
  162.     STDMETHOD(SetDoLooping) (THIS_
  163. BOOL bDoLooping) PURE;
  164.     /* ******************************************************************* */
  165.     /*
  166.      * AddData() lets you add text to the stream.  The second
  167.      * parameter, bSendImmediately, can be used to force the encoder to
  168.      * send all text that's been added (and not yet sent) immediately.
  169.      * Note: if bSendImmediately is FALSE, the encoder will decide when
  170.      * to send the text it has buffered based on the length of the text in
  171.      * the buffer and the time since the last packet was sent:
  172.      */
  173.     STDMETHOD(AddData) (THIS_
  174. char* szMoreData,
  175. BOOL bSendImmediately) PURE;
  176.     /*
  177.      * AddTickerItem() lets you add "tickertape" text to the stream.
  178.      * This method prepends "<TU>" to szTickerUpperData, and
  179.      * "<TL>" to szTickerLowerData.  Calling:
  180.      * AddTickerItem("ABCD", "5 1/2", TRUE)
  181.      * is the same as calling
  182.      * AddData("<TU>ABCD", FALSE);
  183.      * AddData("<TL>5 1/2", TRUE);
  184.      * except that the former guarantees that the "upper" and "lower"
  185.      * items will be sent in the same packet. 
  186.      * (Please see the comments above for AddData() for details on use of
  187.      * the second parameter, bSendImmediately.
  188.      */
  189.     STDMETHOD(AddTickerItem) (THIS_
  190. char* szTickerUpperData,
  191. char* szTickerLowerData,
  192. BOOL bSendImmediately) PURE;
  193.     /* ******************************************************************* */
  194.     /*
  195.      * flush() tells the encoder to send everything that's in the buffer and
  196.      * clear it:
  197.      */
  198.     STDMETHOD(flush) (THIS) PURE;
  199.     /* ******************************************************************* */
  200.     /*
  201.      * GetTime returns the current system time in milliseconds.  The return
  202.      * value is a UINT32 (32-bit unsigned int):
  203.      */
  204.     STDMETHOD_(UINT32,GetTime)     (THIS) PURE;
  205.     /* ******************************************************************* */
  206.     /*
  207.      * This must be called on a regular basis: 
  208.      */
  209.     STDMETHOD(Process)     (THIS) PURE;
  210.     /* ******************************************************************* */
  211.     /*
  212.      * These methods keep track of the encoder's state and must be called
  213.      * as they are in main.cpp in the exlvtext directory:
  214.      */
  215.     STDMETHOD_(BOOL,EncoderIsInitialized)   (THIS) PURE;
  216.     STDMETHOD_(BOOL,PacketsHaveStarted)     (THIS) PURE;
  217.     STDMETHOD_(BOOL,EncoderIsDone)     (THIS) PURE;
  218.     STDMETHOD(SetEncoderDone)     (THIS) PURE;
  219. };
  220. DEFINE_GUID(IID_IHXLiveText2,  0x00001b01, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  221. #undef INTERFACE
  222. #define INTERFACE IHXLiveText2
  223. DECLARE_INTERFACE_(IHXLiveText2, IUnknown)
  224. {
  225.     /***********************************************************************/
  226.     /*
  227.      * IUnknown methods
  228.      */
  229.     STDMETHOD(QueryInterface) (THIS_
  230.  REFIID riid,
  231.  void** ppvObj) PURE;
  232.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  233.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  234.     /***********************************************************************/
  235.     /*
  236.      * IHXLiveText2 methods
  237.      */
  238.     /* ******************************************************************* */
  239.     /* The following methods are to be called prior to sending any data
  240.      * and exist as overrides to the default attributes of a RealText
  241.      * presentation.  Please see the section on the <window> header tag
  242.      * in the realtext.htm in the SDK's doc directory for more information.
  243.      * Note: these are additional to the IHXLiveText methods, listed
  244.      * above.
  245.      */
  246.     
  247.     /* This allows you to give an estimate of the bit rate needed by a live
  248.      * text stream so that the server can determine whether or not a player
  249.      * can view the stream based on its available bandwidth  This method
  250.      * should be called before sending any data::
  251.      */
  252.     STDMETHOD(DeclareAverageBitrate) (THIS_
  253. ULONG32 ulAvgBitsPerSecond) PURE;
  254.     /* As above, for DeclareAverageBitrate, this method should be called
  255.      * before sending any data::
  256.      */
  257.     STDMETHOD(DeclareMaximumBitrate) (THIS_
  258. ULONG32 ulMaxBitsPerSecond) PURE;
  259.     /*This determines how multiple contiguous space characters are presented;
  260.      * Defaults to FALSE which means that multiple spaces in non-tag text
  261.      * would all be renderered.  If this value is TRUE, multiple contiguous
  262.      * spaces will be treated as a single space.  This method should be
  263.      * called before sending any data.
  264.      */
  265.     STDMETHOD(IgnoreExtraSpaces) (THIS_
  266. BOOL bIgnoreExtraSpaces) PURE;
  267.     /* This is for internal testing use only and does not affect the
  268.      * presentation of a live text stream:
  269.      */
  270.     STDMETHOD(SetFlags) (THIS_
  271. ULONG32 ulFlags) PURE;
  272.     /* ******************************************************************* */
  273.     /* The following methods can be called at any time while the encoder is
  274.      * running.
  275.      */
  276.     /* This method tells you when the last-sent text will end.  This
  277.      * allows you to determine when it's ok to send more text.  For example,
  278.      * if you're streaming a presentation that's scrolling at a rate of 20
  279.      * pixels per second in a window that's 200 pixels high and you call
  280.      * IHXLiveText's AddData() with 100 lines of 20-point text, it will take
  281.      * 100 seconds for all that text to scroll up and out of the window.  The
  282.      * following method would return the current time plus 100 if you called
  283.      * it right after calling AddData():
  284.      */
  285.     STDMETHOD(GetLastSentTextEndTime) (THIS_
  286. ULONG32& ulLastEndTime) PURE;
  287.     /* This method allows you to adjust the time, since the last data was
  288.      * sent, that the encoder waits before resending "heartbeat" packets that
  289.      * let the server know the encoder still alive and to let newly-connected
  290.      * players know what's currently visible in the window (in case they
  291.      * connected during a "dry" period in the stream, after the last new
  292.      * text was sent).  Time is in milliseconds.  NOTE: this defaults to 
  293.      * 3000 milliseconds; any number higher than this will result in longer
  294.      * connect times for players coming in during a "dry" spell in the
  295.      * stream, and a sufficiently high value may cause the server to
  296.      * disconnect since it assumes the encoder has stopped if it does not
  297.      * periodically send data.  This value's minimum is 500 milliseconds.
  298.      */
  299.     STDMETHOD(SetTimeBetweenDryStreamResends) (THIS_
  300. ULONG32 ulMillisecBetweenResends) PURE;
  301. };
  302. #endif /* _HXLVTXT_H_ */