edelib 2.1.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

IconTheme.h
1 /*
2 * $Id: IconTheme.h 3441 2012-11-01 20:40:30Z karijes $
3 *
4 * Icon theme
5 * Copyright (c) 2005-2009 edelib authors
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef __EDELIB_ICONTHEME_H__
22 #define __EDELIB_ICONTHEME_H__
23
24 #include "String.h"
25 #include "List.h"
26
27 EDELIB_NS_BEGIN
28
33 enum IconSizes {
34 ICON_SIZE_TINY = 16,
35 ICON_SIZE_SMALL = 22,
36 ICON_SIZE_MEDIUM = 32,
37 ICON_SIZE_LARGE = 48,
38 ICON_SIZE_HUGE = 64,
39 ICON_SIZE_ENORMOUS = 128
40 };
41
46 enum IconContext {
47 ICON_CONTEXT_ANY = 0,
48 ICON_CONTEXT_ACTION,
49 ICON_CONTEXT_APPLICATION,
50 ICON_CONTEXT_DEVICE,
51 ICON_CONTEXT_FILESYSTEM,
52 ICON_CONTEXT_MIMETYPE,
53 ICON_CONTEXT_STOCK,
54 ICON_CONTEXT_EMBLEM,
55 ICON_CONTEXT_MISC
56 };
57
58 struct IconThemePrivate;
59
80 class EDELIB_API IconTheme {
81 private:
82 IconThemePrivate* priv;
83
84 void load_theme(const char* name);
85 void read_inherits(const char* buf);
86
87 E_DISABLE_CLASS_COPY(IconTheme)
88 public:
92 IconTheme() : priv(NULL) { }
93
97 ~IconTheme() { clear(); }
98
103 void load(const char* name);
104
108 void clear(void);
109
113 String find_icon(const char* icon, IconSizes size, IconContext context = ICON_CONTEXT_ANY);
114
118 const char* theme_name(void) const;
119
127 const char* stylized_theme_name(void) const;
128
132 const char* description(void) const;
133
138 const char* example_icon(void) const;
139
143 void query_icons(list<String>& lst, IconSizes size, IconContext context = ICON_CONTEXT_ANY) const;
144
148 static const char* default_theme_name(void) { return "edeneu"; }
149 };
150
151 EDELIB_NS_END
152 #endif
edelib::ICON_CONTEXT_EMBLEM
Icons representing emblem objects (gnome themes usually)
Definition: IconTheme.h:54
edelib::ICON_SIZE_MEDIUM
32x32
Definition: IconTheme.h:36
edelib::list
Linked list class.
Definition: List.h:160
edelib::IconTheme::~IconTheme
~IconTheme()
Definition: IconTheme.h:97
edelib::IconTheme::IconTheme
IconTheme()
Definition: IconTheme.h:92
edelib::ICON_CONTEXT_MISC
Misc icons (gnome themes usually)
Definition: IconTheme.h:55
edelib::IconSizes
IconSizes
Icon sizes to look for.
Definition: IconTheme.h:33
edelib::ICON_SIZE_ENORMOUS
128x128
Definition: IconTheme.h:39
edelib::ICON_SIZE_SMALL
22x22 icons
Definition: IconTheme.h:35
edelib::ICON_SIZE_HUGE
64x64
Definition: IconTheme.h:38
edelib::ICON_CONTEXT_ANY
Can be any icon context.
Definition: IconTheme.h:47
edelib::ICON_CONTEXT_APPLICATION
Icons representing applications.
Definition: IconTheme.h:49
edelib::ICON_CONTEXT_MIMETYPE
Icons representing MIME types.
Definition: IconTheme.h:52
E_DISABLE_CLASS_COPY
#define E_DISABLE_CLASS_COPY(klass)
Definition: edelib-global.h:161
edelib::String
A (relatively simple) string implementation.
Definition: String.h:82
edelib::IconContext
IconContext
Icon types to look for.
Definition: IconTheme.h:46
edelib::ICON_CONTEXT_FILESYSTEM
Icons representing objects that are part of system.
Definition: IconTheme.h:51
edelib::ICON_SIZE_LARGE
48x48
Definition: IconTheme.h:37
edelib::ICON_CONTEXT_DEVICE
Icons representing devices.
Definition: IconTheme.h:50
edelib::ICON_CONTEXT_STOCK
Icons representing stock objects (gnome themes usually)
Definition: IconTheme.h:53
edelib::ICON_CONTEXT_ACTION
Icons representing actions.
Definition: IconTheme.h:48
edelib::ICON_SIZE_TINY
16x16 icons
Definition: IconTheme.h:34
edelib::IconTheme
Finds named icon according to the given theme.
Definition: IconTheme.h:80
edelib::IconTheme::default_theme_name
static const char * default_theme_name(void)
Definition: IconTheme.h:148