libgnomeuimm 2.28.0
ui-items-icon.h
Go to the documentation of this file.
1// $Id$ -*- c++ -*-
2/*
3 * Copyright 2000-2002 The libgnomeuimm development team
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 */
20
21
22#ifndef LIBGNOMEUIMM_ICON_H
23#define LIBGNOMEUIMM_ICON_H
24
25#include <gtkmm/stockid.h>
26#include <libgnomeui/gnome-app-helper.h>
27
28namespace Gnome
29{
30
31namespace UI
32{
33
34namespace Items
35{
36
38class Icon
39{
40public:
41 enum Type
42 {
43 NONE = GNOME_APP_PIXMAP_NONE,
44 STOCK = GNOME_APP_PIXMAP_STOCK,
45 DATA = GNOME_APP_PIXMAP_DATA,
46 FILENAME = GNOME_APP_PIXMAP_FILENAME
47 };
48
49 explicit Icon(const Gtk::StockID& stock_id);
50 Icon(Type type = NONE);
52
53 Type get_type() const;
54 gconstpointer get_pixmap_info() const; //This Icon must live as long as you need to use this data.
55
56protected:
57
59 typedef const char * const * const xpmdata_t;
60
61 //Only one of these will have a value:
62 gconstpointer xpm_data_;
63 Glib::ustring stock_id_; //There's no Gtk::StockID default constructor.
64 std::string filename_;
65};
66
67class IconXpm : public Icon
68{
69public:
72};
73
74class IconFile : public Icon
75{
76public:
77 IconFile(const std::string& file);
79};
80
81} // namespace Items
82} // namespace UI
83} // namespace Gnome
84
85
86
87#endif //LIBGNOMEUIMM_ICON_H
Definition: ui-items-icon.h:75
IconFile(const std::string &file)
Definition: ui-items-icon.h:68
Icons represent a standard Pixmap with various states.
Definition: ui-items-icon.h:39
gconstpointer xpm_data_
Definition: ui-items-icon.h:62
Icon(Type type=NONE)
Glib::ustring stock_id_
Definition: ui-items-icon.h:63
Type pixmap_type_
Definition: ui-items-icon.h:58
const char *const *const xpmdata_t
Definition: ui-items-icon.h:59
Icon(const Gtk::StockID &stock_id)
Type
Definition: ui-items-icon.h:42
@ DATA
Definition: ui-items-icon.h:45
@ STOCK
Definition: ui-items-icon.h:44
@ FILENAME
Definition: ui-items-icon.h:46
@ NONE
Definition: ui-items-icon.h:43
gconstpointer get_pixmap_info() const
std::string filename_
Definition: ui-items-icon.h:64
Definition: about.h:46