1a75264d3SKarsten Heimrich /* 22ec6b3cfSWim van der Meer * Copyright 2010 Wim van der Meer <WPJvanderMeer@gmail.com> 32ec6b3cfSWim van der Meer * Copyright Karsten Heimrich, host.haiku@gmx.de. 42ec6b3cfSWim van der Meer * All rights reserved. Distributed under the terms of the MIT License. 5689b99a7SFredrik Modeen * 6689b99a7SFredrik Modeen * Authors: 7689b99a7SFredrik Modeen * Karsten Heimrich 8689b99a7SFredrik Modeen * Fredrik Modéen 92ec6b3cfSWim van der Meer * Wim van der Meer 10a75264d3SKarsten Heimrich */ 11689b99a7SFredrik Modeen #ifndef SCREENSHOT_WINDOW_H 12689b99a7SFredrik Modeen #define SCREENSHOT_WINDOW_H 13689b99a7SFredrik Modeen 14689b99a7SFredrik Modeen 15fc3bed05SKarsten Heimrich #include <String.h> 16c9ec9c72SStephan Aßmus #include <TranslationDefs.h> 17689b99a7SFredrik Modeen #include <TranslatorFormats.h> 182ec6b3cfSWim van der Meer #include <Window.h> 19a75264d3SKarsten Heimrich 20a75264d3SKarsten Heimrich 21a75264d3SKarsten Heimrich class BBitmap; 22a75264d3SKarsten Heimrich class BCheckBox; 23fc3bed05SKarsten Heimrich class BFilePanel; 24a75264d3SKarsten Heimrich class BMenu; 252ec6b3cfSWim van der Meer class BPath; 26a75264d3SKarsten Heimrich class BTextControl; 27a75264d3SKarsten Heimrich class BTextView; 282ec6b3cfSWim van der Meer 292ec6b3cfSWim van der Meer class Utility; 30a75264d3SKarsten Heimrich 31a75264d3SKarsten Heimrich 32a75264d3SKarsten Heimrich class ScreenshotWindow : public BWindow { 33a75264d3SKarsten Heimrich public: 340c9f5a02SWim van der Meer ScreenshotWindow(const Utility& utility, 350c9f5a02SWim van der Meer bool silent, bool clipboard); 362ec6b3cfSWim van der Meer ~ScreenshotWindow(); 37a75264d3SKarsten Heimrich 382ec6b3cfSWim van der Meer void MessageReceived(BMessage* message); 392ec6b3cfSWim van der Meer void Quit(); 40a75264d3SKarsten Heimrich 41a75264d3SKarsten Heimrich private: 420c9f5a02SWim van der Meer void _NewScreenshot(bool silent = false, 43ea810bf6SJohn Scipione bool clipboard = false, 44ea810bf6SJohn Scipione bool ignoreDelay = false); 452ec6b3cfSWim van der Meer void _UpdatePreviewPanel(); 4608c7fa9dSStephan Aßmus void _DisallowChar(BTextView* textView); 472ec6b3cfSWim van der Meer void _SetupOutputPathMenu(const BMessage& settings); 48ae1cc083SKarsten Heimrich void _AddItemToPathMenu(const char* path, 495ff76056SFreeman Lou BString& label, int32 index, bool markItem, 505ff76056SFreeman Lou uint32 shortcutKey = 0); 510d84b313SStephan Aßmus void _UpdateFilenameSelection(); 522ec6b3cfSWim van der Meer void _SetupTranslatorMenu(); 53*b285b436SGabriel Maia void _DisplaySaveError(BString _message); 54bb6301b2SPhilippe Saint-Pierre status_t _SaveScreenshot(); 557235f868SWim van der Meer void _ShowSettings(bool activate); 562ec6b3cfSWim van der Meer BString _FindValidFileName(const char* name); 572ec6b3cfSWim van der Meer BPath _GetDirectory(); 582ec6b3cfSWim van der Meer void _ReadSettings(); 592ec6b3cfSWim van der Meer void _WriteSettings(); 609f07ffa3SKarsten Heimrich 612ec6b3cfSWim van der Meer const Utility& fUtility; 62c9ec9c72SStephan Aßmus 638522ef24SAdam Hartford BView* fPreview; 642ec6b3cfSWim van der Meer BCheckBox* fActiveWindow; 65a75264d3SKarsten Heimrich BTextControl* fDelayControl; 66a75264d3SKarsten Heimrich BCheckBox* fWindowBorder; 672ec6b3cfSWim van der Meer BCheckBox* fShowCursor; 68a75264d3SKarsten Heimrich BTextControl* fNameControl; 69a75264d3SKarsten Heimrich BMenu* fTranslatorMenu; 70a75264d3SKarsten Heimrich BMenu* fOutputPathMenu; 71a75264d3SKarsten Heimrich BBitmap* fScreenshot; 72fc3bed05SKarsten Heimrich BFilePanel* fOutputPathPanel; 73fc3bed05SKarsten Heimrich BMenuItem* fLastSelectedPath; 747235f868SWim van der Meer BWindow* fSettingsWindow; 75a75264d3SKarsten Heimrich 76a75264d3SKarsten Heimrich bigtime_t fDelay; 77a75264d3SKarsten Heimrich bool fIncludeBorder; 782ec6b3cfSWim van der Meer bool fIncludeCursor; 79a75264d3SKarsten Heimrich bool fGrabActiveWindow; 80362b036dSAxel Dörfler BString fOutputFilename; 816478aa27SPhilippe Saint-Pierre BString fExtension; 82a75264d3SKarsten Heimrich int32 fImageFileType; 83a75264d3SKarsten Heimrich }; 84689b99a7SFredrik Modeen 852ec6b3cfSWim van der Meer 862ec6b3cfSWim van der Meer #endif // SCREENSHOT_WINDOW_H 87