1/*
2 * Copyright 2005-2013, Haiku.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Axel Dörfler, axeld@pinc-software.de
7 */
8#ifndef WORKSPACE_H
9#define WORKSPACE_H
10
11
12#include <InterfaceDefs.h>
13
14
15class Desktop;
16class Window;
17
18
19/*!	Workspace objects are intended to be short-lived. You create them while
20	already holding a lock to the Desktop read-write lock and then you can use
21	them to query information, and then you destroy them again, for example by
22	letting them go out of scope.
23*/
24class Workspace {
25public:
26								Workspace(Desktop& desktop, int32 index,
27									bool readOnly = false);
28								~Workspace();
29
30			const rgb_color&	Color() const;
31			void				SetColor(const rgb_color& color,
32									bool makeDefault);
33			bool				IsCurrent() const
34									{ return fCurrentWorkspace; }
35
36			status_t			GetNextWindow(Window*& _window,
37									BPoint& _leftTop);
38			status_t			GetPreviousWindow(Window*& _window,
39									BPoint& _leftTop);
40			void				RewindWindows();
41
42	class Private;
43
44private:
45			Workspace::Private&	fWorkspace;
46			Desktop&			fDesktop;
47			Window*				fCurrent;
48			bool				fCurrentWorkspace;
49};
50
51
52#endif	/* WORKSPACE_H */
53