• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

  • kdecore
kicontheme.h
1 /* vi: ts=8 sts=4 sw=4
2  *
3  * This file is part of the KDE project, module kdecore.
4  * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
5  * Antonio Larrosa <larrosa@kde.org>
6  *
7  * This is free software; it comes under the GNU Library General
8  * Public License, version 2. See the file "COPYING.LIB" for the
9  * exact licensing terms.
10  *
11  */
12 
13 #ifndef __KIconTheme_h_Included__
14 #define __KIconTheme_h_Included__
15 
16 #include <tqstring.h>
17 #include <tqstringlist.h>
18 #include <tqptrlist.h>
19 #include <tqvaluelist.h>
20 #include "kdelibs_export.h"
21 
22 class KConfig;
23 class KIconThemeDir;
24 
25 class KIconThemePrivate;
26 
27 class KIconPrivate;
28 
36 class KDECORE_EXPORT KIcon
37 {
38 public:
39  KIcon() { size = 0; }
40 
44  bool isValid() const { return size != 0; }
45 
49  enum Context {
50  Any,
51  Action,
52  Application,
53  Device,
54  FileSystem,
55  MimeType,
56  Animation,
57  Category,
58  Emblem,
59  Emote,
60  International,
61  Place,
62  StatusIcon
63  };
64 
68  enum Type {
69  Fixed,
70  Scalable,
71  Threshold
72  };
73 
77  enum MatchType {
78  MatchExact,
79  MatchBest
80 
81  };
82 
83  // if you add a group here, make sure to change the config reading in
84  // KIconLoader too
88  enum Group {
90  NoGroup=-1,
92  Desktop=0,
94  FirstGroup=0,
96  Toolbar,
98  MainToolbar,
100  Small,
102  Panel,
104  LastGroup,
106  User
107  };
108 
112  enum StdSizes {
114  SizeSmall=16,
116  SizeSmallMedium=22,
118  SizeMedium=32,
120  SizeLarge=48,
122  SizeHuge=64,
124  SizeEnormous=128
125  };
126 
130  enum States { DefaultState,
131  ActiveState,
132  DisabledState,
133  LastState
134  };
135 
141  enum Overlays {
142  LockOverlay=0x100,
143  ZipOverlay=0x200,
144  LinkOverlay=0x400,
145  HiddenOverlay=0x800,
146  ShareOverlay=0x1000,
147  OverlayMask = ~0xff
148  };
149 
153  int size;
154 
158  Context context;
159 
163  Type type;
164 
168  int threshold;
169 
173  TQString path;
174 
175 private:
176  KIconPrivate *d;
177 };
178 
179 inline KIcon::Group& operator++(KIcon::Group& group) { group = static_cast<KIcon::Group>(group+1); return group; }
180 inline KIcon::Group operator++(KIcon::Group& group,int) { KIcon::Group ret = group; ++group; return ret; }
181 
187 class KDECORE_EXPORT KIconTheme
188 {
189 public:
196  KIconTheme(const TQString& name, const TQString& appName=TQString::null);
197  ~KIconTheme();
198 
203  TQString name() const { return mName; }
204 
210  TQString description() const { return mDesc; }
211 
217  TQString example() const;
218 
223  TQString screenshot() const;
224 
229  TQString linkOverlay() const;
230 
235  TQString zipOverlay() const;
236 
241  TQString lockOverlay() const;
242 
248  TQString shareOverlay () const;
249 
254  TQString dir() const { return mDir; }
255 
260  TQStringList inherits() const { return mInherits; }
261 
266  bool isValid() const;
267 
273  bool isHidden() const;
274 
280  int depth() const { return mDepth; }
281 
287  int defaultSize(KIcon::Group group) const;
288 
294  TQValueList<int> querySizes(KIcon::Group group) const;
295 
302  TQStringList queryIcons(int size, KIcon::Context context = KIcon::Any) const;
303 
310  TQStringList queryIconsByContext(int size, KIcon::Context context = KIcon::Any) const;
311 
312 
323  KIcon iconPath(const TQString& name, int size, KIcon::MatchType match) const;
324 
329  bool hasContext( KIcon::Context context ) const;
330 
335  static TQStringList list();
336 
341  static TQString current();
342 
346  static void reconfigure();
347 
353  static TQString defaultThemeName();
354 
355 private:
356  int mDefSize[8];
357  TQValueList<int> mSizes[8];
358 
359  int mDepth;
360  TQString mDir, mName, mDesc;
361  TQStringList mInherits;
362  TQPtrList<KIconThemeDir> mDirs;
363  KIconThemePrivate *d;
364 
365  static TQString *_theme;
366  static TQStringList *_theme_list;
367 };
368 
369 #endif
KIcon::Toolbar
Toolbar icons.
Definition: kicontheme.h:96
KIcon::Overlays
Overlays
This defines an overlay, a semi-transparent image that is projected onto the icon.
Definition: kicontheme.h:141
KIcon::Any
Some icon with unknown purpose.
Definition: kicontheme.h:50
KIcon::Small
Small icons.
Definition: kicontheme.h:100
KIcon::Group
Group
The group of the icon.
Definition: kicontheme.h:88
KIconTheme::depth
int depth() const
The minimum display depth required for this theme.
Definition: kicontheme.h:280
KIconTheme::name
TQString name() const
The stylized name of the icon theme.
Definition: kicontheme.h:203
KIcon::Emblem
An icon that adds information to an existing icon.
Definition: kicontheme.h:58
KIcon::size
int size
The size in pixels of the icon.
Definition: kicontheme.h:153
KIcon::Application
An icon that represents an application.
Definition: kicontheme.h:52
KIcon::Scalable
Scalable-size icon.
Definition: kicontheme.h:70
KIcon::Animation
An icon that is animated.
Definition: kicontheme.h:56
KIcon::MatchExact
Only try to find an exact match.
Definition: kicontheme.h:78
KIconTheme::description
TQString description() const
A description for the icon theme.
Definition: kicontheme.h:210
KIcon::LastGroup
Last group.
Definition: kicontheme.h:104
KIcon::MimeType
An icon that represents a mime type (or file type).
Definition: kicontheme.h:55
KIcon::International
An icon that represents a country's flag.
Definition: kicontheme.h:60
KIconTheme::dir
TQString dir() const
Returns the toplevel theme directory.
Definition: kicontheme.h:254
KIcon::context
Context context
The context of the icon.
Definition: kicontheme.h:158
KIcon
One icon as found by KIconTheme.
Definition: kicontheme.h:36
KIcon::type
Type type
The type of the icon: Fixed, Scalable or Threshold.
Definition: kicontheme.h:163
KIcon::isValid
bool isValid() const
Return true if this icon is valid, false otherwise.
Definition: kicontheme.h:44
KIcon::States
States
Defines the possible states of an icon.
Definition: kicontheme.h:130
KIcon::Place
An icon that represents a location (e.g. 'home', 'trash').
Definition: kicontheme.h:61
KIcon::FileSystem
An icon that represents a file system.
Definition: kicontheme.h:54
KIcon::DisabledState
Icon is disabled.
Definition: kicontheme.h:132
KIcon::Context
Context
Defines the context of the icon.
Definition: kicontheme.h:49
KIcon::threshold
int threshold
The threshold in case type == Threshold.
Definition: kicontheme.h:168
KIcon::Type
Type
The type of the icon.
Definition: kicontheme.h:68
KIcon::StdSizes
StdSizes
These are the standard sizes for icons.
Definition: kicontheme.h:112
KConfig
Access KDE Configuration entries.
Definition: kconfig.h:43
KIcon::Device
An icon that represents a device.
Definition: kicontheme.h:53
KIcon::Panel
Panel (Kicker) icons.
Definition: kicontheme.h:102
KIconTheme::inherits
TQStringList inherits() const
The themes this icon theme falls back on.
Definition: kicontheme.h:260
KIcon::path
TQString path
The full path of the icon.
Definition: kicontheme.h:173
KIcon::MatchType
MatchType
The type of a match.
Definition: kicontheme.h:77
KIcon::Fixed
Fixed-size icon.
Definition: kicontheme.h:69
KIcon::ActiveState
Icon is active.
Definition: kicontheme.h:131
KIcon::Emote
An icon that expresses an emotion.
Definition: kicontheme.h:59
KIcon::Category
An icon that represents a category.
Definition: kicontheme.h:57
KIconTheme
Class to use/access icon themes in KDE.
Definition: kicontheme.h:187
KIcon::Action
An action icon (e.g. 'save', 'print').
Definition: kicontheme.h:51
KIcon::MainToolbar
Main toolbar icons.
Definition: kicontheme.h:98

kdecore

Skip menu "kdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |