kblackbox
kbbgraphicsitemset.h
Go to the documentation of this file.00001 // 00002 // KBlackBox 00003 // 00004 // A simple game inspired by an emacs module 00005 // 00006 /*************************************************************************** 00007 * Copyright (c) 1999-2000, Robert Cimrman * 00008 * cimrman3@students.zcu.cz * 00009 * * 00010 * Copyright (c) 2007, Nicolas Roffet * 00011 * nicolas-kde@roffet.com * 00012 * * 00013 * * 00014 * This program is free software; you can redistribute it and/or modify * 00015 * it under the terms of the GNU General Public License as published by * 00016 * the Free Software Foundation; either version 2 of the License, or * 00017 * (at your option) any later version. * 00018 * * 00019 * This program is distributed in the hope that it will be useful, * 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00022 * GNU General Public License for more details. * 00023 * * 00024 * You should have received a copy of the GNU General Public License * 00025 * along with this program; if not, write to the * 00026 * Free Software Foundation, Inc., * 00027 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * 00028 ***************************************************************************/ 00029 00030 #ifndef KBBGRAPHICSITEMSET_H 00031 #define KBBGRAPHICSITEMSET_H 00032 00033 00034 00035 class QGraphicsScene; 00036 #include <QList> 00037 00038 00039 class KBBItemWithPosition; 00040 00041 00042 00046 class KBBGraphicsItemSet 00047 { 00048 public: 00049 KBBGraphicsItemSet(QGraphicsScene* scene); 00050 ~KBBGraphicsItemSet(); 00051 00052 00053 static const int NO_INDEX = -1; 00054 00058 int anyItemPosition(); 00059 00063 int count() const; 00064 00068 void clear(); 00069 00074 bool containsVisible(int position); 00075 00081 void insert(KBBItemWithPosition* item); 00082 00088 KBBItemWithPosition* item(int position); 00089 00095 void remove(int position); 00096 00100 void setVisible(const int position, const bool visible); 00101 00102 00103 private: 00104 bool contains(int position); 00105 int indexOf(int position); 00106 00107 QGraphicsScene* m_scene; 00108 QList<KBBItemWithPosition*> m_items; 00109 }; 00110 00111 #endif // KBBGRAPHICSITEMSET_H
KDE 4.0 API Reference