1/*
2 * Copyright 2008, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Ithamar R. Adema
7 */
8#ifndef TRANSPORT_H
9#define TRANSPORT_H
10
11class Transport;
12
13#include <FindDirectory.h>
14#include <Handler.h>
15#include <String.h>
16#include <Path.h>
17
18#include <ObjectList.h>
19
20class Transport : public BHandler
21{
22	typedef BHandler Inherited;
23public:
24	Transport(const BPath& path);
25	~Transport();
26
27	BString Name() const { return fPath.Leaf(); }
28
29	status_t ListAvailablePorts(BMessage* msg);
30
31	static status_t Scan(directory_which which);
32
33	static Transport* Find(const BString& name);
34	static void Remove(Transport* transport);
35	static Transport* At(int32 idx);
36	static int32 CountTransports();
37
38	void MessageReceived(BMessage* msg);
39
40		// Scripting support, see Printer.Scripting.cpp
41	status_t GetSupportedSuites(BMessage* msg);
42	void HandleScriptingCommand(BMessage* msg);
43	BHandler* ResolveSpecifier(BMessage* msg, int32 index, BMessage* spec,
44								int32 form, const char* prop);
45
46private:
47	BPath fPath;
48	long fImageID;
49	int fFeatures;
50
51	static BObjectList<Transport> sTransports;
52};
53
54#endif
55