home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / cxstubs.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  17.1 KB  |  633 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #include "stdafx.h"
  20.  
  21. #include "cxstubs.h"
  22. #ifdef MOZ_MAIL_NEWS
  23. #include "mailpriv.h"
  24. #endif
  25. #include "timer.h"
  26. #include "dialog.h"
  27.  
  28. CStubsCX::CStubsCX()    {
  29. //    Purpose:    Create a CStubCX
  30. //    Arguments:  void
  31. //    Returns:    none
  32. //    Comments:   Really of no use, just set the context type.
  33. //    Revision History:
  34. //      05-01-95    created GAB
  35. //
  36.  
  37.     m_cxType = Stubs;
  38.     m_pOuterUnk = NULL;
  39.     m_ulRefCount = 1; // Never auto delete
  40. }
  41.  
  42. //    Purpose:    Create a CStubCX
  43. //    Arguments:  void
  44. //    Returns:    none
  45. //    Comments:   Really of no use, just set the context type.
  46. //    Revision History:
  47. //      05-01-95    created GABby
  48. //
  49. CStubsCX::CStubsCX(ContextType ctMyType, MWContextType XPType)
  50. {
  51.     m_cxType = ctMyType;
  52.     GetContext()->type = XPType;
  53.     m_pOuterUnk = NULL;
  54.     m_ulRefCount = 1; // Never auto delete
  55. }
  56.  
  57. CStubsCX::CStubsCX( LPUNKNOWN pOuterUnk )    {
  58. //    Purpose:    Create a CStubCX
  59. //    Arguments:  void
  60. //    Returns:    none
  61. //    Comments:   Really of no use, just set the context type.
  62. //    Revision History:
  63. //      05-01-95    created GAB
  64. //
  65.     m_pOuterUnk = pOuterUnk;
  66.     m_ulRefCount = 0;
  67.  
  68.     m_cxType = Stubs;
  69. }
  70.  
  71. //    Purpose:    Create a CStubCX
  72. //    Arguments:  void
  73. //    Returns:    none
  74. //    Comments:   Really of no use, just set the context type.
  75. //    Revision History:
  76. //      05-01-95    created GABby
  77. //
  78. CStubsCX::CStubsCX( LPUNKNOWN pOuterUnk, ContextType ctMyType, MWContextType XPType)
  79. {
  80.     m_pOuterUnk = pOuterUnk;
  81.     m_ulRefCount = 0;
  82.  
  83.     m_cxType = ctMyType;
  84.     GetContext()->type = XPType;
  85. }
  86.  
  87. //    Purpose:    Release outer unknown
  88. //    Arguments:  void
  89. //    Returns:    none
  90. //    Comments:
  91. //    Revision History:
  92. //      05-01-95    created GAB
  93. //
  94. CStubsCX::~CStubsCX()   {
  95. }
  96.  
  97.  
  98. //
  99. // Utility to parse a URL and return the domain part.
  100. //
  101. // e.g., IN:   http://www.netscape.com/comprod/netscape_products.html 
  102. //       OUT:  www.netscape.com
  103. //
  104. static BOOL GetDomainFromURL( const char *pszURL, char *pszDomain )
  105. {
  106.     if( !pszURL || !*pszURL || !pszDomain )
  107.     {
  108.         return FALSE;
  109.     }
  110.     
  111.     char szProtocolDelimiter[] = _T("://");
  112.     
  113.     char *pszCsr = _tcsstr( pszURL, szProtocolDelimiter );
  114.     if( !pszCsr )
  115.     {
  116.         return FALSE;
  117.     }
  118.     
  119.     pszCsr += _tcslen( szProtocolDelimiter );
  120.     if( !*pszCsr )
  121.     {
  122.         return FALSE;
  123.     }
  124.     
  125.     char *pszCsrEnd = _tcschr( pszCsr, '/' );
  126.     
  127.     USHORT uLen = pszCsrEnd ? (pszCsrEnd - pszCsr) : _tcslen( pszCsr );
  128.     
  129.     _tcsncpy( pszDomain, pszCsr, uLen );
  130.     pszDomain[uLen] = 0;
  131.     
  132.     return TRUE;
  133. }
  134.  
  135. void MakeSecureTitle( CAbstractCX *pCX, CString &csTitle )
  136. {
  137.     if( !pCX )
  138.     {
  139.         return;
  140.     }
  141.     
  142.     char szDomain[1024];
  143.     *szDomain = 0;
  144.     URL_Struct *pURL = pCX->CreateUrlFromHist();
  145.     if( pURL )
  146.     {
  147.         GetDomainFromURL( pURL->address, szDomain );
  148.         NET_FreeURLStruct( pURL );
  149.     }
  150.     
  151.     csTitle = _T("");
  152.     if( *szDomain )
  153.     {
  154.         csTitle = szDomain;
  155.         csTitle += _T(" - ");
  156.     }
  157.     csTitle += szLoadString( IDS_JSAPP );
  158. }
  159.  
  160. //  Below are all the stubs of the class.
  161. //  They are completely empty, some returning some default values which
  162. //      can change if need be.
  163. //  If you need special functionality in your higher level class, then
  164. //      override these functions in that class, and leave these functions be!
  165. //  05-01-95    created GAB
  166.  
  167. void CStubsCX::Alert(MWContext *pContext, const char *pMessage)    {
  168.     //    We need to bring up an alert box.
  169.     //    Override if this isn't what you need.
  170. #ifdef XP_WIN16
  171.     if(sysInfo.IsWin4() == FALSE)   {
  172.         //  On win16 (under 3.1), enourmous strings cause thrashing of the heap
  173.         //      when combined with MessageBox.
  174.         //  See what we can do....
  175.     }
  176. #endif
  177.  
  178.     theApp.m_splash.SafeHide();
  179.  
  180.     CWnd * pWnd = GetDialogOwner();
  181.  
  182. #ifdef MOZ_MAIL_NEWS
  183.     //  WM_REQUESTPARENT is mailpriv.h only
  184.     if (!pWnd->IsWindowVisible())
  185.     {
  186.        CWnd * pParent = (CWnd *)pWnd->SendMessage(WM_REQUESTPARENT);
  187.        if (pParent)
  188.            pWnd = pParent;
  189.     }
  190. #endif // MOZ_MAIL_NEWS
  191.     
  192.     CString csTitle = _T("");
  193.     if( pContext && pContext->bJavaScriptCalling )
  194.     {
  195.         MakeSecureTitle( this, csTitle );
  196.     }
  197.     else
  198.     {
  199.         csTitle = szLoadString( AFX_IDS_APP_TITLE );        
  200.     }
  201.     pWnd->MessageBox( pMessage, (LPCSTR)csTitle, MB_TASKMODAL | MB_ICONEXCLAMATION | MB_OK );
  202. }
  203.  
  204. STDMETHODIMP CStubsCX::QueryInterface(REFIID refiid, LPVOID * ppv)
  205. {
  206.     *ppv = NULL;
  207.     if (IsEqualIID(refiid,IID_IUnknown))
  208.            *ppv = (LPUNKNOWN) this;
  209.     else if (IsEqualIID(refiid,IID_IMWContext))
  210.            *ppv = (LPMWCONTEXT) this;
  211.     else if (m_pOuterUnk) 
  212.         return m_pOuterUnk->QueryInterface( refiid, ppv );
  213.  
  214.     if (*ppv != NULL) {
  215.            ((LPUNKNOWN) *ppv)->AddRef();
  216.         return NOERROR;
  217.     }
  218.             
  219.     return ResultFromScode(E_NOINTERFACE);
  220. }
  221.  
  222. STDMETHODIMP_(ULONG) CStubsCX::AddRef(void)
  223. {
  224.     if (m_pOuterUnk) 
  225.         m_pOuterUnk->AddRef();
  226.     return ++m_ulRefCount;
  227. }
  228.  
  229. STDMETHODIMP_(ULONG) CStubsCX::Release(void)
  230. {
  231.     ULONG ulRef;
  232.     if (m_pOuterUnk) 
  233.         m_pOuterUnk->Release();
  234.     ulRef = --m_ulRefCount;
  235.     if (m_ulRefCount == 0) {
  236.         ApiApiPtr(api);
  237.         api->RemoveInstance(this);
  238.         delete this;       
  239.     }
  240.     return ulRef;       
  241. }
  242.  
  243. void CStubsCX::AllConnectionsComplete(MWContext *pContext)    {
  244. }
  245.  
  246. void CStubsCX::UpdateStopState(MWContext *pContext) {
  247. }
  248.  
  249. void CStubsCX::BeginPreSection(MWContext *pContext)    {
  250. }
  251.  
  252. void CStubsCX::ClearCallNetlibAllTheTime(MWContext *pContext)    {
  253. }
  254.  
  255. void CStubsCX::ClearView(MWContext *pContext, int iView)    {
  256. }
  257.  
  258. XP_Bool CStubsCX::Confirm(MWContext *pContext, const char *pConfirmMessage)    {
  259.     //    We need to ask for confirmation from the user.
  260.     //    Override if this isn't what you need.
  261.     
  262.     CString csTitle = _T("");
  263.     if( pContext && pContext->bJavaScriptCalling )
  264.     {
  265.         MakeSecureTitle( this, csTitle );
  266.     }
  267.     else
  268.     {
  269.         csTitle = szLoadString( AFX_IDS_APP_TITLE );        
  270.     }
  271.     
  272.     int iStatus = GetDialogOwner()->MessageBox( pConfirmMessage, (LPCSTR)csTitle, MB_ICONQUESTION | MB_OKCANCEL );
  273.     return(iStatus == IDOK);
  274. }
  275.  
  276. MWContext *CStubsCX::CreateNewDocWindow(MWContext *pContext, URL_Struct *pURL)    {
  277.     return(NULL);
  278. }
  279.  
  280. void CStubsCX::DisplayBullet(MWContext *pContext, int iLocation, LO_BullettStruct *pBullet)    {
  281. }
  282.  
  283. void CStubsCX::DisplayEdge(MWContext *pContext, int iLocation, LO_EdgeStruct *pEdge)    {
  284. }
  285.  
  286. void CStubsCX::DisplayEmbed(MWContext *pContext, int iLocation, LO_EmbedStruct *pEmbed)    {
  287. }
  288.  
  289. void CStubsCX::DisplayFormElement(MWContext *pContext, int iLocation, LO_FormElementStruct *pFormElement)    {
  290. }
  291.  
  292. void CStubsCX::DisplayBorder(MWContext *pContext, int iLocation, int x, int y, int width, int height, int bw, LO_Color *color, LO_LineStyle style)    {
  293. }
  294.  
  295. void CStubsCX::DisplayFeedback(MWContext *pContext, int iLocation, LO_Element *pElement)    {
  296. }
  297.  
  298. void CStubsCX::DisplayHR(MWContext *pContext, int iLocation, LO_HorizRuleStruct *pHorizRule)    {
  299. }
  300.  
  301. void CStubsCX::DisplayLineFeed(MWContext *pContext, int iLocation, LO_LinefeedStruct *pLineFeed, XP_Bool clear)    {
  302. }
  303.  
  304. void CStubsCX::DisplaySubDoc(MWContext *pContext, int iLocation, LO_SubDocStruct *pSubDoc)    {
  305. }
  306.  
  307. void CStubsCX::DisplayCell(MWContext *pContext, int iLocation, LO_CellStruct *pCell)    {
  308. }
  309.  
  310. void CStubsCX::DisplaySubtext(MWContext *pContext, int iLocation, LO_TextStruct *pText, int32 lStartPos, int32 lEndPos, XP_Bool clear)    {
  311. }
  312.  
  313. void CStubsCX::DisplayTable(MWContext *pContext, int iLocation, LO_TableStruct *pTable)    {
  314. }
  315.  
  316. void CStubsCX::DisplayText(MWContext *pContext, int iLocation, LO_TextStruct *pText, XP_Bool clear)   {
  317. }
  318.  
  319. void CStubsCX::EraseBackground(MWContext *pContext, int iLocation, int32 x, int32 y, uint32 width, uint32 height, LO_Color *pColor)   {
  320. }
  321.  
  322. void CStubsCX::SetDrawable(MWContext *pContext, CL_Drawable *drawable)
  323. {
  324. }
  325.  
  326. void CStubsCX::EnableClicking(MWContext *pContext)    {
  327. }
  328.  
  329. void CStubsCX::EndPreSection(MWContext *pContext)    {
  330. }
  331.  
  332. int CStubsCX::FileSortMethod(MWContext *pContext)    {
  333.     return(pContext->fileSort);
  334. }
  335.  
  336. void CStubsCX::FinishedLayout(MWContext *pContext)    {
  337. }
  338.  
  339. void CStubsCX::FormTextIsSubmit(MWContext *pContext, LO_FormElementStruct *pFormElement)    {
  340. }
  341.  
  342. void CStubsCX::FreeEdgeElement(MWContext *pContext, LO_EdgeStruct *pEdge)    {
  343. }
  344.  
  345. void CStubsCX::CreateEmbedWindow(MWContext *pContext, NPEmbeddedApp *pApp) {
  346. }
  347.  
  348. void CStubsCX::SaveEmbedWindow(MWContext *pContext, NPEmbeddedApp *pApp) {
  349. }
  350.  
  351. void CStubsCX::RestoreEmbedWindow(MWContext *pContext, NPEmbeddedApp *pApp) {
  352. }
  353.  
  354. void CStubsCX::DestroyEmbedWindow(MWContext *pContext, NPEmbeddedApp *pApp) {
  355. }
  356.  
  357. void CStubsCX::FreeEmbedElement(MWContext *pContext, LO_EmbedStruct *pEmbed)    {
  358. }
  359.  
  360. void CStubsCX::GetEmbedSize(MWContext *pContext, LO_EmbedStruct *pEmbed, NET_ReloadMethod Reload)    {
  361. }
  362.  
  363. void CStubsCX::GetFormElementInfo(MWContext *pContext, LO_FormElementStruct *pFormElement)    {
  364. }
  365.  
  366. void CStubsCX::GetFormElementValue(MWContext *pContext, LO_FormElementStruct *pFormElement, XP_Bool bHidden)    {
  367. }
  368.  
  369. void CStubsCX::GetTextFrame(MWContext *pContext, LO_TextStruct *pText,
  370.              int32 start, int32 end, XP_Rect *frame)     {
  371. }
  372.  
  373. int CStubsCX::GetTextInfo(MWContext *pContext, LO_TextStruct *pText, LO_TextInfo *pTextInfo)    {
  374.     return(0);
  375. }
  376.  
  377. void CStubsCX::GraphProgress(MWContext *pContext, URL_Struct *pURL, int32 lBytesReceived, int32 lBytesSinceLastTime, int32 lContentLength)    {
  378. }
  379.  
  380. void CStubsCX::GraphProgressDestroy(MWContext *pContext, URL_Struct *pURL, int32 lContentLength, int32 lTotalBytesRead)    {
  381. }
  382.  
  383. void CStubsCX::GraphProgressInit(MWContext *pContext, URL_Struct *pURL, int32 lContentLength)    {
  384. }
  385.  
  386. void CStubsCX::LayoutNewDocument(MWContext *pContext, URL_Struct *pURL, int32 *pWidth, int32 *pHeight, int32 *pmWidth, int32 *pmHeight)    {
  387. }
  388.  
  389. void CStubsCX::Progress(MWContext *pContext, const char *pMessage)    {
  390. }
  391.  
  392. char *CStubsCX::Prompt(MWContext *pContext, const char *pPrompt, const char *pDefault)    {
  393.     //    We need to prompt the user for their username.
  394.     //    If this isn't what you need, override.
  395.     CDialogPRMT dlgPrompt(GetDialogOwner());
  396.  
  397.     if( pContext && pContext->bJavaScriptCalling )
  398.     {
  399.         CString csTitle = _T("");    
  400.         MakeSecureTitle( this, csTitle );
  401.         dlgPrompt.SetSecureTitle( csTitle );        
  402.     }
  403.     
  404.     theApp.m_splash.SafeHide();
  405.  
  406.     return(dlgPrompt.DoModal(pPrompt, pDefault));
  407. }
  408.  
  409. char *CStubsCX::PromptWithCaption(MWContext *pContext, const char *pCaption, const char *pPrompt, const char *pDefault)    {
  410.  
  411.     CDialogPRMT dlgPrompt(GetDialogOwner());
  412.  
  413.     theApp.m_splash.SafeHide();
  414.     
  415.     return dlgPrompt.DoModal(pPrompt, pDefault, pCaption);
  416. }
  417.  
  418. char *CStubsCX::PromptPassword(MWContext *pContext, const char *pMessage)    {
  419.     //    We need to prompt the user for their password.
  420.     //    If this isn't what you need, override.
  421.     CDialogPASS dlgPass(GetDialogOwner());
  422.     
  423.     if( pContext && pContext->bJavaScriptCalling )
  424.     {
  425.         CString csTitle = _T("");    
  426.         MakeSecureTitle( this, csTitle );
  427.         dlgPass.SetSecureTitle( csTitle );        
  428.     }
  429.     
  430.     theApp.m_splash.SafeHide();
  431.  
  432.     return(dlgPass.DoModal(pMessage));
  433. }
  434.  
  435. XP_Bool CStubsCX::PromptUsernameAndPassword(MWContext *pContext, const char *pMessage, char **ppUsername, char **ppPassword)    {
  436.     //    We need to prompt the user for their password and username.
  437.     //    If this isn't what you need, override.
  438.     int iStatus;
  439.  
  440.     CDialogUPass dlgUPass(GetDialogOwner());
  441.     
  442.     CString csTitle = _T("");
  443.     if( pContext && pContext->bJavaScriptCalling )
  444.     {
  445.         CString csTitle = _T("");    
  446.         MakeSecureTitle( this, csTitle );
  447.         dlgUPass.SetSecureTitle( csTitle );        
  448.     }
  449.     
  450.     theApp.m_splash.SafeHide();
  451.  
  452.     iStatus = dlgUPass.DoModal((char *) pMessage, ppUsername, ppPassword);
  453.     
  454.     return(iStatus == IDOK);
  455. }
  456.  
  457. void CStubsCX::ResetFormElement(MWContext *pContext, LO_FormElementStruct *pFormElement)    {
  458. }
  459.  
  460. void CStubsCX::SetBackgroundColor(MWContext *pContext, uint8 cRed, uint8 cGreen, uint8 cBlue)    {
  461. }
  462.  
  463. void CStubsCX::SetCallNetlibAllTheTime(MWContext *pContext)    {
  464. }
  465.  
  466. void CStubsCX::SetDocDimension(MWContext *pContext, int iLocation, int32 lWidth, int32 lLength)    {
  467. }
  468.  
  469. void CStubsCX::SetDocPosition(MWContext *pContext, int iLocation, int32 lX, int32 lY)    {
  470. }
  471.  
  472. void CStubsCX::SetDocTitle(MWContext *pContext, char *pTitle)    {
  473. }
  474.  
  475. void CStubsCX::SetFormElementToggle(MWContext *pContext, LO_FormElementStruct *pFormElement, XP_Bool bToggle)    {
  476. }
  477.  
  478. void CStubsCX::SetProgressBarPercent(MWContext *pContext, int32 lPercent)    {
  479. }
  480.  
  481. XP_Bool CStubsCX::ShowAllNewsArticles(MWContext *pContext)    {
  482.     return(FALSE);
  483. }
  484.  
  485. char *CStubsCX::TranslateISOText(MWContext *pContext, int iCharset, char *pISOText)    {
  486.     return(pISOText);
  487. }
  488.  
  489. XP_Bool CStubsCX::UseFancyFTP(MWContext *pContext)    {
  490.     //    Go off the context settings.
  491.     //    If this isnt' wanted, override.
  492.     return(pContext->fancyFTP);
  493. }
  494.  
  495. XP_Bool CStubsCX::UseFancyNewsgroupListing(MWContext *pContext)    {
  496.     //    Go off the applications settings.
  497.     //    If this isn't wanted, override.
  498. //    return(!strcmp(theApp.m_pFancyNews->GetCharValue(), "yes"));
  499.     // I don't think this is used anymore! -- jonm 1/2/97
  500.     return TRUE;
  501. }
  502.  
  503. void CStubsCX::GetJavaAppSize(MWContext *pContext, LO_JavaAppStruct *pJava, NET_ReloadMethod Reload)    {
  504. }
  505.  
  506. void CStubsCX::DisplayJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct *pJava)    
  507. {
  508. }
  509.  
  510. void CStubsCX::FreeJavaAppElement(MWContext *pContext, LJAppletData *appletD)
  511. {
  512. }
  513. void CStubsCX::HideJavaAppElement(MWContext *pContext, 
  514.                                LJAppletData *java_struct)
  515. {
  516. }
  517. void CStubsCX::GetDocPosition(MWContext * pContext, int iLoc, int32 * pX, int32 * pY)  
  518. {
  519. }
  520.  
  521. /* java specific functions to allow delayed window creation and transparency */
  522. void CStubsCX::HandleClippingView(MWContext *pContext, LJAppletData *appletD, int x, int y, int width, int height)
  523. {
  524. }
  525. void CStubsCX::DrawJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct *pJava)
  526. {
  527. }
  528.  
  529. //  URL Exit Routines
  530. void CStubsCX::GetUrlExitRoutine(URL_Struct *pUrl, int iStatus, MWContext *pContext)    {
  531. }
  532.  
  533. void CStubsCX::TextTranslationExitRoutine(PrintSetup *pTextFE)  {
  534. }
  535.  
  536. CFrameCX::CFrameCX(ContextType ctMyType, CFrameGlue *pFrame)    
  537. {
  538.     m_pFrame = pFrame;
  539.     m_cxType = ctMyType;
  540.     //    No old progress;
  541.     m_lOldPercent = 0;
  542. }
  543.  
  544. CFrameCX::~CFrameCX()
  545. {
  546. }
  547.  
  548. void CFrameCX::SetProgressBarPercent(MWContext *pContext, int32 lPercent)    {
  549.     //    Enusre the safety of the value.
  550.     if(lPercent < -1)    {
  551.         lPercent = 0;
  552.     }
  553.     if(lPercent > 100)    {
  554.         lPercent = 100;
  555.     }
  556.  
  557.     if(lPercent == 0 || m_lOldPercent == lPercent)    {
  558.         return;
  559.     }
  560.     m_lOldPercent = lPercent;
  561.     
  562.     LPNSSTATUSBAR pIStatusBar = NULL;
  563.     LPCHROME pChrome = GetFrame()->GetChrome();
  564.     if(pChrome) {
  565.         pChrome->QueryInterface( IID_INSStatusBar, (LPVOID *) &pIStatusBar );
  566.         if ( pIStatusBar ) {
  567.             pIStatusBar->SetProgress(CASTINT(lPercent));
  568.             pIStatusBar->Release();
  569.         }
  570.     }
  571. }
  572.  
  573. void CFrameCX::Progress(MWContext *pContext, const char *pMessage)    {
  574.     LPNSSTATUSBAR pIStatusBar = NULL;
  575.     LPCHROME pChrome = GetFrame()->GetChrome();
  576.     if(pChrome) {
  577.         pChrome->QueryInterface( IID_INSStatusBar, (LPVOID *) &pIStatusBar );
  578.         if ( pIStatusBar ) {
  579.             pIStatusBar->SetStatusText(pMessage);
  580.             pIStatusBar->Release();
  581.         }
  582.     }
  583. }
  584.  
  585. int32 CFrameCX::QueryProgressPercent()    {
  586.     return m_lOldPercent;
  587. }
  588.  
  589. void CFrameCX::StartAnimation()
  590. {
  591.     LPCHROME pChrome = GetFrame()->GetChrome();
  592.     if(pChrome) {
  593.         pChrome->StartAnimation();
  594.     }
  595. }
  596.  
  597. void CFrameCX::StopAnimation()
  598. {
  599.     LPCHROME pChrome = GetFrame()->GetChrome();
  600.     if(pChrome) {
  601.         pChrome->StopAnimation();
  602.     }
  603. }
  604.  
  605. void CFrameCX::AllConnectionsComplete(MWContext *pContext)    
  606. {
  607.     //  Call the base.
  608.     CStubsCX::AllConnectionsComplete(pContext);
  609.  
  610.     //    Stop our frame's animation, if the main context of the frame is no longer busy.
  611.     if(GetFrame()->GetMainContext()) {
  612.         if(XP_IsContextBusy(GetFrame()->GetMainContext()->GetContext()) == FALSE) {
  613.             //    Okay, stop the animation.
  614.             StopAnimation();
  615.  
  616.             //    Also, we can clear the progress bar now.
  617.             LPNSSTATUSBAR pIStatusBar = NULL;
  618.             LPCHROME pChrome = GetFrame()->GetChrome();
  619.             if(pChrome) {
  620.                 pChrome->QueryInterface( IID_INSStatusBar, (LPVOID *) &pIStatusBar );
  621.                 if ( pIStatusBar ) {
  622.                     pIStatusBar->SetProgress(0);
  623.                     pIStatusBar->Release();
  624.                 }
  625.             }
  626.         }
  627.     }
  628. }
  629.  
  630. CWnd *CFrameCX::GetDialogOwner() const {
  631.     return m_pFrame->GetFrameWnd();
  632. }
  633.