1 /* 2 * gnote 3 * 4 * Copyright (C) 2015-2016,2019 Aurimas Cernius 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef _MAIN_WINDOW_ACTION_HPP_ 21 #define _MAIN_WINDOW_ACTION_HPP_ 22 23 #include <giomm/simpleaction.h> 24 25 26 namespace gnote { 27 28 class MainWindowAction 29 : public Gio::SimpleAction 30 { 31 public: 32 typedef Glib::RefPtr<MainWindowAction> Ptr; 33 34 static Ptr create(const Glib::ustring & name); 35 static Ptr create(const Glib::ustring & name, bool state); 36 static Ptr create(const Glib::ustring & name, int state); 37 static Ptr create(const Glib::ustring & name, const Glib::ustring & state); 38 set_state(const Glib::VariantBase & value)39 void set_state(const Glib::VariantBase & value) 40 { 41 Gio::SimpleAction::set_state(value); 42 } is_modifying(bool modifying)43 void is_modifying(bool modifying) 44 { 45 m_modifying = modifying; 46 } is_modifying() const47 bool is_modifying() const 48 { 49 return m_modifying; 50 } 51 protected: 52 MainWindowAction(const Glib::ustring & name); 53 MainWindowAction(const Glib::ustring & name, bool state); 54 MainWindowAction(const Glib::ustring & name, int state); 55 MainWindowAction(const Glib::ustring & name, const Glib::ustring & state); 56 private: 57 bool m_modifying; 58 }; 59 60 } 61 62 #endif 63 64