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 #include <String.h> 12 13 14 class BBitmap; 15 16 17 // Command constant for sending utility data to the GUI app 18 const int32 SS_UTILITY_DATA = 'SSUD'; 19 20 21 class Utility { 22 public: 23 Utility(); 24 ~Utility(); 25 26 void CopyToClipboard(const BBitmap& screenshot) const; 27 status_t Save(BBitmap** screenshot, const char* fileName, 28 uint32 imageType) const; 29 BBitmap* MakeScreenshot(bool includeCursor, bool activeWindow, 30 bool includeBorder) const; 31 BString GetFileNameExtension(uint32 imageType) const; 32 33 BBitmap* wholeScreen; 34 BBitmap* cursorBitmap; 35 BBitmap* cursorAreaBitmap; 36 BPoint cursorPosition; 37 BRect activeWindowFrame; 38 BRect tabFrame; 39 float borderSize; 40 41 static const char* sDefaultFileNameBase; 42 43 private: 44 void _MakeTabSpaceTransparent(BBitmap* screenshot, 45 BRect frame) const; 46 BString _GetMimeString(uint32 imageType) const; 47 }; 48 49 50 #endif // UTILITY_H 51