libraryitem.h

00001 /***************************************************************************
00002  *   Copyright (C) 2003-2005 by David Saxton                               *
00003  *   david@bluehaze.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 
00011 #ifndef LIBRARYITEM_H
00012 #define LIBRARYITEM_H
00013 
00014 #include "item.h"
00015 
00016 class QStringList;
00017 
00028 class LibraryItem
00029 {
00030         public:
00031                 ~LibraryItem();
00032         
00033                 enum Type
00034                 {
00035                         lit_flowpart,
00036                         lit_component,
00037                         lit_mechanical,
00038                         lit_drawpart,
00039                         lit_subcircuit,
00040                         lit_other
00041                 };
00042                 LibraryItem( QStringList idList, const QString &name, const QString &category, QPixmap icon, Type type, createItemPtr createItem );
00043                 LibraryItem( QStringList idList, const QString &name, const QString &category, const QString &iconName, Type type, createItemPtr createItem );
00044                 LibraryItem( QStringList idList, const QString &name, const QString &category, Type type, createItemPtr createItem );
00045         
00046                 QString activeID() const;
00047                 QStringList allIDs() const { return m_idList; }
00048                 QString name() const { return m_name; }
00049                 QString category() const { return m_category; }
00050                 QPixmap iconFull() const { return m_icon_full; }
00051                 QPixmap icon16() const { return m_icon_16; }
00052                 createItemPtr createItemFnPtr() const { return createItem; }
00053                 int type() const { return m_type; }
00054         
00055         protected:
00056                 void createIcon16();
00057         
00058         private:
00059                 QStringList m_idList;
00060                 QString m_name;
00061                 QString m_category;
00062                 QPixmap m_icon_full;
00063                 QPixmap m_icon_16;
00064                 createItemPtr createItem;
00065                 int m_type;
00066 };
00067 typedef QValueList<LibraryItem*> LibraryItemList;
00068 
00069 #endif

Generated on Tue May 8 17:05:31 2007 for KTechLab by  doxygen 1.5.1