2 * Copyright 2001-2015, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
9 #ifndef _PRINT_SERVER_APP_H
10 #define _PRINT_SERVER_APP_H
19 #include "FolderWatcher.h"
20 #include "ResourceManager.h"
28 // The global BLocker for synchronisation.
29 extern BLocker
*gLock
;
32 // The print_server application.
33 class PrintServerApp
: public BServer
, public FolderListener
{
35 typedef BServer Inherited
;
38 PrintServerApp(status_t
* error
);
44 virtual bool QuitRequested();
45 virtual void MessageReceived(BMessage
* msg
);
46 void NotifyPrinterDeletion(Printer
* printer
);
48 // Scripting support, see PrintServerApp.Scripting.cpp
49 virtual status_t
GetSupportedSuites(BMessage
* msg
);
50 void HandleScriptingCommand(BMessage
* msg
);
51 Printer
* GetPrinterFromSpecifier(BMessage
* msg
);
52 Transport
* GetTransportFromSpecifier(BMessage
* msg
);
53 virtual BHandler
* ResolveSpecifier(BMessage
* msg
, int32 index
,
54 BMessage
* specifier
, int32 form
,
55 const char* property
);
58 bool OpenSettings(BFile
& file
, const char* name
,
63 status_t
SetupPrinterList();
65 void HandleSpooledJobs();
67 status_t
SelectPrinter(const char* printerName
);
68 status_t
CreatePrinter(const char* printerName
,
69 const char* driverName
,
70 const char* connection
,
71 const char* transportName
,
72 const char* transportPath
);
74 void RegisterPrinter(BDirectory
* node
);
75 void UnregisterPrinter(Printer
* printer
);
78 void EntryCreated(node_ref
* node
, entry_ref
* entry
);
79 void EntryRemoved(node_ref
* node
);
80 void AttributeChanged(node_ref
* node
);
82 status_t
StoreDefaultPrinter();
83 status_t
RetrieveDefaultPrinter();
85 status_t
FindPrinterNode(const char* name
, BNode
& node
);
87 // "Classic" BeOS R5 support, see PrintServerApp.R5.cpp
88 static status_t
async_thread(void* data
);
89 void AsyncHandleMessage(BMessage
* msg
);
90 void Handle_BeOSR5_Message(BMessage
* msg
);
93 ResourceManager fResourceManager
;
94 Printer
* fDefaultPrinter
;
98 sem_id fHasReferences
;
100 bool fUseConfigWindow
;
101 FolderWatcher
* fFolder
;
105 #endif // _PRINT_SERVER_APP_H