Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
MailFrame Class Reference

#include <MailFrame.h>

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

List of all members.

Public Member Functions

 MailFrame (wxWindow *aParent)
void OnArticleClick (wxListEvent &event)
void OnActivate (wxActivateEvent &event)
void OnEditCut (wxCommandEvent &event)
void OnUpdateEditCut (wxUpdateUIEvent &event)
void OnEditCopy (wxCommandEvent &event)
void OnUpdateEditCopy (wxUpdateUIEvent &event)
void OnEditPaste (wxCommandEvent &event)
void OnUpdateEditPaste (wxUpdateUIEvent &event)
void OnEditSelectAll (wxCommandEvent &event)
bool SetupDefaultGeckoWindow ()
bool SetupGeckoWindow (GeckoWindow *aGeckoWindow, GeckoContainerUI *aUI, nsIWebBrowser **aWebBrowser) const
void SetFocus ()
virtual nsresult CreateBrowserWindow (PRUint32 aChromeFlags, nsIWebBrowserChrome *aParent, nsIWebBrowserChrome **aNewWindow)
virtual void Destroy ()
virtual void Destroyed ()
virtual void KillFocus ()
virtual void UpdateStatusBarText (const PRUnichar *aStatusText)
virtual void UpdateCurrentURI ()
virtual void UpdateBusyState (PRBool aBusy)
virtual void UpdateProgress (PRInt32 aCurrent, PRInt32 aMax)
virtual void GetResourceStringById (PRInt32 aID, char **aReturn)
virtual void ShowContextMenu (PRUint32 aContextFlags, nsIContextMenuInfo *aContextMenuInfo)
virtual void ShowTooltip (PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText)
virtual void HideTooltip ()
virtual void ShowWindow (PRBool aShow)
virtual void SizeTo (PRInt32 aWidth, PRInt32 aHeight)
virtual void EnableChromeWindow (PRBool aEnabled)
virtual PRUint32 RunEventLoop (PRBool &aRunCondition)

Protected Attributes

GeckoWindowmGeckoWnd
nsCOMPtr< nsIWebBrowsermWebBrowser
PRBool mBusy

Detailed Description

Definition at line 36 of file MailFrame.h.


Constructor & Destructor Documentation

MailFrame::MailFrame ( wxWindow *  aParent)

Definition at line 147 of file MailFrame.cpp.

{
    wxXmlResource::Get()->LoadFrame(this, aParent, wxT("mail_frame"));

    SetName("mail");

    SetIcon(wxICON(appicon));

    if (!gMailChannelCallbackRegistered)
    {
        GeckoProtocolHandler::RegisterHandler("wxmail", "wxMail handler", new MailChannelCallback);
        gMailChannelCallbackRegistered = TRUE;
    }

    // Set up the article pane
    wxListCtrl *articleListCtrl = (wxListCtrl *) FindWindowById(XRCID("articles"), this);
    if (articleListCtrl)
    {
        articleListCtrl->InsertColumn(0, "Subject", wxLIST_FORMAT_LEFT, 200);
        articleListCtrl->InsertColumn(1, "Sender", wxLIST_FORMAT_LEFT, 100);
        articleListCtrl->InsertColumn(2, "Date", wxLIST_FORMAT_LEFT, 100);

        for (long i = 0; i < sizeof(gSampleMessages) / sizeof(gSampleMessages[0]); i++)
        {
            articleListCtrl->InsertItem(i, gSampleMessages[i].mSubject);
            articleListCtrl->SetItem(i, 1, gSampleMessages[i].mSender);
            articleListCtrl->SetItem(i, 2, gSampleMessages[i].mDate);
        }
    }

    SetupDefaultGeckoWindow();

    wxWindow *hdrPanel = FindWindowById(XRCID("mail_header_panel"), this);
    if (hdrPanel)
    {
        hdrPanel->Show(FALSE);
    }


    CreateStatusBar();
}

Here is the call graph for this function:


Member Function Documentation

nsresult GeckoContainerUI::CreateBrowserWindow ( PRUint32  aChromeFlags,
nsIWebBrowserChrome aParent,
nsIWebBrowserChrome **  aNewWindow 
) [virtual, inherited]

Reimplemented in BrowserFrame.

Definition at line 36 of file GeckoContainerUI.cpp.

{
    return NS_ERROR_FAILURE;
}
void GeckoContainerUI::Destroy ( void  ) [virtual, inherited]

Definition at line 42 of file GeckoContainerUI.cpp.

{
}
void GeckoContainerUI::Destroyed ( ) [virtual, inherited]

Definition at line 46 of file GeckoContainerUI.cpp.

{
}

Here is the caller graph for this function:

void GeckoContainerUI::EnableChromeWindow ( PRBool  aEnabled) [virtual, inherited]

Definition at line 99 of file GeckoContainerUI.cpp.

{
}
void GeckoContainerUI::GetResourceStringById ( PRInt32  aID,
char **  aReturn 
) [virtual, inherited]

Definition at line 75 of file GeckoContainerUI.cpp.

{
}
void GeckoContainerUI::HideTooltip ( ) [virtual, inherited]

Definition at line 87 of file GeckoContainerUI.cpp.

{
}
void GeckoContainerUI::KillFocus ( ) [virtual, inherited]

Definition at line 54 of file GeckoContainerUI.cpp.

{
}
void GeckoFrame::OnActivate ( wxActivateEvent &  event) [inherited]

Definition at line 94 of file GeckoFrame.cpp.

{
    nsCOMPtr<nsIWebBrowserFocus> focus(do_GetInterface(mWebBrowser));
    if (focus)
    {
        if (event.GetActive())
            focus->Activate();
        else
            focus->Deactivate();
    }
    wxFrame::OnActivate(event);
}

Here is the call graph for this function:

void MailFrame::OnArticleClick ( wxListEvent &  event)

Definition at line 189 of file MailFrame.cpp.

{
    if (mWebBrowser)
    {
        long idx = event.GetIndex();
        wxString url = wxString::Format("wxmail://%ld", idx);
        if (!url.IsEmpty())
        {
            wxStaticText *txtFrom = (wxStaticText *) FindWindowById(XRCID("mail_from"), this);
            if (txtFrom)
                txtFrom->SetLabel(gSampleMessages[idx].mSender);
            wxStaticText *txtDate = (wxStaticText *) FindWindowById(XRCID("mail_date"), this);
            if (txtDate)
                txtDate->SetLabel(gSampleMessages[idx].mDate);
            wxStaticText *txtSubject = (wxStaticText *) FindWindowById(XRCID("mail_subject"), this);
            if (txtSubject)
                txtSubject->SetLabel(gSampleMessages[idx].mSubject);

            wxWindow *hdrPanel = FindWindowById(XRCID("mail_header_panel"), this);
            if (hdrPanel)
                hdrPanel->Show(TRUE);

            nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(mWebBrowser);
            webNav->LoadURI(NS_ConvertASCIItoUCS2(url.c_str()).get(),
                                   nsIWebNavigation::LOAD_FLAGS_NONE,
                                   nsnull,
                                   nsnull,
                                   nsnull);
        }
    }
}

Here is the call graph for this function:

void GeckoFrame::OnEditCopy ( wxCommandEvent &  event) [inherited]

Definition at line 123 of file GeckoFrame.cpp.

{
    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
    if(clipCmds)
        clipCmds->CopySelection();
}

Here is the call graph for this function:

void GeckoFrame::OnEditCut ( wxCommandEvent &  event) [inherited]

Definition at line 107 of file GeckoFrame.cpp.

{
    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
    if(clipCmds)
        clipCmds->CutSelection();
}

Here is the call graph for this function:

void GeckoFrame::OnEditPaste ( wxCommandEvent &  event) [inherited]

Definition at line 139 of file GeckoFrame.cpp.

{
    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
    if(clipCmds)
        clipCmds->Paste();
}

Here is the call graph for this function:

void GeckoFrame::OnEditSelectAll ( wxCommandEvent &  event) [inherited]

Definition at line 155 of file GeckoFrame.cpp.

{
    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
    if(clipCmds)
        clipCmds->SelectAll();
}

Here is the call graph for this function:

void GeckoFrame::OnUpdateEditCopy ( wxUpdateUIEvent &  event) [inherited]

Definition at line 130 of file GeckoFrame.cpp.

{
    PRBool canCopy = PR_FALSE;
    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
    if(clipCmds)
        clipCmds->CanCopySelection(&canCopy);
    event.Enable(canCopy ? true : false);
}

Here is the call graph for this function:

void GeckoFrame::OnUpdateEditCut ( wxUpdateUIEvent &  event) [inherited]

Definition at line 114 of file GeckoFrame.cpp.

{
    PRBool canCut = PR_FALSE;
    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
    if(clipCmds)
        clipCmds->CanCutSelection(&canCut);
    event.Enable(canCut ? true : false);
}

Here is the call graph for this function:

void GeckoFrame::OnUpdateEditPaste ( wxUpdateUIEvent &  event) [inherited]

Definition at line 146 of file GeckoFrame.cpp.

{
    PRBool canPaste = PR_FALSE;
    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
    if(clipCmds)
        clipCmds->CanPaste(&canPaste);
    event.Enable(canPaste ? true : false);
}

Here is the call graph for this function:

PRUint32 GeckoContainerUI::RunEventLoop ( PRBool aRunCondition) [virtual, inherited]

Definition at line 103 of file GeckoContainerUI.cpp.

{
    return 0;
}
void GeckoFrame::SetFocus ( ) [virtual, inherited]

Reimplemented from GeckoContainerUI.

Definition at line 165 of file GeckoFrame.cpp.

{
    mGeckoWnd->SetFocus();
}

Definition at line 57 of file GeckoFrame.cpp.

{
    mGeckoWnd  = (GeckoWindow *) FindWindowById(XRCID("gecko"), this);
    if (!mGeckoWnd)
        return FALSE;
    return SetupGeckoWindow(mGeckoWnd, this, getter_AddRefs(mWebBrowser));
}

Here is the call graph for this function:

bool GeckoFrame::SetupGeckoWindow ( GeckoWindow aGeckoWindow,
GeckoContainerUI aUI,
nsIWebBrowser **  aWebBrowser 
) const [inherited]

Definition at line 65 of file GeckoFrame.cpp.

{
    if (!aGeckoWindow || !aUI)
        return FALSE;

    GeckoContainer *geckoContainer = new GeckoContainer(aUI);
    if (!geckoContainer)
        return FALSE;

    mGeckoWnd->SetGeckoContainer(geckoContainer);

    PRUint32 aChromeFlags = nsIWebBrowserChrome::CHROME_ALL;
    geckoContainer->SetChromeFlags(aChromeFlags);
    geckoContainer->SetParent(nsnull);
    wxSize size = mGeckoWnd->GetClientSize();

    // Insert the browser
    geckoContainer->CreateBrowser(0, 0, size.GetWidth(), size.GetHeight(),
        (nativeWindow) aGeckoWindow->GetHWND(), aWebBrowser);

    nsCOMPtr<nsIBaseWindow> webBrowserAsWin = do_QueryInterface(*aWebBrowser);
    if (webBrowserAsWin)
    {
        webBrowserAsWin->SetVisibility(PR_TRUE);
    }

    return TRUE;
}

Here is the call graph for this function:

void GeckoContainerUI::ShowContextMenu ( PRUint32  aContextFlags,
nsIContextMenuInfo aContextMenuInfo 
) [virtual, inherited]

Reimplemented in BrowserFrame.

Definition at line 79 of file GeckoContainerUI.cpp.

{
}
void GeckoContainerUI::ShowTooltip ( PRInt32  aXCoords,
PRInt32  aYCoords,
const PRUnichar aTipText 
) [virtual, inherited]

Definition at line 83 of file GeckoContainerUI.cpp.

{
}
void GeckoContainerUI::ShowWindow ( PRBool  aShow) [virtual, inherited]

Definition at line 91 of file GeckoContainerUI.cpp.

{
}

Here is the caller graph for this function:

void GeckoContainerUI::SizeTo ( PRInt32  aWidth,
PRInt32  aHeight 
) [virtual, inherited]

Definition at line 95 of file GeckoContainerUI.cpp.

{
}
void GeckoContainerUI::UpdateBusyState ( PRBool  aBusy) [virtual, inherited]

Definition at line 66 of file GeckoContainerUI.cpp.

{
    mBusy = aBusy;
}
void GeckoContainerUI::UpdateCurrentURI ( ) [virtual, inherited]

Reimplemented in BrowserFrame.

Definition at line 62 of file GeckoContainerUI.cpp.

{
}
void GeckoContainerUI::UpdateProgress ( PRInt32  aCurrent,
PRInt32  aMax 
) [virtual, inherited]

Definition at line 71 of file GeckoContainerUI.cpp.

{
}
void GeckoContainerUI::UpdateStatusBarText ( const PRUnichar aStatusText) [virtual, inherited]

Reimplemented in BrowserFrame, and EditorFrame.

Definition at line 58 of file GeckoContainerUI.cpp.

{
}

Member Data Documentation

PRBool GeckoContainerUI::mBusy [protected, inherited]

Definition at line 138 of file GeckoContainer.h.

GeckoWindow* GeckoFrame::mGeckoWnd [protected, inherited]

Definition at line 44 of file GeckoFrame.h.

Definition at line 45 of file GeckoFrame.h.


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