Bug 144114 part 3 - Clean up the headers of the nsPrintSettingsService subclasses. r=bobowen

* * *
[mq]: dtor

MozReview-Commit-ID: 8ghrXxeKiHF
This commit is contained in:
Jonathan Watt 2017-12-19 11:05:37 +00:00
parent f9157dfa53
commit f38fde0cc7
7 changed files with 41 additions and 57 deletions

View File

@ -12,7 +12,6 @@ class nsPrintSettingsServiceAndroid final : public nsPrintSettingsService
{
public:
nsPrintSettingsServiceAndroid() {}
virtual ~nsPrintSettingsServiceAndroid() {}
nsresult _CreatePrintSettings(nsIPrintSettings** _retval) override;
};

View File

@ -8,11 +8,9 @@
#include "nsPrintSettingsService.h"
namespace mozilla
{
namespace embedding
{
class PrintData;
namespace mozilla {
namespace embedding {
class PrintData;
} // namespace embedding
} // namespace mozilla
@ -20,9 +18,8 @@ class nsPrintSettingsServiceX final : public nsPrintSettingsService
{
public:
nsPrintSettingsServiceX() {}
virtual ~nsPrintSettingsServiceX() {}
/*
/**
* 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
@ -31,14 +28,21 @@ public:
*/
NS_IMETHODIMP SerializeToPrintData(nsIPrintSettings* aSettings,
nsIWebBrowserPrint* aWBP,
mozilla::embedding::PrintData* data);
mozilla::embedding::PrintData* data) override;
NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data,
nsIPrintSettings* settings);
nsIPrintSettings* settings) override;
protected:
nsresult _CreatePrintSettings(nsIPrintSettings **_retval);
nsresult ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName, uint32_t aFlags);
nsresult WritePrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName, uint32_t aFlags);
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;
private:
/* Serialization done in child to be deserialized in the parent */

View File

@ -9,11 +9,9 @@
#include "nsPrintSettingsService.h"
namespace mozilla
{
namespace embedding
{
class PrintData;
namespace mozilla {
namespace embedding {
class PrintData;
} // namespace embedding
} // namespace mozilla
@ -21,17 +19,15 @@ class nsPrintSettingsServiceGTK final : public nsPrintSettingsService
{
public:
nsPrintSettingsServiceGTK() {}
virtual ~nsPrintSettingsServiceGTK() {}
NS_IMETHODIMP SerializeToPrintData(nsIPrintSettings* aSettings,
nsIWebBrowserPrint* aWBP,
mozilla::embedding::PrintData* data);
NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data,
nsIPrintSettings* settings);
mozilla::embedding::PrintData* data) override;
virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval);
NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data,
nsIPrintSettings* settings) override;
virtual nsresult _CreatePrintSettings(nsIPrintSettings** _retval) override;
};
#endif // nsPrintSettingsServiceGTK_h

View File

@ -12,10 +12,6 @@
NS_IMPL_ISUPPORTS(nsPrintSettings, nsIPrintSettings)
/** ---------------------------------------------------
* See documentation in nsPrintSettingsImpl.h
* @update 6/21/00 dwc
*/
nsPrintSettings::nsPrintSettings() :
mPrintOptions(0L),
mPrintRange(kRangeAllPages),
@ -63,19 +59,11 @@ nsPrintSettings::nsPrintSettings() :
}
/** ---------------------------------------------------
* See documentation in nsPrintSettingsImpl.h
* @update 6/21/00 dwc
*/
nsPrintSettings::nsPrintSettings(const nsPrintSettings& aPS)
{
*this = aPS;
}
/** ---------------------------------------------------
* See documentation in nsPrintSettingsImpl.h
* @update 6/21/00 dwc
*/
nsPrintSettings::~nsPrintSettings()
{
}

View File

@ -666,10 +666,6 @@ nsPrintSettingsService::ReadPrefs(nsIPrintSettings* aPS,
return NS_OK;
}
/** ---------------------------------------------------
* See documentation in nsPrintSettingsService.h
* @update 1/12/01 rods
*/
nsresult
nsPrintSettingsService::WritePrefs(nsIPrintSettings* aPS,
const nsAString& aPrinterName,

View File

@ -35,6 +35,11 @@ public:
*/
virtual nsresult Init();
private:
// Copying is not supported.
nsPrintSettingsService(const nsPrintSettingsService& x) = delete;
nsPrintSettingsService& operator=(const nsPrintSettingsService& x) = delete;
protected:
virtual ~nsPrintSettingsService() {}
@ -59,17 +64,20 @@ protected:
* @param aPrinterName the name of the printer for which to read prefs
* @param aFlags flag specifying which prefs to read
*/
virtual nsresult ReadPrefs(nsIPrintSettings* aPS, const nsAString&
aPrinterName, uint32_t aFlags);
virtual nsresult ReadPrefs(nsIPrintSettings* aPS,
const nsAString& aPrinterName,
uint32_t aFlags);
/**
* method WritePrefs
* @param aPS a pointer to the printer settings
* @param aPrinterName the name of the printer for which to write prefs
* @param aFlags flag specifying which prefs to read
*/
virtual nsresult WritePrefs(nsIPrintSettings* aPS, const nsAString& aPrefName,
virtual nsresult WritePrefs(nsIPrintSettings* aPS,
const nsAString& aPrinterName,
uint32_t aFlags);
const char* GetPrefName(const char * aPrefName,
const char* GetPrefName(const char* aPrefName,
const nsAString& aPrinterName);
/**
@ -84,11 +92,6 @@ protected:
nsCOMPtr<nsIPrintSettings> mGlobalPrintSettings;
nsCString mPrefName;
private:
// These are not supported and are not implemented!
nsPrintSettingsService(const nsPrintSettingsService& x) = delete;
nsPrintSettingsService& operator=(const nsPrintSettingsService& x) = delete;
};
#endif // nsPrintSettingsService_h

View File

@ -17,17 +17,15 @@ class nsPrintSettingsServiceWin final : public nsPrintSettingsService
{
public:
nsPrintSettingsServiceWin() {}
virtual ~nsPrintSettingsServiceWin() {}
NS_IMETHODIMP SerializeToPrintData(nsIPrintSettings* aSettings,
nsIWebBrowserPrint* aWBP,
mozilla::embedding::PrintData* data);
NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data,
nsIPrintSettings* settings);
mozilla::embedding::PrintData* data) override;
virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval);
NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data,
nsIPrintSettings* settings) override;
nsresult _CreatePrintSettings(nsIPrintSettings** _retval) override;
};
#endif // nsPrintSettingsServiceWin_h