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

kdecore

kicontheme.h
00001 /* vi: ts=8 sts=4 sw=4
00002  *
00003  * This file is part of the KDE project, module kdecore.
00004  * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
00005  *                    Antonio Larrosa <larrosa@kde.org>
00006  *
00007  * This is free software; it comes under the GNU Library General
00008  * Public License, version 2. See the file "COPYING.LIB" for the
00009  * exact licensing terms.
00010  *
00011  */
00012 
00013 #ifndef __KIconTheme_h_Included__
00014 #define __KIconTheme_h_Included__
00015 
00016 #include <tqstring.h>
00017 #include <tqstringlist.h>
00018 #include <tqptrlist.h>
00019 #include <tqvaluelist.h>
00020 #include "kdelibs_export.h"
00021 
00022 class KConfig;
00023 class KIconThemeDir;
00024 
00025 class KIconThemePrivate;
00026 
00027 class KIconPrivate;
00028 
00036 class KDECORE_EXPORT KIcon
00037 {
00038 public:
00039     KIcon() { size = 0; }
00040 
00044     bool isValid() const { return size != 0; }
00045 
00049     enum Context {
00050       Any, 
00051       Action, 
00052       Application, 
00053       Device, 
00054       FileSystem, 
00055       MimeType, 
00056       Animation, 
00057       Category, 
00058       Emblem, 
00059       Emote, 
00060       International, 
00061       Place, 
00062       StatusIcon 
00063     };
00064 
00068     enum Type {
00069       Fixed, 
00070       Scalable, 
00071       Threshold 
00072     };
00073 
00077     enum MatchType {
00078       MatchExact, 
00079       MatchBest   
00080 
00081     };
00082 
00083     // if you add a group here, make sure to change the config reading in
00084     // KIconLoader too
00088     enum Group {
00090     NoGroup=-1,
00092     Desktop=0,
00094     FirstGroup=0,
00096     Toolbar,
00098         MainToolbar,
00100     Small,
00102     Panel,
00104     LastGroup,
00106     User
00107          };
00108 
00112     enum StdSizes {
00114         SizeSmall=16,
00116         SizeSmallMedium=22,
00118         SizeMedium=32,
00120         SizeLarge=48,
00122         SizeHuge=64,
00124         SizeEnormous=128
00125          };
00126 
00130     enum States { DefaultState, 
00131           ActiveState,  
00132           DisabledState, 
00133           LastState      
00134     };
00135 
00141     enum Overlays {
00142       LockOverlay=0x100, 
00143       ZipOverlay=0x200,  
00144       LinkOverlay=0x400, 
00145       HiddenOverlay=0x800, 
00146       ShareOverlay=0x1000, 
00147       OverlayMask = ~0xff
00148     };
00149 
00153     int size;
00154 
00158     Context context;
00159 
00163     Type type;
00164 
00168     int threshold;
00169 
00173     TQString path;
00174 
00175 private:
00176     KIconPrivate *d;
00177 };
00178 
00179 inline KIcon::Group& operator++(KIcon::Group& group) { group = static_cast<KIcon::Group>(group+1); return group; }
00180 inline KIcon::Group operator++(KIcon::Group& group,int) { KIcon::Group ret = group; ++group; return ret; }
00181 
00187 class KDECORE_EXPORT KIconTheme
00188 {
00189 public:
00196     KIconTheme(const TQString& name, const TQString& appName=TQString::null);
00197     ~KIconTheme();
00198 
00203     TQString name() const { return mName; }
00204 
00210     TQString description() const { return mDesc; }
00211 
00217     TQString example() const;
00218 
00223     TQString screenshot() const;
00224 
00229     TQString linkOverlay() const;
00230 
00235     TQString zipOverlay() const;
00236 
00241     TQString lockOverlay() const;
00242 
00248     TQString shareOverlay () const;
00249 
00254     TQString dir() const { return mDir; }
00255 
00260     TQStringList inherits() const { return mInherits; }
00261 
00266     bool isValid() const;
00267 
00273     bool isHidden() const;
00274 
00280     int depth() const { return mDepth; }
00281 
00287     int defaultSize(KIcon::Group group) const;
00288 
00294     TQValueList<int> querySizes(KIcon::Group group) const;
00295 
00302     TQStringList queryIcons(int size, KIcon::Context context = KIcon::Any) const;
00303 
00310     TQStringList queryIconsByContext(int size, KIcon::Context context = KIcon::Any) const;
00311 
00312 
00323     KIcon iconPath(const TQString& name, int size, KIcon::MatchType match) const;
00324     
00329     bool hasContext( KIcon::Context context ) const;
00330 
00335     static TQStringList list();
00336 
00341     static TQString current();
00342 
00346     static void reconfigure();
00347 
00353     static TQString defaultThemeName();
00354 
00355 private:
00356     int mDefSize[8];
00357     TQValueList<int> mSizes[8];
00358 
00359     int mDepth;
00360     TQString mDir, mName, mDesc;
00361     TQStringList mInherits;
00362     TQPtrList<KIconThemeDir> mDirs;
00363     KIconThemePrivate *d;
00364 
00365     static TQString *_theme;
00366     static TQStringList *_theme_list;
00367 };
00368 
00369 #endif

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.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |