xref: /haiku/src/apps/screenshot/Utility.h (revision 8a990d5228b2d1099e3062180532ba709dfeef6d)
1 /*
2  * Copyright 2010 Wim van der Meer <WPJvanderMeer@gmail.com>
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef UTILITY_H
6 #define UTILITY_H
7 
8 
9 #include <Point.h>
10 #include <Rect.h>
11 
12 
13 class BBitmap;
14 
15 
16 // Command constant for sending utility data to the GUI app
17 const int32 SS_UTILITY_DATA = 'SSUD';
18 
19 
20 class Utility {
21 public:
22 						Utility();
23 						~Utility();
24 
25 			void		CopyToClipboard(const BBitmap& screenshot) const;
26 			status_t	Save(BBitmap** screenshot, const char* fileName,
27 							uint32 imageType) const;
28 			BBitmap*	MakeScreenshot(bool includeCursor, bool activeWindow,
29 							bool includeBorder) const;
30 			const char*	GetFileNameExtension(uint32 imageType) const;
31 
32 			BBitmap*	wholeScreen;
33 			BBitmap*	cursorBitmap;
34 			BBitmap*	cursorAreaBitmap;
35 			BPoint		cursorPosition;
36 			BRect		activeWindowFrame;
37 			BRect		tabFrame;
38 			float		borderSize;
39 
40 	static	const char*	sDefaultFileNameBase;
41 
42 private:
43 			void		_MakeTabSpaceTransparent(BBitmap* screenshot,
44 							BRect frame) const;
45 			const char*	_GetMimeString(uint32 imageType) const;
46 };
47 
48 
49 #endif // UTILITY_H
50