FXIconDict.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         I c o n   D i c t i o n a r y                         *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXIconDict.h,v 1.6 2006/02/03 00:33:15 fox Exp $                         *
00023 ********************************************************************************/
00024 #ifndef FXICONDICT_H
00025 #define FXICONDICT_H
00026 
00027 #ifndef FXDICT_H
00028 #include "FXDict.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 class FXIconSource;
00035 
00036 
00050 class FXAPI FXIconDict : public FXDict {
00051   FXDECLARE(FXIconDict)
00052 private:
00053   FXIconSource *source; // Icon source
00054   FXString      path;   // Where to search icons
00055 protected:
00056   FXIconDict():source(NULL){}
00057   virtual void *createData(const void*);
00058   virtual void deleteData(void*);
00059 private:
00060   FXIconDict(const FXIconDict&);
00061   FXIconDict &operator=(const FXIconDict&);
00062 public:
00063 
00065   static const FXchar defaultIconPath[];
00066 
00067 public:
00068 
00073   FXIconDict(FXApp* app,const FXString& p=defaultIconPath);
00074 
00076   void setIconSource(FXIconSource *src){ source=src; }
00077 
00079   FXIconSource* getIconSource() const { return source; }
00080 
00082   void setIconPath(const FXString& p){ path=p; }
00083 
00085   const FXString& getIconPath() const { return path; }
00086 
00088   FXIcon* insert(const FXchar* name){ return (FXIcon*)FXDict::insert(name,name); }
00089 
00091   FXIcon* remove(const FXchar* name){ return (FXIcon*)FXDict::remove(name); }
00092 
00094   FXIcon* find(const FXchar* name){ return (FXIcon*)FXDict::find(name); }
00095 
00097   virtual void save(FXStream& store) const;
00098 
00100   virtual void load(FXStream& store);
00101 
00103   virtual ~FXIconDict();
00104   };
00105 
00106 
00107 }
00108 
00109 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:22 2009 for TnFOX by doxygen v1.4.7