2007-01-11 21:54:29 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2007-01-11 21:54:29 +00:00
|
|
|
|
2017-12-19 10:42:15 +00:00
|
|
|
#ifndef nsPrintSettingsServiceX_h
|
|
|
|
#define nsPrintSettingsServiceX_h
|
2007-01-11 21:54:29 +00:00
|
|
|
|
2017-12-19 10:06:39 +00:00
|
|
|
#include "nsPrintSettingsService.h"
|
2007-01-11 21:54:29 +00:00
|
|
|
|
2017-12-19 11:05:37 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace embedding {
|
|
|
|
class PrintData;
|
2015-05-06 18:10:21 +00:00
|
|
|
} // namespace embedding
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2017-12-19 10:42:15 +00:00
|
|
|
class nsPrintSettingsServiceX final : public nsPrintSettingsService {
|
2007-01-11 21:54:29 +00:00
|
|
|
public:
|
2017-12-19 10:42:15 +00:00
|
|
|
nsPrintSettingsServiceX() {}
|
2015-05-06 18:10:21 +00:00
|
|
|
|
2017-12-19 11:05:37 +00:00
|
|
|
/**
|
2016-11-10 01:37:40 +00:00
|
|
|
* These serialize and deserialize methods are not symmetrical in that
|
|
|
|
* printSettingsX != deserialize(serialize(printSettingsX)). This is because
|
|
|
|
* the native print settings stored in the nsPrintSettingsX's NSPrintInfo
|
|
|
|
* object are not fully serialized. Only the values needed for successful
|
|
|
|
* printing are.
|
|
|
|
*/
|
2015-05-06 18:10:21 +00:00
|
|
|
NS_IMETHODIMP SerializeToPrintData(
|
|
|
|
nsIPrintSettings* aSettings, nsIWebBrowserPrint* aWBP,
|
2017-12-19 11:05:37 +00:00
|
|
|
mozilla::embedding::PrintData* data) override;
|
|
|
|
|
2015-05-06 18:10:21 +00:00
|
|
|
NS_IMETHODIMP DeserializeToPrintSettings(
|
|
|
|
const mozilla::embedding::PrintData& data,
|
2017-12-19 11:05:37 +00:00
|
|
|
nsIPrintSettings* settings) override;
|
2015-05-06 18:10:21 +00:00
|
|
|
|
2007-01-11 21:54:29 +00:00
|
|
|
protected:
|
2017-12-19 11:05:37 +00:00
|
|
|
nsresult ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
|
|
|
|
uint32_t aFlags) override;
|
|
|
|
|
|
|
|
nsresult WritePrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
|
|
|
|
uint32_t aFlags) override;
|
|
|
|
|
|
|
|
nsresult _CreatePrintSettings(nsIPrintSettings** _retval) override;
|
2017-10-30 18:14:08 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/* Serialization done in child to be deserialized in the parent */
|
|
|
|
nsresult SerializeToPrintDataChild(nsIPrintSettings* aSettings,
|
|
|
|
nsIWebBrowserPrint* aWBP,
|
|
|
|
mozilla::embedding::PrintData* data);
|
|
|
|
|
|
|
|
/* Serialization done in parent to be deserialized in the child */
|
|
|
|
nsresult SerializeToPrintDataParent(nsIPrintSettings* aSettings,
|
|
|
|
nsIWebBrowserPrint* aWBP,
|
|
|
|
mozilla::embedding::PrintData* data);
|
2007-01-11 21:54:29 +00:00
|
|
|
};
|
|
|
|
|
2017-12-19 10:42:15 +00:00
|
|
|
#endif // nsPrintSettingsServiceX_h
|