diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 01:49:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 01:49:02 +0000 |
commit | 5de3dd4762ca33a0f92e79ffa4fe2ff67069d531 (patch) | |
tree | bad482b7afa4cdf47422d60a5dd2c61c7e333b09 /src/libraryitem.h | |
download | ktechlab-5de3dd4762ca33a0f92e79ffa4fe2ff67069d531.tar.gz ktechlab-5de3dd4762ca33a0f92e79ffa4fe2ff67069d531.zip |
Added KDE3 version of ktechlab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1095338 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/libraryitem.h')
-rw-r--r-- | src/libraryitem.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/libraryitem.h b/src/libraryitem.h new file mode 100644 index 0000000..1e6b429 --- /dev/null +++ b/src/libraryitem.h @@ -0,0 +1,69 @@ +/*************************************************************************** + * Copyright (C) 2003-2005 by David Saxton * + * david@bluehaze.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#ifndef LIBRARYITEM_H +#define LIBRARYITEM_H + +#include "item.h" + +class QStringList; + +/** +This holds details of an item - id, name, category it is displayed in in its +respective item selector, icon, function pointers to creating the item, etc. +Normally each item will only pass one id, but some items have had their IDs +changed during the history of ktl, so passing a stringlist will take the first +ID as the "active" id, and the rest as IDs that will also be recognized, but +never displayed to the user. +@short Details of an Item +@author David Saxton +*/ +class LibraryItem +{ + public: + ~LibraryItem(); + + enum Type + { + lit_flowpart, + lit_component, + lit_mechanical, + lit_drawpart, + lit_subcircuit, + lit_other + }; + LibraryItem( QStringList idList, const QString &name, const QString &category, QPixmap icon, Type type, createItemPtr createItem ); + LibraryItem( QStringList idList, const QString &name, const QString &category, const QString &iconName, Type type, createItemPtr createItem ); + LibraryItem( QStringList idList, const QString &name, const QString &category, Type type, createItemPtr createItem ); + + QString activeID() const; + QStringList allIDs() const { return m_idList; } + QString name() const { return m_name; } + QString category() const { return m_category; } + QPixmap iconFull() const { return m_icon_full; } + QPixmap icon16() const { return m_icon_16; } + createItemPtr createItemFnPtr() const { return createItem; } + int type() const { return m_type; } + + protected: + void createIcon16(); + + private: + QStringList m_idList; + QString m_name; + QString m_category; + QPixmap m_icon_full; + QPixmap m_icon_16; + createItemPtr createItem; + int m_type; +}; +typedef QValueList<LibraryItem*> LibraryItemList; + +#endif |