embedding/components/printingui/ipc/PrintingParent.h
author Bob Owen <bobowencode@gmail.com>
Mon, 21 Dec 2015 20:33:13 +0000
changeset 277218 b90d302c57f6056d9c9077daf8fcd54cccbcb0e5
parent 277217 7a4da453572c1d857a7ad98c932cd7b01c7b27fc
child 277219 7f8e595885186a88d337da38c800ff0b9950a7e8
permissions -rw-r--r--
Bug 1156742 Part 6: Add RemotePrintJob to PrintSession and PrintData. r=roc, r=mconley Someone knew that nsIPrintSession would come in handy one day.

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_embedding_PrintingParent_h
#define mozilla_embedding_PrintingParent_h

#include "mozilla/dom/PBrowserParent.h"
#include "mozilla/embedding/PPrintingParent.h"

class nsIDOMWindow;
class PPrintProgressDialogParent;
class PPrintSettingsDialogParent;

typedef mozilla::layout::PRemotePrintJobParent PRemotePrintJobParent;

namespace mozilla {
namespace embedding {

class PrintingParent final : public PPrintingParent
{
public:
    virtual bool
    RecvShowProgress(PBrowserParent* parent,
                     PPrintProgressDialogParent* printProgressDialog,
                     const bool& isForPrinting,
                     bool* notifyOnOpen,
                     nsresult* result);
    virtual bool
    RecvShowPrintDialog(PPrintSettingsDialogParent* aDialog,
                        PBrowserParent* aParent,
                        const PrintData& aData);

    virtual bool
    RecvSavePrintSettings(const PrintData& data,
                          const bool& usePrinterNamePrefix,
                          const uint32_t& flags,
                          nsresult* rv);

    virtual PPrintProgressDialogParent*
    AllocPPrintProgressDialogParent();

    virtual bool
    DeallocPPrintProgressDialogParent(PPrintProgressDialogParent* aActor);

    virtual PPrintSettingsDialogParent*
    AllocPPrintSettingsDialogParent();

    virtual bool
    DeallocPPrintSettingsDialogParent(PPrintSettingsDialogParent* aActor);

    virtual PRemotePrintJobParent*
    AllocPRemotePrintJobParent();

    virtual bool
    DeallocPRemotePrintJobParent(PRemotePrintJobParent* aActor);

    virtual void
    ActorDestroy(ActorDestroyReason aWhy);

    MOZ_IMPLICIT PrintingParent();
    virtual ~PrintingParent();

private:
    nsIDOMWindow*
    DOMWindowFromBrowserParent(PBrowserParent* parent);

    nsresult
    ShowPrintDialog(PBrowserParent* parent,
                    const PrintData& data,
                    PrintData* result);
};

} // namespace embedding
} // namespace mozilla

#endif