Back to index

lightning-sunbird  0.9+nobinonly
Private Member Functions
EmbedApp Class Reference

List of all members.

Private Member Functions

virtual bool OnInit ()
virtual int OnExit ()
void OnQuit (wxCommandEvent &event)
void OnAbout (wxCommandEvent &event)
void OnMail (wxCommandEvent &event)
void OnChat (wxCommandEvent &event)
void OnEditor (wxCommandEvent &event)

Detailed Description

Definition at line 74 of file EmbedApp.cpp.


Member Function Documentation

void EmbedApp::OnAbout ( wxCommandEvent &  event) [private]

Definition at line 185 of file EmbedApp.cpp.

{
    (void)wxMessageBox(_T("wxEmbed"), _T("About wxEmbed"));
}
void EmbedApp::OnChat ( wxCommandEvent &  event) [private]

Definition at line 200 of file EmbedApp.cpp.

{
    ChatFrame * frame = (ChatFrame *) wxWindow::FindWindowByName("chat", NULL);
    if (!frame)
        frame = new ChatFrame(NULL);
    if (frame)
        frame->Show(TRUE);
}
void EmbedApp::OnEditor ( wxCommandEvent &  event) [private]

Definition at line 209 of file EmbedApp.cpp.

{
    EditorFrame * frame = (EditorFrame *) wxWindow::FindWindowByName("editor", NULL);
    if (!frame)
        frame = new EditorFrame(NULL);
    if (frame)
        frame->Show(TRUE);
}
int EmbedApp::OnExit ( ) [private, virtual]

Definition at line 145 of file EmbedApp.cpp.

{
    // Shutdown the profile
    nsresult rv;
    nsCOMPtr<nsIProfile> profileService = 
             do_GetService(NS_PROFILE_CONTRACTID, &rv);
    if (NS_SUCCEEDED(rv))
    {
        profileService->ShutDownCurrentProfile(nsIProfile::SHUTDOWN_PERSIST); 
    }
    NS_TermEmbedding();

    return 0;
}

Here is the call graph for this function:

bool EmbedApp::OnInit ( ) [private, virtual]

Definition at line 99 of file EmbedApp.cpp.

{
    wxImage::AddHandler(new wxGIFHandler);
    wxXmlResource::Get()->InitAllHandlers();
    InitXmlResource();

    if (NS_FAILED(NS_InitEmbedding(nsnull, nsnull)))
    {
        return FALSE;
    }

    nsresult rv;
    nsCOMPtr<nsIProfile> profileService = 
             do_GetService(NS_PROFILE_CONTRACTID, &rv);
    rv = profileService->CreateNewProfile(L"wxEmbed", nsnull, nsnull, PR_FALSE);
    if (NS_FAILED(rv)) return FALSE;
    rv = profileService->SetCurrentProfile(L"wxEmbed");
    if (NS_FAILED(rv)) return FALSE;

    GeckoProtocolHandler::RegisterHandler("foo", "Test handler", new FooCallback);

    // Register a window creator for popups
    GeckoWindowCreator *creatorCallback = new GeckoWindowCreator();
    if (creatorCallback)
    {
        nsCOMPtr<nsIWindowCreator> windowCreator(NS_STATIC_CAST(nsIWindowCreator *, creatorCallback));
        if (windowCreator)
        {
            nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
            if (wwatch)
            {
                wwatch->SetWindowCreator(windowCreator);
            }
        }
    }

    // Create the main frame window
    BrowserFrame* frame = new BrowserFrame(NULL);
    frame->Show(TRUE);
    // frame->OnBrowserHome(wxCommandEvent());

    SetTopWindow(frame);

    return TRUE;
}

Here is the call graph for this function:

void EmbedApp::OnMail ( wxCommandEvent &  event) [private]

Definition at line 190 of file EmbedApp.cpp.

{
    // Create the mail frame window
    MailFrame * frame = (MailFrame *) wxWindow::FindWindowByName("mail", NULL);;
    if (!frame)
        frame = new MailFrame(NULL);
    if (frame)
        frame->Show(TRUE);
}
void EmbedApp::OnQuit ( wxCommandEvent &  event) [private]

Definition at line 160 of file EmbedApp.cpp.

{
    wxFrame * frame = NULL;
    
/*
    do {
        frame = (wxFrame *) wxWindow::FindWindowByName("browser", NULL);;
        if (frame)
            frame->Close(TRUE);
    } while (frame);
    frame = (wxFrame *) wxWindow::FindWindowByName("mail", NULL);;
    if (frame)
        frame->Close(TRUE);
    frame = (wxFrame *) wxWindow::FindWindowByName("editor", NULL);;
    if (frame)
        frame->Close(TRUE);
    frame = (wxFrame *) wxWindow::FindWindowByName("chat", NULL);;
    if (frame)
        frame->Close(TRUE);
*/


    GetTopWindow()->Close(TRUE);
}

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