1 /* 2 * Copyright 2010 Wim van der Meer <WPJvanderMeer@gmail.com> 3 * Copyright Karsten Heimrich, host.haiku@gmx.de. 4 * All rights reserved. Distributed under the terms of the MIT License. 5 * 6 * Authors: 7 * Karsten Heimrich 8 * Fredrik Modéen 9 * Wim van der Meer 10 */ 11 #ifndef SCREENSHOT_WINDOW_H 12 #define SCREENSHOT_WINDOW_H 13 14 15 #include <String.h> 16 #include <TranslationDefs.h> 17 #include <TranslatorFormats.h> 18 #include <Window.h> 19 20 21 class BBitmap; 22 class BCheckBox; 23 class BFilePanel; 24 class BMenu; 25 class BPath; 26 class BTextControl; 27 class BTextView; 28 29 class PreviewView; 30 class Utility; 31 32 33 class ScreenshotWindow : public BWindow { 34 public: 35 ScreenshotWindow(const Utility& utility, 36 bool silent, bool clipboard); 37 ~ScreenshotWindow(); 38 39 void MessageReceived(BMessage* message); 40 void Quit(); 41 42 private: 43 void _NewScreenshot(bool silent = false, 44 bool clipboard = false); 45 void _UpdatePreviewPanel(); 46 void _DisallowChar(BTextView* textView); 47 void _SetupOutputPathMenu(const BMessage& settings); 48 void _AddItemToPathMenu(const char* path, 49 BString& label, int32 index, bool markItem); 50 void _UpdateFilenameSelection(); 51 void _SetupTranslatorMenu(); 52 status_t _SaveScreenshot(); 53 void _ShowSettings(bool activate); 54 BString _FindValidFileName(const char* name); 55 BPath _GetDirectory(); 56 void _ReadSettings(); 57 void _WriteSettings(); 58 59 const Utility& fUtility; 60 61 PreviewView* fPreview; 62 BCheckBox* fActiveWindow; 63 BTextControl* fDelayControl; 64 BCheckBox* fWindowBorder; 65 BCheckBox* fShowCursor; 66 BTextControl* fNameControl; 67 BMenu* fTranslatorMenu; 68 BMenu* fOutputPathMenu; 69 BBitmap* fScreenshot; 70 BFilePanel* fOutputPathPanel; 71 BMenuItem* fLastSelectedPath; 72 BWindow* fSettingsWindow; 73 74 bigtime_t fDelay; 75 bool fIncludeBorder; 76 bool fIncludeCursor; 77 bool fGrabActiveWindow; 78 BString fOutputFilename; 79 BString fExtension; 80 int32 fImageFileType; 81 }; 82 83 84 #endif // SCREENSHOT_WINDOW_H 85