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

Symbian

Development Platform:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: sm1doc.h,v 1.2.12.1 2004/07/09 01:57:34 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 _SM1DOC_H_
  50. #define _SM1DOC_H_
  51. #include "hxthread.h"
  52. #include "baseobj.h"
  53. class CSmil1Renderer;
  54. class CSmil1Parser;
  55. class CSmil1BasicRegion;
  56. class CSmil1RootLayout;
  57. class CHXHeader;
  58. struct SMIL1PlayToAssoc;
  59. struct SMIL1SourceInfo;
  60. class CSmil1LayoutEvent;
  61. class CSmil1ShowSiteEvent;
  62. class CSmil1EventHook;
  63. class CSmil1PassiveSiteWatcher;
  64. class CResourceLoader;
  65. class ProcessElementCallback;
  66. #ifdef _WINDOWS
  67. class CHXDIBits;
  68. #endif
  69. #if defined(_UNIX) && (!(defined(_BEOS))) && (!(defined(_MAC_UNIX)))
  70. #include <X11/Xlib.h>
  71. #include <X11/Xutil.h>
  72. typedef ULONG32 COLORTYPE;
  73. class XData
  74. {
  75.   public:
  76.       XData()
  77.       {
  78.   m_Pixmap = 0;
  79.   m_Display = 0;
  80.       }
  81.       ~XData()
  82.       {
  83.   if (m_Pixmap != 0)
  84.   {
  85.               XFreePixmap(m_Display, m_Pixmap);
  86.   }
  87.       }
  88.   public:
  89.       HXBitmapInfoHeader m_backgroundBitmapInfoHeader;
  90.       Pixmap m_Pixmap;
  91.       Display* m_Display;
  92.       Colormap m_colormap;
  93. };
  94. #endif    // _UNIX
  95. class CSmil1DocumentRenderer:  public IHXSiteUser,
  96.        public IHXRendererAdviseSink,
  97.        public IHXGroupSink,
  98.        public IHXValues,
  99.        public CSmil1ElementHandler,
  100.        public IHXPassiveSiteWatcher,
  101.                                public CHXBaseCountingObject
  102. {
  103. public:
  104.     CSmil1DocumentRenderer     (CSmil1Renderer* pParent,
  105.     IUnknown* pContext);
  106.     virtual ~CSmil1DocumentRenderer  ();
  107.     HX_RESULT close     (CSmil1Renderer* pParent);
  108.     HX_RESULT setDocument     (const char* pFragment);
  109.     HX_RESULT onPacket     (IHXBuffer* pBuffer,
  110.     BOOL bIsFinal);
  111.     HX_RESULT handleLButtonUp     (const char* pID,
  112.     UINT16 uXPos,
  113.     UINT16 uYPos);
  114.     HX_RESULT handleMouseMove     (void* pWindow,
  115.     const char* pID,
  116.     UINT16 uXPos,
  117.     UINT16 uYPos);
  118.     BOOL handleSetCursor     ();
  119.     HX_RESULT detachSite     (IHXSite* pSite);
  120.     double     getResizeXScale()
  121.     {
  122. return m_dResizeXScale;
  123.     }
  124.     double     getResizeYScale()
  125.     {
  126. return m_dResizeYScale;
  127.     }
  128.     HX_RESULT addShowEvents     (const char* pRegionName,
  129.     IHXSite* pSite);
  130.     /*
  131.      * IUnknown methods
  132.      */
  133.     STDMETHOD(QueryInterface)     (THIS_
  134.     REFIID riid,
  135.     void** ppvObj);
  136.     STDMETHOD_(ULONG32, AddRef)     (THIS);
  137.     STDMETHOD_(ULONG32, Release)    (THIS);
  138.     /*
  139.      * IHXSiteUser methods
  140.      */
  141.     STDMETHOD(AttachSite)     (THIS_
  142.     IHXSite* pSite);
  143.     STDMETHOD(DetachSite)     (THIS);
  144.     STDMETHOD(HandleEvent)     (THIS_
  145.     HXxEvent* pEvent);
  146.     STDMETHOD_(BOOL,NeedsWindowedSites) (THIS);
  147.     /*
  148.      * IHXRendererAdviseSink methods
  149.      */
  150.     STDMETHOD(TrackDurationSet) (THIS_
  151. UINT32 ulGroupIndex,
  152. UINT32 ulTrackIndex,
  153. UINT32 ulDuration,
  154. UINT32 ulDelay,
  155. BOOL   bIsLive);
  156.     STDMETHOD(RepeatedTrackDurationSet) (THIS_
  157. const char*  pID,
  158. UINT32 ulDuration,
  159.         BOOL   bIsLive);
  160.     STDMETHOD(RendererInitialized) (THIS_
  161. IHXRenderer* pRend,
  162. IUnknown* pStream,
  163. IHXValues* pInfo);
  164.     STDMETHOD(RendererClosed) (THIS_
  165. IHXRenderer* pRend,
  166. IHXValues* pInfo);
  167.     // /POST-RP8REV release IHXRendererAdviseSink method:
  168.     STDMETHOD(TrackUpdated)             (THIS_ UINT32 ulGroupIndex, UINT32 ulTrackIndex,
  169.                                                IHXValues* pValues);
  170.     /*
  171.      * IHXGroupSink methods
  172.      */
  173.     STDMETHOD(GroupAdded) (THIS_
  174. UINT16 uGroupIndex,
  175. IHXGroup* pGroup);
  176.     STDMETHOD(GroupRemoved) (THIS_
  177. UINT16 uGroupIndex,
  178. IHXGroup* pGroup);
  179.     STDMETHOD(AllGroupsRemoved) (THIS);
  180.     STDMETHOD(TrackAdded) (THIS_
  181. UINT16 uGroupIndex,
  182. UINT16 uTrackIndex,
  183. IHXValues* pTrack);
  184.     STDMETHOD(TrackRemoved) (THIS_
  185. UINT16 uGroupIndex,
  186. UINT16 uTrackIndex,
  187. IHXValues* pTrack);
  188.     STDMETHOD(TrackStarted) (THIS_
  189. UINT16 uGroupIndex,
  190. UINT16 uTrackIndex,
  191. IHXValues* pTrack);
  192.     STDMETHOD(TrackStopped) (THIS_
  193. UINT16 uGroupIndex,
  194. UINT16 uTrackIndex,
  195. IHXValues* pTrack);
  196.     STDMETHOD(CurrentGroupSet) (THIS_
  197. UINT16 uGroupIndex,
  198. IHXGroup* pGroup);
  199.     /*
  200.      * IHXValues methods
  201.      */
  202.     STDMETHOD(SetPropertyULONG32) (THIS_
  203. const char*  pPropertyName,
  204. ULONG32  uPropertyValue);
  205.     STDMETHOD(GetPropertyULONG32) (THIS_
  206. const char*  pPropertyName,
  207. REF(ULONG32)  uPropertyValue);
  208.     STDMETHOD(GetFirstPropertyULONG32) (THIS_
  209. REF(const char*) pPropertyName,
  210. REF(ULONG32)  uPropertyValue);
  211.     STDMETHOD(GetNextPropertyULONG32) (THIS_
  212. REF(const char*) pPropertyName,
  213. REF(ULONG32)  uPropertyValue);
  214.     STDMETHOD(SetPropertyBuffer) (THIS_
  215. const char*  pPropertyName,
  216. IHXBuffer*  pPropertyValue);
  217.     STDMETHOD(GetPropertyBuffer) (THIS_
  218. const char*  pPropertyName,
  219. REF(IHXBuffer*) pPropertyValue);
  220.     STDMETHOD(GetFirstPropertyBuffer) (THIS_
  221. REF(const char*) pPropertyName,
  222. REF(IHXBuffer*) pPropertyValue);
  223.     STDMETHOD(GetNextPropertyBuffer) (THIS_
  224. REF(const char*) pPropertyName,
  225. REF(IHXBuffer*) pPropertyValue);
  226.     STDMETHOD(SetPropertyCString) (THIS_
  227. const char*  pPropertyName,
  228. IHXBuffer*  pPropertyValue);
  229.     STDMETHOD(GetPropertyCString) (THIS_
  230. const char*  pPropertyName,
  231. REF(IHXBuffer*) pPropertyValue);
  232.     STDMETHOD(GetFirstPropertyCString) (THIS_
  233. REF(const char*) pPropertyName,
  234. REF(IHXBuffer*) pPropertyValue);
  235.     STDMETHOD(GetNextPropertyCString) (THIS_
  236. REF(const char*) pPropertyName,
  237. REF(IHXBuffer*) pPropertyValue);
  238.     /*
  239.      * IHXPassiveSiteWatcher methods
  240.      */
  241.     STDMETHOD(PositionChanged) (THIS_
  242. HXxPoint* /*IN*/ pPoint);
  243.     STDMETHOD(SizeChanged)  (THIS_
  244. HXxSize* /*IN*/ pSize);
  245.     /*
  246.      * CSmil1ElementHandler methods
  247.      */
  248.     HX_RESULT handleAddGroup (CSmil1AddGroup* pAddGroup);
  249.     HX_RESULT handleRegion (CSmil1Region* pRegion);
  250.     HX_RESULT handleRootLayout (CSmil1RootLayout* pRootLayout);
  251.     HX_RESULT handleSource (CSmil1Source* pSource);
  252.     HX_RESULT handleMeta (CSmil1Meta* pMeta);
  253.     HX_RESULT handleEndLayout (CSmil1EndLayout* pSource);
  254.     HX_RESULT handleRendererPreFetch (CSmil1RendererPreFetch* pRend);
  255.     HX_RESULT handleSourceUpdate (CSmil1SourceUpdate* pUpdate);
  256.     /*
  257.      * CSmil1Parser methods
  258.      */
  259.     HX_RESULT onHeader (IHXValues* pHeader);
  260.     HX_RESULT onTimeSync (UINT32 ulTimeValue);
  261.     HX_RESULT onPreSeek (UINT32 ulOldTime,
  262. UINT32 ulNewTime);
  263.     HX_RESULT endStream ();
  264.     HX_RESULT seekTo (const char* pElementID);
  265.     CSmil1BasicRegion* getRegion (const char* pID);
  266.     void resizeRegion (const char* pRegionName,
  267. HXxSize* pNewSize);
  268.     void repositionRegion (const char* pRegionName,
  269. HXxPoint* pNewPosition);
  270.     void setTopLevelSiteSize ();
  271.     HX_RESULT HandleSurfaceUpdate (HXxEvent* pEvent,
  272. IHXSite* pSite,
  273. HXxColor ulBGColor);
  274.     HX_RESULT getErrorInfo (REF(UINT32) ulErrorLine,
  275.  REF(UINT32) ulErrorColumn,
  276.  REF(IHXBuffer*) pErrorText);
  277.     HX_RESULT  GetElementProperties(UINT16 uGroupID, 
  278.       UINT16 uTrackID, 
  279.       REF(IHXValues*) pProperties);
  280.     HX_RESULT  GetElementStatus(UINT16     uGroupID,
  281.   UINT16     uTrackID,
  282.   UINT32     ulCurrentTime,
  283.   REF(IHXValues*)  pStatus);
  284.     HX_RESULT  AttachElementLayout(UINT16     uGroupID,
  285.      UINT16     uTrackID,
  286.      IHXRenderer*  pRenderer,
  287.      IHXStream*    pStream,
  288.      IHXValues*    pProps);
  289.     HX_RESULT  DetachElementLayout(IUnknown*     pLSG);
  290.     BOOL m_bSiteChangingSize;
  291.     BOOL m_bNeedToAdjustSites;
  292.     UINT32 m_ulNoRootLayoutHeight;
  293.     UINT32 m_ulNoRootLayoutWidth;
  294.     BOOL                                isRootLayoutWidthSet() const  { return m_bRootLayoutWidthSet;  }
  295.     BOOL                                isRootLayoutHeightSet() const { return m_bRootLayoutHeightSet; }
  296.     friend class CSmil1Renderer;
  297. private:
  298.     HX_RESULT addSiteForRenderer (SMIL1PlayToAssoc* pPlayToAssoc,
  299. SMIL1SourceInfo* pSMIL1SourceInfo,
  300. IHXRenderer* pRenderer,
  301. BOOL bNoRegion);
  302.     void setPlayToAssoc (UINT16 uGroupIndex, 
  303. UINT16 uTrackIndex, 
  304. const char* pID,
  305. const char* pRepeatID, // /For SHAZAM
  306. const char* pPlayTo,
  307. const char* pRegionName);
  308.     SMIL1PlayToAssoc* getPlayToAssoc (UINT16 uGroupIndex, 
  309. UINT16 uTrackIndex);
  310.     SMIL1PlayToAssoc* getPlayToAssoc (const char* pName); 
  311.     void removeAllPlayToAssoc ();
  312.     void removeGroupsPlayToAssoc (UINT16 uGroupIndex);
  313.     void removeSourcemap (SMIL1PlayToAssoc* pPlayToAssoc);
  314.     HX_RESULT insertEvent (CSmil1ShowSiteEvent* pEvent);
  315.     CSmil1ShowSiteEvent* getShowHideEvent(IHXSite* pRegionSite,
  316.   IHXSite* pRendererSite,
  317.                                           BOOL     bShowEvent);
  318.     HX_RESULT insertSiteInfo (void* pInfo);
  319.     void removeGroupEvents (UINT16 uGroupIndex);
  320.     void showSite (IHXSite* pSite, 
  321. BOOL bShow);
  322.     void resizeSite (HXxSize newSize);
  323.     void resizeSite (IHXSite* pSite,
  324. double dXScale,
  325. double dYScale);
  326.     void resizeRegionSiteAbs(CSmil1BasicRegion* pRegion,
  327.                              double            dXAbsScale,
  328.                              double            dYAbsScale);
  329.     BOOL draw (HXxEvent* pEvent,
  330. IHXSite* pSite,
  331. HXxColor ulBgColor);
  332.     void insertZOrder (IHXSite* pSite, 
  333. INT32 lZOrder);
  334.     void setZOrder ();
  335.     HX_RESULT handleElements ();
  336.     void setProperty (IHXValues* pValues, 
  337. const char* pName, 
  338. const char* pValue);
  339.     HX_RESULT parseDimension (const char* pDimensionString,
  340. REF(UINT32) ulValue,
  341. REF(BOOL) bIsPercent);
  342.     HX_RESULT regionToRect (CSmil1Region* pElement,
  343. HXxRect* pRect,
  344. BOOL& bWidthUnspecified,
  345. BOOL& bHeightUnspecified);
  346.     CSmil1AAnchorElement*
  347. findHyperlinkElement (const char* pID,
  348. UINT16 uXPos,
  349. UINT16 uYPos);
  350.     HX_RESULT convertURL (const char* pURL,
  351. CHXString& newURL);
  352.     HX_RESULT updateStreamTiming (const char* pElementID,
  353. UINT32 ulDuration);
  354.     HX_RESULT updateStreamDelay (UINT16 uGroupIndex,
  355. UINT32 ulDelay);
  356.     HX_RESULT updateSiteEvents (UINT16 uGroupIndex);
  357.     HX_RESULT createRegionSites ();
  358.     void      RemoveEvents (UINT32 ulGroupIndex, IHXSite* pSite);
  359.     HX_RESULT flushAllEvents (UINT32 ulFlushToTime, BOOL bBreak=FALSE );
  360.     inline HX_RESULT flushAllEvents () { return flushAllEvents( m_ulCurrentTime ); }
  361.     BOOL      IsFullScreen();
  362.     void      computeMediaFitSize(HXxSize cRegSize, HXxSize cMedSize,
  363.                                   const char* pszFitAttr, REF(HXxSize) rcFitSize);
  364.     HX_RESULT getPreference(IUnknown*        pContext,
  365.                             const char*      pszKey,
  366.                             REF(IHXBuffer*) rpValue);
  367.     HX_RESULT getBooleanPreference(IUnknown*   pContext, 
  368.                                    const char* pszKey,
  369.                                    REF(BOOL)   rbValue);
  370. #if defined(_UNIX) && (!(defined(_BEOS))) && (!(defined(_MAC_UNIX)))
  371.     void ConvertPNxColorToXColor(HXxColor hxxColor, XColor& xcolor);
  372.     XData* InitXVisualSupport(IHXSite* pSite, HXxWindow* pWnd);
  373. #endif
  374.     CSmil1Renderer* m_pParent;
  375.     CSmil1Parser* m_pSmilParser;
  376.     HX_RESULT m_ulParseResult;
  377.     IHXSite* m_pMISUSSite;
  378.     IHXScheduler* m_pScheduler;
  379. public:
  380.     HXxSize m_topSiteSize;
  381.     HXxSize m_topSiteOriginalSize;
  382. private:
  383.     IHXValues* m_pValues;
  384.     char* m_pFragment;
  385.     CHXMapStringToOb* m_pRegionMap;
  386.     CHXMapPtrToPtr* m_pSiteInfoByRendererMap;
  387.     CHXMapPtrToPtr* m_pSiteWatcherMap;
  388.     CHXMapLongToObj* m_pGroupInfoMap;
  389.     CHXMapLongToObj* m_pGroupMap;
  390.     CHXMapStringToOb* m_pDeferredSourceMap;
  391.     CHXMapStringToOb* m_pRepeatIDMap;
  392.     CHXSimpleList* m_pSiteInfoList;
  393.     CHXSimpleList* m_pPlayToAssocList;
  394.     CHXSimpleList* m_pEventList;
  395.     CHXSimpleList* m_pZOrderList;
  396.     LISTPOSITION m_ulEventListPosition;
  397.     INT16 m_uCurrentGroupIndex;
  398.     INT16 m_nFragmentTracks;
  399.     UINT32 m_ulCurrentTime;
  400.     LONG32 m_lRefCount;
  401.     IUnknown* m_pContext;
  402.     IHXSiteManager* m_pSiteMgr;
  403.     IHXStatusMessage* m_pStatusMessage;
  404.     BOOL m_bFirstTimeSync;
  405.     BOOL m_bSettingFragment;
  406.     BOOL m_bInHyperlink;
  407.     BOOL m_bShowDependencies;
  408.     BOOL m_bSiteLayoutComplete;
  409.     BOOL m_bStatusMessageSet;
  410.     double m_dResizeXScale;
  411.     double m_dResizeYScale;
  412.     UINT32                              m_ulPktnum;
  413.     UINT16                              m_usOldXPos;
  414.     UINT16                              m_usOldYPos;
  415.     ProcessElementCallback* m_pProcessElementCallback;
  416. #ifdef _WINDOWS
  417.     HCURSOR  m_hHyperlinkCursor;
  418.     HCURSOR m_hPreHyperlinkCursor;
  419.     BOOL m_bNeedToSetHyperlinkCursor;
  420. #endif
  421. #if defined(_MACINTOSH) || defined(_MAC_UNIX)
  422.     BOOL m_bResetCursor;
  423.     CursHandle m_hHyperlinkCursor;
  424.     CResourceLoader* m_pResourceLoader;
  425. #endif
  426. #if defined(_UNIX) && (!(defined(_BEOS))) && (!(defined(_MAC_UNIX)))
  427.     // needed for background drawing
  428.     XVisualInfo*                        m_pVisualInfo;
  429.     Cursor                              m_hHyperlinkCursor;
  430.     Cursor                              m_hCurrentCursor;
  431.     Display*                            m_pDisplay;          
  432.     Window                              m_Window;
  433.     Display*                            m_pPixmapDisplay;
  434.     CHXMapPtrToPtr                      m_siteToXDataMap;
  435. #endif
  436.     BOOL m_bRootLayoutWidthSet;
  437.     BOOL m_bRootLayoutHeightSet;
  438.     UINT32 m_ulRootLayoutHeight;
  439.     UINT32 m_ulRootLayoutWidth;
  440.     HXxColor m_ulRootLayoutBGColor;
  441.     UINT32     m_ulGroupIndex;
  442.     UINT32     m_ulTrackIndex;
  443.     UINT16     m_uGroupIndexWithin;
  444.     BOOL     m_bSitesDetached;
  445.     BOOL     m_bInRAM20;
  446.     BOOL     m_bLastGroupInRAM20;
  447.     INT32     m_ulPersistentComponentDelay;
  448.     UINT32     m_ulPersistentComponentID;
  449.     UINT16     m_uPersistentGroupID;
  450.     UINT16     m_uPersistentTrackID;
  451.     ElementWithinTag     m_elementWithinTag;
  452.     IHXValues*     m_pPersistentProperties;
  453.     IHXPersistentRenderer* m_pPersistentParentRenderer;
  454.     BOOL                    m_bCloseCalled;
  455.     HX_RESULT     InitPersistent(UINT32     ulPersistentComponentID,
  456.    UINT16     uPersistentGroupID,
  457.    UINT16     uPersistentTrackID,
  458.    IHXPersistentRenderer*  pPersistentParent);
  459.     HX_RESULT     setupRootLayout();
  460.     BOOL     IsNestedMetaSupported(UINT16& uSupportedType);
  461.     void     PersistentDurationSet(UINT32 ulDuration, UINT32 ulDelay, BOOL bIsLive);
  462. };
  463. class CSmil1SiteWatcher: public CHXBaseCountingObject,
  464.                          public IHXSiteWatcher
  465. {
  466. public:
  467.     CSmil1SiteWatcher     (CSmil1DocumentRenderer* pDoc, 
  468.     const char* pID,
  469.     BOOL bIsChildSite);
  470.     ~CSmil1SiteWatcher     ();
  471.     HX_RESULT close     ();
  472.     IHXSite*     GetSite() { return m_pSite; }
  473.     void     SiteChangingSize(BOOL bFlag) { m_bChangingSize = bFlag; }
  474.     /*
  475.      * IUnknown methods
  476.      */
  477.     STDMETHOD(QueryInterface)     (THIS_
  478.     REFIID riid,
  479.     void** ppvObj);
  480.     STDMETHOD_(ULONG32, AddRef)     (THIS);
  481.     STDMETHOD_(ULONG32, Release)    (THIS);
  482.     /*
  483.      * IHXSiteWatcher methods
  484.      */
  485.     STDMETHOD(AttachSite)     (THIS_
  486.     IHXSite* pSite);
  487.     STDMETHOD(DetachSite)     (THIS);
  488.     
  489.     STDMETHOD(ChangingPosition)     (THIS_
  490.     HXxPoint posOld,
  491.     REF(HXxPoint) posNew);
  492.     STDMETHOD(ChangingSize)     (THIS_
  493.     HXxSize sizeOld,
  494.     REF(HXxSize) posNew);
  495. private:
  496.     CHXString          m_id;
  497.     CSmil1DocumentRenderer*       m_pDoc;
  498.     IHXSite*          m_pSite;
  499.     BOOL     m_bIsChildSite;
  500.     BOOL     m_bChangingSize;
  501.     LONG32          m_lRefCount;
  502.     BOOL                            m_bFirstSetSize;
  503. };
  504. class CSmil1EventHook: public CHXBaseCountingObject,
  505.                        public IHXEventHook
  506. {
  507. public:
  508.     CSmil1EventHook     (CSmil1DocumentRenderer* pDoc,
  509.     const char* pRegionName,
  510.     const char* pChannelName,
  511.     BOOL bNoRegion);
  512.     virtual ~CSmil1EventHook     ();
  513.     /*
  514.      * IUnknown methods
  515.      */
  516.     STDMETHOD(QueryInterface)     (THIS_
  517.     REFIID riid,
  518.     void** ppvObj);
  519.     STDMETHOD_(ULONG32, AddRef)     (THIS);
  520.     STDMETHOD_(ULONG32, Release)    (THIS);
  521.     /*
  522.      * IHXEventHook methods
  523.      */
  524.     STDMETHOD(HandleEvent)     (IHXSite* pSite,
  525.     HXxEvent* pEvent);
  526.     STDMETHOD(SiteAdded)     (IHXSite* pSite);
  527.     STDMETHOD(SiteRemoved)     (IHXSite* pSite);
  528.     
  529.     char*     m_pChannelName;
  530. private:
  531.     CSmil1DocumentRenderer*     m_pDoc;
  532.     char*     m_pRegionName;
  533.     IHXSite*     m_pSite;
  534.     BOOL     m_bNoRegion;
  535.     CSmil1PassiveSiteWatcher*     m_pSiteWatcher;
  536.     LONG32     m_lRefCount;
  537. };
  538. class CSmil1PassiveSiteWatcher: public CHXBaseCountingObject,
  539.                                 public IHXPassiveSiteWatcher
  540. {
  541. public:
  542.     CSmil1PassiveSiteWatcher     (CSmil1DocumentRenderer* pDoc,
  543.     const char* pRegionName);
  544.     ~CSmil1PassiveSiteWatcher     ();
  545.     /*
  546.      * IUnknown methods
  547.      */
  548.     STDMETHOD(QueryInterface)     (THIS_
  549.     REFIID riid,
  550.     void** ppvObj);
  551.     STDMETHOD_(ULONG32, AddRef)     (THIS);
  552.     STDMETHOD_(ULONG32, Release)    (THIS);
  553.     /*
  554.      * IHXPassiveSiteWatcher methods
  555.      */
  556.     STDMETHOD(PositionChanged)     (THIS_
  557.     HXxPoint* pPoint);
  558.     STDMETHOD(SizeChanged)     (THIS_
  559.     HXxSize* pSize);
  560. private:
  561.     LONG32     m_lRefCount;
  562.     CSmil1DocumentRenderer*     m_pDoc;
  563.     char*     m_pRegionName;
  564. };
  565. class CSmil1SiteUser: public CHXBaseCountingObject,
  566.                       public IHXSiteUser
  567. {
  568. public:
  569.     CSmil1SiteUser     (CSmil1DocumentRenderer* pDoc,
  570.     HXxColor ulBGColor);
  571.     ~CSmil1SiteUser     ();
  572.     /*
  573.      * IUnknown methods
  574.      */
  575.     STDMETHOD(QueryInterface)     (THIS_
  576.     REFIID riid,
  577.     void** ppvObj);
  578.     STDMETHOD_(ULONG32, AddRef)     (THIS);
  579.     STDMETHOD_(ULONG32, Release)    (THIS);
  580.     /*
  581.      * IHXSiteUser methods
  582.      */
  583.     STDMETHOD(AttachSite)     (THIS_
  584.     IHXSite* pSite);
  585.     STDMETHOD(DetachSite)     (THIS);
  586.     STDMETHOD(HandleEvent)     (THIS_
  587.     HXxEvent* pEvent);
  588.     STDMETHOD_(BOOL,NeedsWindowedSites) (THIS);
  589. private:
  590.     LONG32     m_lRefCount;
  591.     HXxColor     m_ulBGColor;
  592.     CSmil1DocumentRenderer*     m_pDoc;
  593.     IHXSite*     m_pSite;
  594. };
  595. /*
  596.  * CSmil1BasicRegion methods
  597.  */
  598. class CSmil1BasicRegion : public CHXBaseCountingObject
  599. {
  600. public:
  601.     CSmil1BasicRegion     (const char* pName, 
  602.     HXxRect rect, 
  603.     INT32 lZindex, 
  604.     const char* pFit, 
  605.     HXxColor ulBgColor,
  606.     BOOL bBgColorSet, 
  607.     BOOL bImplicitRegion,
  608.     BOOL bWidthUnspecified,
  609.     BOOL bHeightUnspecified);
  610.     ~CSmil1BasicRegion();
  611.     HXxRect m_rect;
  612.     HXxRect m_originalRect;
  613.     HXxSize m_mediaSize;
  614.     HXxSize m_originalMediaSize;
  615.     BOOL    m_bMediaSizeSet;
  616.     IHXSite* m_pSite;
  617.     IHXSiteUser* m_pSiteUser;
  618.     INT32 m_lZIndex;
  619.     CHXString m_region;
  620.     CHXString m_fit;
  621.     HXxColor m_ulBgColor;
  622.     BOOL m_bBgColorSet;
  623.     BOOL m_bImplicitRegion;
  624.     BOOL m_bWidthUnspecified;
  625.     BOOL m_bHeightUnspecified;
  626. };
  627. class ProcessElementCallback : public IHXCallback
  628. {
  629. public:
  630.     CHXString m_elementID;
  631.     CSmil1DocumentRenderer* m_pOwner;
  632.     CallbackHandle m_PendingHandle;
  633.     BOOL m_bIsCallbackPending;
  634. ProcessElementCallback();
  635.     /*
  636.      * IUnknown methods
  637.      */
  638.     STDMETHOD(QueryInterface) (THIS_
  639. REFIID riid,
  640. void** ppvObj);
  641.     STDMETHOD_(ULONG32,AddRef) (THIS);
  642.     STDMETHOD_(ULONG32,Release) (THIS);
  643.     /*
  644.      * IHXCallback methods
  645.      */
  646.     STDMETHOD(Func) (THIS);
  647. protected:
  648. ~ProcessElementCallback();
  649.     LONG32 m_lRefCount;
  650. };
  651. #endif /* _SM1DOC_H_ */