1a75264d3SKarsten Heimrich /* 2a75264d3SKarsten Heimrich * Copyright Karsten Heimrich, host.haiku@gmx.de. All rights reserved. 3a75264d3SKarsten Heimrich * Distributed under the terms of the MIT License. 4a75264d3SKarsten Heimrich */ 5a75264d3SKarsten Heimrich #include <Window.h> 6a75264d3SKarsten Heimrich 7a75264d3SKarsten Heimrich 8a75264d3SKarsten Heimrich class BBitmap; 9a75264d3SKarsten Heimrich class BBox; 10a75264d3SKarsten Heimrich class BButton; 11a75264d3SKarsten Heimrich class BCardLayout; 12a75264d3SKarsten Heimrich class BCheckBox; 13a75264d3SKarsten Heimrich class BMenu; 14a75264d3SKarsten Heimrich class BRadioButton; 15a75264d3SKarsten Heimrich class BTextControl; 16a75264d3SKarsten Heimrich class BTextView; 17a75264d3SKarsten Heimrich 18a75264d3SKarsten Heimrich 19a75264d3SKarsten Heimrich class ScreenshotWindow : public BWindow { 20a75264d3SKarsten Heimrich public: 21*9f07ffa3SKarsten Heimrich ScreenshotWindow(bigtime_t delay = 0, 22*9f07ffa3SKarsten Heimrich bool includeBorder = false, 23*9f07ffa3SKarsten Heimrich bool includeCursor = false, 24*9f07ffa3SKarsten Heimrich bool grabActiveWindow = false, 25*9f07ffa3SKarsten Heimrich bool showConfigWindow = false, 26*9f07ffa3SKarsten Heimrich bool saveScreenshotSilent = false); 27a75264d3SKarsten Heimrich virtual ~ScreenshotWindow(); 28a75264d3SKarsten Heimrich 29a75264d3SKarsten Heimrich virtual void MessageReceived(BMessage* message); 30a75264d3SKarsten Heimrich 31a75264d3SKarsten Heimrich private: 32a75264d3SKarsten Heimrich void _InitWindow(); 33a75264d3SKarsten Heimrich void _SetupFirstLayoutItem(BCardLayout* layout); 34a75264d3SKarsten Heimrich void _SetupSecondLayoutItem(BCardLayout* layout); 35a75264d3SKarsten Heimrich void _DisallowChar(BTextView* textView); 36a75264d3SKarsten Heimrich void _CenterAndShow(); 37a75264d3SKarsten Heimrich 38a75264d3SKarsten Heimrich void _TakeScreenshot(); 39a75264d3SKarsten Heimrich status_t _GetActiveWindowFrame(BRect* frame); 40a75264d3SKarsten Heimrich 41*9f07ffa3SKarsten Heimrich void _SaveScreenshotSilent() const; 42*9f07ffa3SKarsten Heimrich 43a75264d3SKarsten Heimrich private: 44a75264d3SKarsten Heimrich BBox* fPreviewBox; 45a75264d3SKarsten Heimrich BRadioButton* fActiveWindow; 46a75264d3SKarsten Heimrich BRadioButton* fWholeDesktop; 47a75264d3SKarsten Heimrich BTextControl* fDelayControl; 48a75264d3SKarsten Heimrich BCheckBox* fWindowBorder; 49a75264d3SKarsten Heimrich BCheckBox* fShowCursor; 50a75264d3SKarsten Heimrich BButton* fBackToSave; 51a75264d3SKarsten Heimrich BButton* fTakeScreenshot; 52a75264d3SKarsten Heimrich BTextControl* fNameControl; 53a75264d3SKarsten Heimrich BMenu* fTranslatorMenu; 54a75264d3SKarsten Heimrich BMenu* fOutputPathMenu; 55a75264d3SKarsten Heimrich BButton* fFinishScreenshot; 56a75264d3SKarsten Heimrich BBitmap* fScreenshot; 57a75264d3SKarsten Heimrich 58a75264d3SKarsten Heimrich bigtime_t fDelay; 59a75264d3SKarsten Heimrich 60a75264d3SKarsten Heimrich bool fIncludeBorder; 61a75264d3SKarsten Heimrich bool fIncludeCursor; 62a75264d3SKarsten Heimrich bool fGrabActiveWindow; 63a75264d3SKarsten Heimrich bool fShowConfigWindow; 64*9f07ffa3SKarsten Heimrich bool fSaveScreenshotSilent; 65a75264d3SKarsten Heimrich 66a75264d3SKarsten Heimrich int32 fTranslator; 67a75264d3SKarsten Heimrich int32 fImageFileType; 68a75264d3SKarsten Heimrich }; 69