Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
CEditorFrame Class Reference

#include <EditorFrm.h>

Inheritance diagram for CEditorFrame:
Inheritance graph
[legend]
Collaboration diagram for CEditorFrame:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CEditorFrame (PRUint32 chromeMask)
virtual ~CEditorFrame ()
BOOL InitEditor ()
NS_METHOD MakeEditable ()
NS_METHOD DoCommand (const char *aCommand, nsICommandParams *aCommandParams)
NS_METHOD IsCommandEnabled (const char *aCommand, PRBool *retval)
NS_METHOD GetCommandState (const char *aCommand, nsICommandParams *aCommandParams)
void GetEditor (nsIEditor **editor)
void GetHTMLEditor (nsIHTMLEditor **htmlEditor)
BOOL InLink ()
void ShowInsertLinkDlg ()
void ShowEditLinkDlg ()
BOOL GetCurrentLinkInfo (CString &strLinkText, CString &strLinkLocation, nsIDOMHTMLAnchorElement **anchorElement)
void InsertLink (CString &linkText, CString &linkLocation)
void InsertHTML (CString &str)
CBrowserImplGetBrowserImpl ()
CBrowserImplGetBrowserImpl ()
BOOL CanCutUrlBarSelection ()
BOOL CanCutUrlBarSelection ()
void CutUrlBarSelToClipboard ()
void CutUrlBarSelToClipboard ()
BOOL CanCopyUrlBarSelection ()
BOOL CanCopyUrlBarSelection ()
void CopyUrlBarSelToClipboard ()
void CopyUrlBarSelToClipboard ()
BOOL CanPasteToUrlBar ()
BOOL CanPasteToUrlBar ()
void PasteFromClipboardToUrlBar ()
void PasteFromClipboardToUrlBar ()
BOOL CanUndoUrlBarEditOp ()
BOOL CanUndoUrlBarEditOp ()
void UndoUrlBarEditOp ()
void UndoUrlBarEditOp ()
void SetupFrameChrome ()
void SetupFrameChrome ()
virtual BOOL PreCreateWindow (CREATESTRUCT &cs)
virtual BOOL PreCreateWindow (CREATESTRUCT &cs)
virtual BOOL OnCmdMsg (UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo)
virtual BOOL OnCmdMsg (UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo)
void UpdateSecurityStatus (PRInt32 aState)
void ShowSecurityInfo ()
void SetEditable (BOOL isEditor)
BOOL GetEditable ()

Public Attributes

CToolBar m_wndToolBar
CStatusBar m_wndStatusBar
CMyStatusBar m_wndStatusBar
CProgressCtrl m_wndProgressBar
CUrlBar m_wndUrlBar
CReBar m_wndReBar
CBrowserToolTip m_wndTooltip
CBrowserView m_wndBrowserView
PRUint32 m_chromeMask

Protected Member Functions

afx_msg void OnBold ()
afx_msg void OnUpdateBold (CCmdUI *pCmdUI)
afx_msg void OnItalics ()
afx_msg void OnUpdateItalics (CCmdUI *pCmdUI)
afx_msg void OnUnderline ()
afx_msg void OnUpdateUnderline (CCmdUI *pCmdUI)
afx_msg void OnIndent ()
afx_msg void OnUpdateIndent (CCmdUI *pCmdUI)
afx_msg void OnOutdent ()
afx_msg void OnUpdateOutdent (CCmdUI *pCmdUI)
afx_msg void OnFontred ()
afx_msg void OnUpdateFontred (CCmdUI *pCmdUI)
afx_msg void OnFontblack ()
afx_msg void OnUpdateFontblack (CCmdUI *pCmdUI)
afx_msg void OnBgcolor ()
afx_msg void OnUpdateBgcolor (CCmdUI *pCmdUI)
afx_msg void OnNobgcolor ()
afx_msg void OnUpdateNobgcolor (CCmdUI *pCmdUI)
afx_msg void OnFontsizeincrease ()
afx_msg void OnFontsizedecrease ()
afx_msg void OnArial ()
afx_msg void OnTimes ()
afx_msg void OnCourier ()
afx_msg void OnAlignleft ()
afx_msg void OnUpdateAlignleft (CCmdUI *pCmdUI)
afx_msg void OnAlignright ()
afx_msg void OnUpdateAlignright (CCmdUI *pCmdUI)
afx_msg void OnAligncenter ()
afx_msg void OnUpdateAligncenter (CCmdUI *pCmdUI)
afx_msg void OnInsertlink ()
afx_msg void OnEditUndo ()
afx_msg void OnEditRedo ()
afx_msg void OnUpdateEditRedo (CCmdUI *pCmdUI)
afx_msg void OnUpdateEditUndo (CCmdUI *pCmdUI)
afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void OnSetFocus (CWnd *pOldWnd)
afx_msg void OnSetFocus (CWnd *pOldWnd)
afx_msg void OnSize (UINT nType, int cx, int cy)
afx_msg void OnSize (UINT nType, int cx, int cy)
afx_msg void OnClose ()
afx_msg void OnClose ()
afx_msg void OnActivate (UINT nState, CWnd *pWndOther, BOOL bMinimized)
afx_msg void OnActivate (UINT nState, CWnd *pWndOther, BOOL bMinimized)

Protected Attributes

CBrowserFrame::BrowserFrameGlueObj m_xBrowserFrameGlueObj

Private Member Functions

NS_METHOD ExecuteStyleCommand (const char *aCommand)
NS_METHOD ExecuteNoParam (const char *aCommand)
NS_METHOD MakeCommandParams (const char *aCommand, nsICommandParams **aParams)
NS_METHOD ExecuteAttribParam (const char *aCommand, const char *aAttribute)
NS_METHOD GetAttributeParamValue (const char *aCommand, nsEmbedCString &aValue)
void UpdateStyleToolBarBtn (const char *aCommand, CCmdUI *pCmdUI)

Private Attributes

nsCOMPtr< nsICommandManagermCommandManager
nsCOMPtr< nsIDOMWindowmDOMWindow
nsCOMPtr< nsIEditingSessionmEditingSession

Friends

class BrowserFrameGlueObj

Detailed Description

Definition at line 43 of file EditorFrm.h.


Constructor & Destructor Documentation

Definition at line 127 of file EditorFrm.cpp.

{
    m_chromeMask = chromeMask;

    mCommandManager = nsnull;
}

Definition at line 134 of file EditorFrm.cpp.

{
}

Member Function Documentation

Definition at line 147 of file BrowserFrm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 160 of file BrowserFrm.h.

Here is the call graph for this function:

BOOL CBrowserFrame::CanCutUrlBarSelection ( ) [inline, inherited]

Definition at line 145 of file BrowserFrm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CBrowserFrame::CanCutUrlBarSelection ( ) [inline, inherited]

Definition at line 158 of file BrowserFrm.h.

Here is the call graph for this function:

BOOL CBrowserFrame::CanPasteToUrlBar ( ) [inline, inherited]

Definition at line 149 of file BrowserFrm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CBrowserFrame::CanPasteToUrlBar ( ) [inline, inherited]

Definition at line 162 of file BrowserFrm.h.

Here is the call graph for this function:

BOOL CBrowserFrame::CanUndoUrlBarEditOp ( ) [inline, inherited]

Definition at line 151 of file BrowserFrm.h.

{ return m_wndUrlBar.CanUndoEditOp(); }

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CBrowserFrame::CanUndoUrlBarEditOp ( ) [inline, inherited]

Definition at line 164 of file BrowserFrm.h.

{ return m_wndUrlBar.CanUndoEditOp(); }

Here is the call graph for this function:

Definition at line 148 of file BrowserFrm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 161 of file BrowserFrm.h.

Here is the call graph for this function:

Definition at line 146 of file BrowserFrm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 159 of file BrowserFrm.h.

Here is the call graph for this function:

NS_METHOD CEditorFrame::DoCommand ( const char *  aCommand,
nsICommandParams aCommandParams 
)

Definition at line 267 of file EditorFrm.cpp.

{
    nsCOMPtr<nsIDOMWindow> domWindow;
    m_wndBrowserView.mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
    return mCommandManager ? mCommandManager->DoCommand(aCommand, aCommandParams, domWindow) : NS_ERROR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_METHOD CEditorFrame::ExecuteAttribParam ( const char *  aCommand,
const char *  aAttribute 
) [private]

Definition at line 318 of file EditorFrm.cpp.

{
  nsresult rv;
  nsCOMPtr<nsICommandParams> params;
  rv = MakeCommandParams(aCommand,getter_AddRefs(params));
  if (NS_FAILED(rv))
   return rv;
  if (!params)
    return NS_ERROR_FAILURE;
  params->SetCStringValue(STATE_ATTRIBUTE, aAttribute);
  return DoCommand(aCommand,params);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_METHOD CEditorFrame::ExecuteNoParam ( const char *  aCommand) [private]

Definition at line 292 of file EditorFrm.cpp.

{
    return DoCommand(aCommand,0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_METHOD CEditorFrame::ExecuteStyleCommand ( const char *  aCommand) [private]

Definition at line 202 of file EditorFrm.cpp.

{
  return DoCommand(aCommand,0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_METHOD CEditorFrame::GetAttributeParamValue ( const char *  aCommand,
nsEmbedCString aValue 
) [private]

Definition at line 332 of file EditorFrm.cpp.

{
  nsresult rv;
  nsCOMPtr<nsICommandParams> params;
  rv = MakeCommandParams(aCommand,getter_AddRefs(params));
  if (NS_FAILED(rv))
    return rv;
  if (!params)
    return NS_ERROR_FAILURE;
  rv = GetCommandState(aCommand, params);
  if (NS_SUCCEEDED(rv))
  {
    char *tchar;
    rv = params->GetCStringValue(STATE_ATTRIBUTE,&tchar);
    aValue.Assign(tchar);
    nsMemory::Free(tchar);
    return rv;
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

CBrowserImpl* CBrowserFrame::GetBrowserImpl ( ) [inline, inherited]

Definition at line 132 of file BrowserFrm.h.

CBrowserImpl* CBrowserFrame::GetBrowserImpl ( ) [inline, inherited]

Definition at line 141 of file BrowserFrm.h.

NS_METHOD CEditorFrame::GetCommandState ( const char *  aCommand,
nsICommandParams aCommandParams 
)

Definition at line 284 of file EditorFrm.cpp.

{
    nsCOMPtr<nsIDOMWindow> domWindow;
    m_wndBrowserView.mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
    return mCommandManager ? mCommandManager->GetCommandState(aCommand, domWindow, aCommandParams) : NS_ERROR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CEditorFrame::GetCurrentLinkInfo ( CString &  strLinkText,
CString &  strLinkLocation,
nsIDOMHTMLAnchorElement **  anchorElement 
)

Definition at line 538 of file EditorFrm.cpp.

{
    USES_CONVERSION;

    nsCOMPtr<nsIHTMLEditor> htmlEditor;

    GetHTMLEditor(getter_AddRefs(htmlEditor));
    if (!htmlEditor)
        return FALSE;

    nsCOMPtr<nsIDOMElement> domElement;
    htmlEditor->GetElementOrParentByTagName(nsEmbedString(L"href"), 
                                            nsnull,
                                            getter_AddRefs(domElement));
    if (!domElement)
        return FALSE;

    nsEmbedString linkLocation, linkText;
    nsresult rv = NS_ERROR_FAILURE;

    // Determine linkLocation
    nsCOMPtr<nsIDOMHTMLAnchorElement> linkElement(do_QueryInterface(domElement, &rv));
    if (NS_SUCCEEDED(rv))
        rv = linkElement->GetHref(linkLocation);
    if (NS_FAILED(rv))
        return FALSE;

    // Determine linkText
    nsCOMPtr<nsIDOMNode> firstChild;
    rv = linkElement->GetFirstChild(getter_AddRefs(firstChild));
    if (NS_FAILED(rv))
        return FALSE;
    firstChild->GetNodeValue(linkText);
    if (NS_FAILED(rv))
        return FALSE;

    strLinkText = W2CT(linkText.get());
    strLinkLocation = W2CT(linkLocation.get());

    *anchorElement = linkElement;
    NS_ADDREF(*anchorElement);

       return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CBrowserFrame::GetEditable ( ) [inline, inherited]

Definition at line 193 of file BrowserFrm.h.

{ return mIsEditor; }

Definition at line 639 of file EditorFrm.cpp.

{
    mEditingSession->GetEditorForWindow(mDOMWindow, editor);
}

Here is the caller graph for this function:

Definition at line 644 of file EditorFrm.cpp.

{
    *htmlEditor = 0;

    nsCOMPtr<nsIEditor> editor;
    GetEditor(getter_AddRefs(editor));
    if (!editor) 
       {
        return;
    }

    editor->QueryInterface(NS_GET_IID(nsIHTMLEditor), (void**)htmlEditor);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 138 of file EditorFrm.cpp.

{
    // Get and save off nsICommandManager for later use
    //
    nsresult rv;
    mCommandManager = do_GetInterface(m_wndBrowserView.mWebBrowser, &rv);

    rv = MakeEditable();
 
    return (NS_SUCCEEDED(rv));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 658 of file EditorFrm.cpp.

{
    nsCOMPtr<nsIHTMLEditor> htmlEditor;

    GetHTMLEditor(getter_AddRefs(htmlEditor));

    if (htmlEditor) 
       {
        nsCOMPtr<nsIDOMElement> domElememt;
        htmlEditor->GetElementOrParentByTagName(nsEmbedString(L"href"), 
                                                nsnull,
                                                getter_AddRefs(domElememt));
        return domElememt ? TRUE : FALSE;
    }

    return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CEditorFrame::InsertHTML ( CString &  str)

Definition at line 500 of file EditorFrm.cpp.

{
    nsEmbedString htmlToInsert;
#ifdef _UNICODE
    htmlToInsert.Assign(str.GetBuffer(0));
#else
    NS_CStringToUTF16(nsEmbedCString(str.GetBuffer(0)),
                      NS_CSTRING_ENCODING_ASCII,
                      htmlToInsert);
#endif

    nsCOMPtr<nsIHTMLEditor> htmlEditor;
    GetHTMLEditor(getter_AddRefs(htmlEditor)); 
    if (htmlEditor) 
       htmlEditor->InsertHTML(htmlToInsert);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CEditorFrame::InsertLink ( CString &  linkText,
CString &  linkLocation 
)

Definition at line 493 of file EditorFrm.cpp.

{
    CString html = " &nbsp;<A HREF=\"" + linkLocation + "\">" + linkText + "</A>&nbsp; ";

    InsertHTML(html);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_METHOD CEditorFrame::IsCommandEnabled ( const char *  aCommand,
PRBool retval 
)

Definition at line 275 of file EditorFrm.cpp.

{
    nsCOMPtr<nsIDOMWindow> domWindow;
    m_wndBrowserView.mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
    return mCommandManager ? mCommandManager->IsCommandEnabled(aCommand, domWindow, retval) : NS_ERROR_FAILURE;
}

Here is the call graph for this function:

NS_METHOD CEditorFrame::MakeCommandParams ( const char *  aCommand,
nsICommandParams **  aParams 
) [private]

Definition at line 183 of file EditorFrm.cpp.

{
    nsresult rv;
    nsCOMPtr<nsICommandParams> params = do_CreateInstance(NS_COMMAND_PARAMS_CONTRACTID,&rv);
    if (NS_FAILED(rv))
        return rv;
    if (!params)
        return NS_ERROR_FAILURE;
    *aParams = params;
    NS_ADDREF(*aParams);
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 249 of file EditorFrm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CBrowserFrame::OnActivate ( UINT  nState,
CWnd *  pWndOther,
BOOL  bMinimized 
) [protected, inherited]

Definition at line 321 of file BrowserFrm.cpp.

{
       CFrameWnd::OnActivate(nState, pWndOther, bMinimized);
       
    m_wndBrowserView.Activate(nState, pWndOther, bMinimized);
}

Here is the call graph for this function:

afx_msg void CBrowserFrame::OnActivate ( UINT  nState,
CWnd *  pWndOther,
BOOL  bMinimized 
) [protected, inherited]

Definition at line 457 of file EditorFrm.cpp.

Here is the call graph for this function:

Definition at line 419 of file EditorFrm.cpp.

Here is the call graph for this function:

Definition at line 439 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnArial ( ) [protected]

Definition at line 404 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnBgcolor ( ) [protected]

Definition at line 374 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnBold ( ) [protected]

Definition at line 150 of file EditorFrm.cpp.

Here is the call graph for this function:

void CBrowserFrame::OnClose ( void  ) [protected, inherited]

Definition at line 122 of file BrowserFrm.cpp.

{
       CTestEmbedApp *pApp = (CTestEmbedApp *)AfxGetApp();
       pApp->RemoveFrameFromList(this);

       DestroyWindow();
}

Here is the call graph for this function:

afx_msg void CBrowserFrame::OnClose ( ) [protected, inherited]
BOOL CBrowserFrame::OnCmdMsg ( UINT  nID,
int  nCode,
void pExtra,
AFX_CMDHANDLERINFO *  pHandlerInfo 
) [virtual, inherited]

Definition at line 281 of file BrowserFrm.cpp.

{
       // let the view have first crack at the command
       if (m_wndBrowserView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
              return TRUE;

       // otherwise, do default handling
       return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}

Here is the call graph for this function:

virtual BOOL CBrowserFrame::OnCmdMsg ( UINT  nID,
int  nCode,
void pExtra,
AFX_CMDHANDLERINFO *  pHandlerInfo 
) [virtual, inherited]
void CEditorFrame::OnCourier ( ) [protected]

Definition at line 414 of file EditorFrm.cpp.

Here is the call graph for this function:

int CBrowserFrame::OnCreate ( LPCREATESTRUCT  lpCreateStruct) [protected, inherited]

Definition at line 133 of file BrowserFrm.cpp.

{
       if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
              return -1;

       // Pass "this" to the View for later callbacks
       // and/or access to any public data members, if needed
       //
       m_wndBrowserView.SetBrowserFrame(this);

       // Pass on the BrowserFrameGlue also to the View which
       // it will use during the Init() process after creation
       // of the BrowserImpl obj. Essentially, the View object
       // hooks up the Embedded browser's callbacks to the BrowserFrame
       // via this BrowserFrameGlue object
       m_wndBrowserView.SetBrowserFrameGlue((PBROWSERFRAMEGLUE)&m_xBrowserFrameGlueObj);

       // create a view to occupy the client area of the frame
       // This will be the view in which the embedded browser will
       // be displayed in
       //
       if (!m_wndBrowserView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
              CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
       {
              TRACE0("Failed to create view window\n");
              return -1;
       }

       // create the URL bar (essentially a ComboBoxEx object)
       if (!m_wndUrlBar.Create(CBS_DROPDOWN | WS_CHILD, CRect(0, 0, 200, 150), this, ID_URL_BAR))
       {
              TRACE0("Failed to create URL Bar\n");
              return -1;      // fail to create
       }
    
    // Load the Most Recently Used(MRU) Urls into the UrlBar
    m_wndUrlBar.LoadMRUList();

       // Create the toolbar with Back, Fwd, Stop, etc. buttons..
       if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
              | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
              !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
       {
              TRACE0("Failed to create toolbar\n");
              return -1;      // fail to create
       }

       // Create a ReBar window to which the toolbar and UrlBar 
       // will be added
       if (!m_wndReBar.Create(this))
       {
              TRACE0("Failed to create ReBar\n");
              return -1;      // fail to create
       }
       
       //Add the ToolBar and UrlBar windows to the rebar
       m_wndReBar.AddBar(&m_wndToolBar);
       m_wndReBar.AddBar(&m_wndUrlBar, "Enter URL:");

       // Create the status bar with two panes - one pane for actual status
       // text msgs. and the other for the progress control
       if (!m_wndStatusBar.Create(this) ||
              !m_wndStatusBar.SetIndicators(indicators,
                sizeof(indicators)/sizeof(UINT)))
       {
              TRACE0("Failed to create status bar\n");
              return -1;      // fail to create
       }

       // Create the progress bar as a child of the status bar.
       // Note that the ItemRect which we'll get at this stage
       // is bogus since the status bar panes are not fully
       // positioned yet i.e. we'll be passing in an invalid rect
       // to the Create function below
       // The actual positioning of the progress bar will be done
       // in response to OnSize()
       RECT rc;
       m_wndStatusBar.GetItemRect (1, &rc);
       if (!m_wndProgressBar.Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH, rc, &m_wndStatusBar, ID_PROG_BAR))
       {
              TRACE0("Failed to create progress bar\n");
              return -1;      // fail to create
       }

       // The third pane(i.e. at index 2) of the status bar will have 
       // the security lock icon displayed in it. Set up it's size(16) 
       // and style(no border)so that the padlock icons can be properly drawn
//     m_wndStatusBar.SetPaneInfo(2, -1, SBPS_NORMAL|SBPS_NOBORDERS, 16);

       // Based on the "chromeMask" we were supplied during construction
       // hide any requested UI elements - statusbar, menubar etc...
       // Note that the window styles (WM_RESIZE etc) are set inside
       // of PreCreateWindow()

       SetupFrameChrome(); 

       return 0;
}

Here is the call graph for this function:

afx_msg int CBrowserFrame::OnCreate ( LPCREATESTRUCT  lpCreateStruct) [protected, inherited]
void CEditorFrame::OnEditRedo ( ) [protected]

Definition at line 588 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnEditUndo ( ) [protected]

Definition at line 583 of file EditorFrm.cpp.

Here is the call graph for this function:

Definition at line 364 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnFontred ( ) [protected]

Definition at line 354 of file EditorFrm.cpp.

Here is the call graph for this function:

Definition at line 399 of file EditorFrm.cpp.

Here is the call graph for this function:

Definition at line 394 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnIndent ( ) [protected]

Definition at line 297 of file EditorFrm.cpp.

Here is the call graph for this function:

Definition at line 475 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnItalics ( ) [protected]

Definition at line 160 of file EditorFrm.cpp.

Here is the call graph for this function:

Definition at line 384 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnOutdent ( ) [protected]

Definition at line 307 of file EditorFrm.cpp.

Here is the call graph for this function:

void CBrowserFrame::OnSetFocus ( CWnd *  pOldWnd) [protected, inherited]

Definition at line 275 of file BrowserFrm.cpp.

{
       // forward focus to the view window
       m_wndBrowserView.SetFocus();
}
afx_msg void CBrowserFrame::OnSetFocus ( CWnd *  pOldWnd) [protected, inherited]
void CBrowserFrame::OnSize ( UINT  nType,
int  cx,
int  cy 
) [protected, inherited]

Definition at line 293 of file BrowserFrm.cpp.

{
       CFrameWnd::OnSize(nType, cx, cy);
       
       // Get the ItemRect of the status bar's Pane 1
       // That's where the progress bar will be located
       RECT rc;
       m_wndStatusBar.GetItemRect(1, &rc);

       // Move the progress bar into it's correct location
       //
       m_wndProgressBar.MoveWindow(&rc);
}
afx_msg void CBrowserFrame::OnSize ( UINT  nType,
int  cx,
int  cy 
) [protected, inherited]
void CEditorFrame::OnTimes ( ) [protected]

Definition at line 409 of file EditorFrm.cpp.

Here is the call graph for this function:

Definition at line 170 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnUpdateAligncenter ( CCmdUI *  pCmdUI) [protected]

Definition at line 462 of file EditorFrm.cpp.

{
  nsEmbedCString tValue;
  nsresult rv = GetAttributeParamValue(ALIGN_COMMAND,tValue);
  if (NS_SUCCEEDED(rv))
  {
    if (strcmp(tValue.get(), ALIGN_CENTER) == 0)
      pCmdUI->SetCheck(1);
    else
      pCmdUI->SetCheck(0);
  }
}

Here is the call graph for this function:

void CEditorFrame::OnUpdateAlignleft ( CCmdUI *  pCmdUI) [protected]

Definition at line 425 of file EditorFrm.cpp.

{
  nsEmbedCString tValue;

  nsresult rv = GetAttributeParamValue(ALIGN_COMMAND,tValue);
  if (NS_SUCCEEDED(rv))
  {
    if (strcmp(tValue.get(), ALIGN_LEFT) == 0)
      pCmdUI->SetCheck(1);
    else
      pCmdUI->SetCheck(0);
  }
}

Here is the call graph for this function:

void CEditorFrame::OnUpdateAlignright ( CCmdUI *  pCmdUI) [protected]

Definition at line 444 of file EditorFrm.cpp.

{
  nsEmbedCString tValue;
  nsresult rv = GetAttributeParamValue(ALIGN_COMMAND,tValue);
  if (NS_SUCCEEDED(rv))
  {
    if (strcmp(tValue.get(), ALIGN_RIGHT) == 0)
      pCmdUI->SetCheck(1);
    else
      pCmdUI->SetCheck(0);
  }
}

Here is the call graph for this function:

void CEditorFrame::OnUpdateBgcolor ( CCmdUI *  pCmdUI) [protected]

Definition at line 379 of file EditorFrm.cpp.

{
    // TODO: Add your command update UI handler code here
}
void CEditorFrame::OnUpdateBold ( CCmdUI *  pCmdUI) [protected]

Definition at line 155 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnUpdateEditRedo ( CCmdUI *  pCmdUI) [protected]

Definition at line 593 of file EditorFrm.cpp.

{
  nsresult rv;
  nsCOMPtr<nsICommandParams> params;
  rv = MakeCommandParams(REDO_COMMAND,getter_AddRefs(params));
  if (NS_FAILED(rv))
    return;
  if (!params)
    return;
  rv = GetCommandState(REDO_COMMAND, params);
  if (NS_SUCCEEDED(rv))
  {
    PRBool tValue;
    params->GetBooleanValue(STATE_ENABLED,&tValue);
    if (tValue)
    {
      pCmdUI->Enable(TRUE);
      return;
    }
  }
  pCmdUI->Enable(FALSE);    
}

Here is the call graph for this function:

void CEditorFrame::OnUpdateEditUndo ( CCmdUI *  pCmdUI) [protected]

Definition at line 616 of file EditorFrm.cpp.

{
  nsresult rv;
  nsCOMPtr<nsICommandParams> params;
  rv = MakeCommandParams(UNDO_COMMAND,getter_AddRefs(params));
  if (NS_FAILED(rv))
    return;
  if (!params)
    return;
  rv = GetCommandState(UNDO_COMMAND, params);
  if (NS_SUCCEEDED(rv))
  {
    PRBool tValue;
    params->GetBooleanValue(STATE_ENABLED,&tValue);
    if (tValue)
    {
      pCmdUI->Enable(TRUE);
      return;
    }
  }
  pCmdUI->Enable(FALSE);        
}

Here is the call graph for this function:

void CEditorFrame::OnUpdateFontblack ( CCmdUI *  pCmdUI) [protected]

Definition at line 369 of file EditorFrm.cpp.

{
    // TODO: Add your command update UI handler code here   
}
void CEditorFrame::OnUpdateFontred ( CCmdUI *  pCmdUI) [protected]

Definition at line 359 of file EditorFrm.cpp.

{
    // TODO: Add your command update UI handler code here
}
void CEditorFrame::OnUpdateIndent ( CCmdUI *  pCmdUI) [protected]

Definition at line 302 of file EditorFrm.cpp.

{
    // TODO: Add your command update UI handler code here
}
void CEditorFrame::OnUpdateItalics ( CCmdUI *  pCmdUI) [protected]

Definition at line 165 of file EditorFrm.cpp.

Here is the call graph for this function:

void CEditorFrame::OnUpdateNobgcolor ( CCmdUI *  pCmdUI) [protected]

Definition at line 389 of file EditorFrm.cpp.

{
    // TODO: Add your command update UI handler code here
}
void CEditorFrame::OnUpdateOutdent ( CCmdUI *  pCmdUI) [protected]

Definition at line 312 of file EditorFrm.cpp.

{
    // TODO: Add your command update UI handler code here
}
void CEditorFrame::OnUpdateUnderline ( CCmdUI *  pCmdUI) [protected]

Definition at line 175 of file EditorFrm.cpp.

Here is the call graph for this function:

Definition at line 150 of file BrowserFrm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 163 of file BrowserFrm.h.

Here is the call graph for this function:

BOOL CBrowserFrame::PreCreateWindow ( CREATESTRUCT &  cs) [virtual, inherited]

Definition at line 247 of file BrowserFrm.cpp.

{
       if( !CFrameWnd::PreCreateWindow(cs) )
              return FALSE;

       cs.dwExStyle &= ~WS_EX_CLIENTEDGE;

       // Change window style based on the chromeMask

       if(! (m_chromeMask & nsIWebBrowserChrome::CHROME_TITLEBAR) )
              cs.style &= ~WS_CAPTION; // No caption           

       if(! (m_chromeMask & nsIWebBrowserChrome::CHROME_WINDOW_RESIZE) )
       {
              // Can't resize this window
              cs.style &= ~WS_SIZEBOX;
              cs.style &= ~WS_THICKFRAME;
              cs.style &= ~WS_MINIMIZEBOX;
              cs.style &= ~WS_MAXIMIZEBOX;
       }

       cs.lpszClass = AfxRegisterWndClass(0);

       return TRUE;
}
virtual BOOL CBrowserFrame::PreCreateWindow ( CREATESTRUCT &  cs) [virtual, inherited]
void CBrowserFrame::SetEditable ( BOOL  isEditor) [inline, inherited]

Definition at line 192 of file BrowserFrm.h.

{ mIsEditor = isEditor; }

Here is the caller graph for this function:

Definition at line 232 of file BrowserFrm.cpp.

{
       if(m_chromeMask == nsIWebBrowserChrome::CHROME_ALL)
              return;

       if(! (m_chromeMask & nsIWebBrowserChrome::CHROME_MENUBAR) )
              SetMenu(NULL); // Hide the MenuBar

       if(! (m_chromeMask & nsIWebBrowserChrome::CHROME_TOOLBAR) )
              m_wndReBar.ShowWindow(SW_HIDE); // Hide the ToolBar

       if(! (m_chromeMask & nsIWebBrowserChrome::CHROME_STATUSBAR) )
              m_wndStatusBar.ShowWindow(SW_HIDE); // Hide the StatusBar
}

Here is the caller graph for this function:

Definition at line 517 of file EditorFrm.cpp.

{
    nsCOMPtr<nsIDOMHTMLAnchorElement> anchorElement;
    CLinkPropertiesDlg dlg;

    if (GetCurrentLinkInfo(dlg.m_LinkText, dlg.m_LinkLocation, getter_AddRefs(anchorElement)))
    {
        if(dlg.DoModal() == IDOK)
        {
            //Select the link being edited and then insert the
            //new link into it's place i.e. essentially a replace operation
            nsCOMPtr<nsIHTMLEditor> htmlEditor;
            GetHTMLEditor(getter_AddRefs(htmlEditor)); 
            if (htmlEditor) 
               htmlEditor->SelectElement(anchorElement);

            InsertLink(dlg.m_LinkText, dlg.m_LinkLocation);
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 483 of file EditorFrm.cpp.

{
    CLinkPropertiesDlg dlg;

    if(dlg.DoModal() == IDOK)
    {
        InsertLink(dlg.m_LinkText, dlg.m_LinkLocation);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 366 of file BrowserFrm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CBrowserFrame::UndoUrlBarEditOp ( ) [inline, inherited]

Definition at line 152 of file BrowserFrm.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void CBrowserFrame::UndoUrlBarEditOp ( ) [inline, inherited]

Definition at line 165 of file BrowserFrm.h.

Here is the call graph for this function:

Definition at line 343 of file BrowserFrm.cpp.

{
    int iResID = nsIWebProgressListener::STATE_IS_INSECURE;
    
    if(IS_SECURE(aState)){
        iResID = IDR_SECURITY_LOCK;
        m_wndBrowserView.m_SecurityState = CBrowserView::SECURITY_STATE_SECURE;
    }
    else if(aState == nsIWebProgressListener::STATE_IS_INSECURE) {
        iResID = IDR_SECURITY_UNLOCK;
        m_wndBrowserView.m_SecurityState = CBrowserView::SECURITY_STATE_INSECURE;
    }
    else if(aState == nsIWebProgressListener::STATE_IS_BROKEN) {
        iResID = IDR_SECURITY_BROKEN;
        m_wndBrowserView.m_SecurityState = CBrowserView::SECURITY_STATE_BROKEN;
    }

    CStatusBarCtrl& sb = m_wndStatusBar.GetStatusBarCtrl();
    sb.SetIcon(2, //2 is the pane index of the status bar where the lock icon will be shown
        (HICON)::LoadImage(AfxGetResourceHandle(),
        MAKEINTRESOURCE(iResID), IMAGE_ICON, 16,16,0));       
}
void CEditorFrame::UpdateStyleToolBarBtn ( const char *  aCommand,
CCmdUI *  pCmdUI 
) [private]

Definition at line 211 of file EditorFrm.cpp.

{
    nsCOMPtr<nsICommandParams> params;
    nsresult rv;
    rv = MakeCommandParams(aCommand,getter_AddRefs(params));
    if (NS_FAILED(rv) || !params)
        return;
    rv = GetCommandState(aCommand,params);
    if (NS_SUCCEEDED(rv))
    {
        // Does our current selection span mixed styles?
        // If so, set the toolbar button to an indeterminate
        // state
        //
        PRBool bMixedStyle = PR_FALSE;
        rv = params->GetBooleanValue(STATE_MIXED, &bMixedStyle);
        if (NS_SUCCEEDED(rv))
        {
            if(bMixedStyle)
            {
                pCmdUI->SetCheck(2);
                return;
            }
        }

        // We're not in STATE_MIXED. Enable/Disable the
        // toolbar button based on it's current state
        //
        PRBool bCmdEnabled = PR_FALSE;
        rv = params->GetBooleanValue(STATE_ALL, &bCmdEnabled);
        if (NS_SUCCEEDED(rv))
        {
            bCmdEnabled ? pCmdUI->SetCheck(1) : pCmdUI->SetCheck(0);
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

BrowserFrameGlueObj [friend, inherited]

Definition at line 175 of file BrowserFrm.h.


Member Data Documentation

Definition at line 156 of file BrowserFrm.h.

Definition at line 142 of file BrowserFrm.h.

CProgressCtrl CBrowserFrame::m_wndProgressBar [inherited]

Definition at line 136 of file BrowserFrm.h.

CReBar CBrowserFrame::m_wndReBar [inherited]

Definition at line 138 of file BrowserFrm.h.

CStatusBar CBrowserFrame::m_wndStatusBar [inherited]

Definition at line 135 of file BrowserFrm.h.

Definition at line 144 of file BrowserFrm.h.

CToolBar CBrowserFrame::m_wndToolBar [inherited]

Definition at line 134 of file BrowserFrm.h.

Definition at line 141 of file BrowserFrm.h.

Definition at line 137 of file BrowserFrm.h.

Definition at line 119 of file EditorFrm.h.

Definition at line 120 of file EditorFrm.h.

Definition at line 121 of file EditorFrm.h.


The documentation for this class was generated from the following files: