vfs: check userland buffers before reading them.
[haiku.git] / headers / private / print / Printer.h
blobf2f64a4a9b7f16d6a34d9d9d98994d4fcb47a5e7
1 /*
2 * Copyright 2008 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Julun, <host.haiku@gmx.de
7 */
8 #ifndef _PRINTER_H_
9 #define _PRINTER_H_
12 #include <Directory.h>
13 #include <Entry.h>
14 #include <image.h>
15 #include <Message.h>
16 #include <Node.h>
17 #include <Path.h>
18 #include <String.h>
21 namespace BPrivate {
22 namespace Print {
25 class BPrinter {
26 public:
27 BPrinter();
28 BPrinter(const BEntry& entry);
29 BPrinter(const BPrinter& printer);
30 BPrinter(const node_ref& nodeRef);
31 BPrinter(const entry_ref& entryRef);
32 BPrinter(const BDirectory& directory);
33 ~BPrinter();
35 status_t SetTo(const BEntry& entry);
36 status_t SetTo(const node_ref& nodeRef);
37 status_t SetTo(const entry_ref& entryRef);
38 status_t SetTo(const BDirectory& directory);
39 void Unset();
41 bool IsValid() const;
42 status_t InitCheck() const;
44 bool IsFree() const;
45 bool IsDefault() const;
46 bool IsShareable() const;
48 BString Name() const;
49 BString State() const;
50 BString Driver() const;
51 BString Comments() const;
52 BString Transport() const;
53 BString TransportAddress() const;
54 status_t DefaultSettings(BMessage& settings);
56 status_t StartWatching(const BMessenger& listener);
57 void StopWatching();
59 BPrinter& operator=(const BPrinter& printer);
60 bool operator==(const BPrinter& printer) const;
61 bool operator!=(const BPrinter& printer) const;
63 private:
64 status_t _Configure() const;
65 status_t _ConfigureJob(BMessage& settings);
66 status_t _ConfigurePage(BMessage& settings);
68 BPath _DriverPath() const;
69 image_id _LoadDriver() const;
70 void _AddPrinterName(BMessage& settings);
71 BString _ReadAttribute(const char* attribute) const;
73 private:
74 BMessenger* fListener;
75 entry_ref fPrinterEntryRef;
79 } // namespace Print
80 } // namespace BPrivate
83 #endif // _PRINTER_H_