1 /* 2 * Copyright (C) 2013 Graeme Gott <graeme@gottcode.org> 3 * 4 * This library is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this library. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef WHISKERMENU_ICON_SIZE_H 19 #define WHISKERMENU_ICON_SIZE_H 20 21 #include <string> 22 #include <vector> 23 24 #include <glib.h> 25 26 extern "C" 27 { 28 #include <libxfce4util/libxfce4util.h> 29 } 30 31 namespace WhiskerMenu 32 { 33 34 class IconSize 35 { 36 public: 37 enum Size 38 { 39 NONE = -1, 40 Smallest, 41 Smaller, 42 Small, 43 Normal, 44 Large, 45 Larger, 46 Largest 47 }; 48 49 explicit IconSize(const gchar* property, const int size); 50 51 int get_size() const; 52 53 static std::vector<std::string> get_strings(); 54 55 operator int() const 56 { 57 return m_size; 58 } 59 60 IconSize& operator=(const int size) 61 { 62 set(size); 63 return *this; 64 } 65 66 void load(XfceRc* rc); 67 void save(XfceRc* rc); 68 69 private: 70 void set(int size); 71 72 private: 73 const gchar* const m_property; 74 int m_size; 75 }; 76 77 } 78 79 #endif // WHISKERMENU_ICON_SIZE_H 80