1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsPrintOptionsImpl_h__
8 #define nsPrintOptionsImpl_h__
11 #include "nsIPrintOptions.h"
12 #include "nsIPrintSettingsService.h"
17 * Class nsPrintOptions
19 class nsPrintOptions
: public nsIPrintOptions
,
20 public nsIPrintSettingsService
24 NS_DECL_NSIPRINTOPTIONS
25 NS_DECL_NSIPRINTSETTINGSSERVICE
29 * Initializes member variables. Every consumer that does manual
30 * creation (instead of do_CreateInstance) needs to call this method
31 * immediately after instantiation.
33 virtual nsresult
Init();
36 virtual ~nsPrintOptions();
39 void ReadBitFieldPref(const char * aPrefId
, int32_t anOption
);
40 void WriteBitFieldPref(const char * aPrefId
, int32_t anOption
);
41 void ReadJustification(const char * aPrefId
, int16_t& aJust
,
43 void WriteJustification(const char * aPrefId
, int16_t aJust
);
44 void ReadInchesToTwipsPref(const char * aPrefId
, int32_t& aTwips
,
45 const char * aMarginPref
);
46 void WriteInchesFromTwipsPref(const char * aPrefId
, int32_t aTwips
);
47 void ReadInchesIntToTwipsPref(const char * aPrefId
, int32_t& aTwips
,
48 const char * aMarginPref
);
49 void WriteInchesIntFromTwipsPref(const char * aPrefId
, int32_t aTwips
);
51 nsresult
ReadPrefDouble(const char * aPrefId
, double& aVal
);
52 nsresult
WritePrefDouble(const char * aPrefId
, double aVal
);
56 * @param aPS a pointer to the printer settings
57 * @param aPrinterName the name of the printer for which to read prefs
58 * @param aFlags flag specifying which prefs to read
60 virtual nsresult
ReadPrefs(nsIPrintSettings
* aPS
, const nsAString
&
61 aPrinterName
, uint32_t aFlags
);
64 * @param aPS a pointer to the printer settings
65 * @param aPrinterName the name of the printer for which to write prefs
66 * @param aFlags flag specifying which prefs to read
68 virtual nsresult
WritePrefs(nsIPrintSettings
* aPS
, const nsAString
& aPrefName
,
70 const char* GetPrefName(const char * aPrefName
,
71 const nsAString
& aPrinterName
);
74 * method _CreatePrintSettings
75 * May be implemented by the platform-specific derived class
77 * @return printer settings instance
79 virtual nsresult
_CreatePrintSettings(nsIPrintSettings
**_retval
);
82 nsCOMPtr
<nsIPrintSettings
> mGlobalPrintSettings
;
87 // These are not supported and are not implemented!
88 nsPrintOptions(const nsPrintOptions
& x
);
89 nsPrintOptions
& operator=(const nsPrintOptions
& x
);
92 #endif /* nsPrintOptionsImpl_h__ */