Bug 144114 part 3 - Clean up the headers of the nsPrintSettingsService subclasses. r=bobowen
MozReview-Commit-ID: 17rmYnmwN1p
--- a/widget/cocoa/nsPrintSettingsServiceX.h
+++ b/widget/cocoa/nsPrintSettingsServiceX.h
@@ -3,47 +3,52 @@
* 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 nsPrintSettingsServiceX_h_
#define nsPrintSettingsServiceX_h_
#include "nsPrintSettingsService.h"
-namespace mozilla
-{
-namespace embedding
-{
- class PrintData;
+namespace mozilla {
+namespace embedding {
+class PrintData;
} // namespace embedding
} // namespace mozilla
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
* object are not fully serialized. Only the values needed for successful
* printing are.
*/
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 */
nsresult SerializeToPrintDataChild(nsIPrintSettings* aSettings,
nsIWebBrowserPrint* aWBP,
mozilla::embedding::PrintData* data);
/* Serialization done in parent to be deserialized in the child */
--- a/widget/gtk/nsPrintSettingsServiceGTK.h
+++ b/widget/gtk/nsPrintSettingsServiceGTK.h
@@ -4,34 +4,31 @@
* 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 nsPrintSettingsServiceGTK_h__
#define nsPrintSettingsServiceGTK_h__
#include "nsPrintSettingsService.h"
-namespace mozilla
-{
-namespace embedding
-{
- class PrintData;
+namespace mozilla {
+namespace embedding {
+class PrintData;
} // namespace embedding
} // namespace mozilla
class nsPrintSettingsServiceGTK final : public nsPrintSettingsService
{
public:
nsPrintSettingsServiceGTK() {}
virtual ~nsPrintSettingsServiceGTK() {}
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;
- virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval);
+ nsresult _CreatePrintSettings(nsIPrintSettings** _retval) override;
};
-
-
#endif /* nsPrintSettingsServiceGTK_h__ */
--- a/widget/nsPrintSettingsService.h
+++ b/widget/nsPrintSettingsService.h
@@ -30,16 +30,21 @@ public:
/**
* method Init
* Initializes member variables. Every consumer that does manual
* creation (instead of do_CreateInstance) needs to call this method
* immediately after instantiation.
*/
virtual nsresult Init();
+private:
+ // Copying is not supported.
+ nsPrintSettingsService(const nsPrintSettingsService& x) = delete;
+ nsPrintSettingsService& operator=(const nsPrintSettingsService& x) = delete;
+
protected:
virtual ~nsPrintSettingsService() {}
void ReadBitFieldPref(const char * aPrefId, int32_t anOption);
void WriteBitFieldPref(const char * aPrefId, int32_t anOption);
void ReadJustification(const char * aPrefId, int16_t& aJust,
int16_t aInitValue);
void WriteJustification(const char * aPrefId, int16_t aJust);
@@ -79,16 +84,11 @@ protected:
* @return printer settings instance
*/
virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval);
// Members
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__ */
--- a/widget/windows/nsPrintSettingsServiceWin.h
+++ b/widget/windows/nsPrintSettingsServiceWin.h
@@ -16,18 +16,17 @@ class nsIWebBrowserPrint;
class nsPrintSettingsServiceWin final : public nsPrintSettingsService
{
public:
nsPrintSettingsServiceWin() {}
virtual ~nsPrintSettingsServiceWin() {}
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;
- virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval);
+ nsresult _CreatePrintSettings(nsIPrintSettings **_retval) override;
};
-
-
#endif /* nsPrintSettingsServiceWin_h__ */