IconTheme.h
/*
* $Id: IconTheme.h 3441 2012-11-01 20:40:30Z karijes $
*
* Icon theme
* Copyright (c) 2005-2009 edelib authors
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EDELIB_ICONTHEME_H__
#define __EDELIB_ICONTHEME_H__
#include "String.h"
#include "List.h"
EDELIB_NS_BEGIN
enum IconSizes {
ICON_SIZE_TINY = 16,
ICON_SIZE_SMALL = 22,
ICON_SIZE_MEDIUM = 32,
ICON_SIZE_LARGE = 48,
ICON_SIZE_HUGE = 64,
ICON_SIZE_ENORMOUS = 128
};
enum IconContext {
ICON_CONTEXT_ANY = 0,
ICON_CONTEXT_ACTION,
ICON_CONTEXT_APPLICATION,
ICON_CONTEXT_DEVICE,
ICON_CONTEXT_FILESYSTEM,
ICON_CONTEXT_MIMETYPE,
ICON_CONTEXT_STOCK,
ICON_CONTEXT_EMBLEM,
ICON_CONTEXT_MISC
};
struct IconThemePrivate;
class EDELIB_API IconTheme {
private:
IconThemePrivate* priv;
void load_theme(const char* name);
void read_inherits(const char* buf);
E_DISABLE_CLASS_COPY(IconTheme)
public:
IconTheme() : priv(NULL) { }
~IconTheme() { clear(); }
void load(const char* name);
void clear(void);
String find_icon(const char* icon, IconSizes size, IconContext context = ICON_CONTEXT_ANY);
const char* theme_name(void) const;
const char* stylized_theme_name(void) const;
const char* description(void) const;
const char* example_icon(void) const;
void query_icons(list<String>& lst, IconSizes size, IconContext context = ICON_CONTEXT_ANY) const;
static const char* default_theme_name(void) { return "edeneu"; }
};
EDELIB_NS_END
#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