2010-11-07 20:13:55 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2010 Haiku, Inc. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Michael Pfeiffer
|
|
|
|
*/
|
2010-11-08 21:43:55 +03:00
|
|
|
#ifndef PRINT_ADD_ON_SERVER_H
|
|
|
|
#define PRINT_ADD_ON_SERVER_H
|
2010-11-07 20:13:55 +03:00
|
|
|
|
|
|
|
|
|
|
|
#include <Directory.h>
|
|
|
|
#include <Entry.h>
|
|
|
|
#include <Message.h>
|
|
|
|
#include <Messenger.h>
|
|
|
|
#include <Path.h>
|
|
|
|
#include <String.h>
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
|
2010-11-08 21:43:55 +03:00
|
|
|
class PrintAddOnServer
|
2010-11-07 20:13:55 +03:00
|
|
|
{
|
|
|
|
public:
|
2010-11-08 21:43:55 +03:00
|
|
|
PrintAddOnServer(const char* driver);
|
|
|
|
virtual ~PrintAddOnServer();
|
2010-11-07 20:13:55 +03:00
|
|
|
|
|
|
|
status_t AddPrinter(const char* spoolFolderName);
|
|
|
|
status_t ConfigPage(BDirectory* spoolFolder,
|
|
|
|
BMessage* settings);
|
|
|
|
status_t ConfigJob(BDirectory* spoolFolder,
|
|
|
|
BMessage* settings);
|
|
|
|
status_t DefaultSettings(BDirectory* spoolFolder,
|
|
|
|
BMessage* settings);
|
|
|
|
status_t TakeJob(const char* spoolFile,
|
|
|
|
BDirectory* spoolFolder);
|
|
|
|
|
|
|
|
static status_t FindPathToDriver(const char* driver, BPath* path);
|
|
|
|
|
|
|
|
private:
|
|
|
|
const char* Driver() const;
|
|
|
|
|
|
|
|
status_t Launch(BMessenger& messenger);
|
|
|
|
bool IsLaunched();
|
|
|
|
void Quit();
|
|
|
|
|
|
|
|
void AddDirectory(BMessage& message, const char* name,
|
|
|
|
BDirectory* directory);
|
|
|
|
void AddEntryRef(BMessage& message, const char* name,
|
|
|
|
const entry_ref* entryRef);
|
|
|
|
status_t SendRequest(BMessage& request, BMessage& reply);
|
|
|
|
status_t GetResult(BMessage& reply);
|
|
|
|
status_t GetResultAndUpdateSettings(BMessage& reply,
|
|
|
|
BMessage* settings);
|
|
|
|
|
|
|
|
BString fDriver;
|
|
|
|
status_t fLaunchStatus;
|
|
|
|
BMessenger fMessenger;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|