1 // Copyright (c) 2014, Thomas Goyne <plorkyeran@aegisub.org> 2 // 3 // Permission to use, copy, modify, and distribute this software for any 4 // purpose with or without fee is hereby granted, provided that the above 5 // copyright notice and this permission notice appear in all copies. 6 // 7 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 // 15 // Aegisub Project http://www.aegisub.org/ 16 17 #include <libaegisub/color.h> 18 19 #include <functional> 20 #include <string> 21 22 class AssFile; 23 class AsyncVideoProvider; 24 class wxArrayInt; 25 class wxArrayString; 26 class wxWindow; 27 namespace agi { struct Context; } 28 struct ResampleSettings; 29 30 /// @brief Get a color from the user via a color picker dialog 31 /// @param parent Parent window 32 /// @param original Initial color to select 33 /// @param alpha Include controls for alpha 34 /// @param callback Function called whenever the selected color changes 35 /// @return Did the user accept the new color? 36 bool GetColorFromUser(wxWindow *parent, agi::Color original, bool alpha, std::function<void (agi::Color)> callback); 37 38 /// Ask the user to pick an autosaved file to open 39 /// @return Path to file or empty string if canceled 40 std::string PickAutosaveFile(wxWindow *parent); 41 42 /// @brief Check whether a newer version is available and report to the user if there is 43 /// @param interactive If true, always check and report all results, both success and failure. 44 /// If false, only check if auto-checking is enabled, and only report if a 45 /// new version actually exists. 46 void PerformVersionCheck(bool interactive); 47 48 /// Ask the user to pick settings for a script resampling 49 /// @return Does the user want to proceed with the resampling? 50 bool PromptForResampleSettings(agi::Context *c, ResampleSettings &settings); 51 52 /// Update the video properties for a newly opened video, possibly prompting the user about what to do 53 void UpdateVideoProperties(AssFile *file, const AsyncVideoProvider *new_provider, wxWindow *parent); 54 55 int GetSelectedChoices(wxWindow *parent, wxArrayInt& selections, wxString const& message, wxString const& caption, wxArrayString const& choices); 56 57 std::string CreateDummyVideo(wxWindow *parent); 58 59 void ShowAboutDialog(wxWindow *parent); 60 void ShowAttachmentsDialog(wxWindow *parent, AssFile *file); 61 void ShowSelectLinesDialog(agi::Context *c); 62 void ShowExportDialog(agi::Context *c); 63 void ShowPropertiesDialog(agi::Context *c); 64 void ShowFontsCollectorDialog(agi::Context *c); 65 bool ShowPlainTextImportDialog(); 66 void ShowKanjiTimerDialog(agi::Context *c); 67 bool ShowPasteOverDialog(wxWindow *parent); 68 void ShowSpellcheckerDialog(agi::Context *c); 69 void ShowShiftTimesDialog(agi::Context *c); 70 void ShowStyleManagerDialog(agi::Context *c); 71 void ShowTimingProcessorDialog(agi::Context *c); 72 void ShowJumpToDialog(agi::Context *c); 73 void ShowVideoDetailsDialog(agi::Context *c); 74 void ShowLogWindow(agi::Context *c); 75 void ShowAutomationDialog(agi::Context *c); 76