The Battle for Wesnoth  1.15.1+dev
screenshot_notification.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2013 - 2018 by Iris Morelle <shadowm2006@gmail.com>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
18 #include "sdl/surface.hpp"
19 
20 namespace gui2
21 {
22 namespace dialogs
23 {
24 
26 {
27 public:
28  /**
29  * Constructor.
30  *
31  * @param path Path to the screenshot file to create.
32  * @param screenshot Screenshot to save.
33  */
34  screenshot_notification(const std::string& path, surface screenshot);
35 
36  /**
37  * The display function.
38  *
39  * See @ref modal_dialog for more information.
40  */
42 
43 private:
44  const std::string path_;
45  const std::string screenshots_dir_path_;
47 
48  void save_screenshot();
49  void keypress_callback(bool& handled, const SDL_Keycode key);
50 
51  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
52  virtual const std::string& window_id() const override;
53 
54  /** Inherited from modal_dialog. */
55  virtual void pre_show(window& window) override;
56 };
57 } // namespace dialogs
58 } // namespace gui2
screenshot_notification(const std::string &path, surface screenshot)
Constructor.
Generic file dialog.
Definition: field-fwd.hpp:22
virtual const std::string & window_id() const override
Inherited from modal_dialog, implemented by REGISTER_DIALOG.
std::string path
Definition: game_config.cpp:39
Various uncategorised dialogs.
const std::string path_
The display function.
virtual void pre_show(window &window) override
Inherited from modal_dialog.
Abstract base class for all modal dialogs.
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:63
void keypress_callback(bool &handled, const SDL_Keycode key)