• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

kblackbox

  • sources
  • kde-4.14
  • kdegames
  • kblackbox
kbbgraphicsitemset.h
Go to the documentation of this file.
1 //
2 // KBlackBox
3 //
4 // A simple game inspired by an emacs module
5 //
6 /***************************************************************************
7  * Copyright (c) 1999-2000, Robert Cimrman *
8  * cimrman3@students.zcu.cz *
9  * *
10  * Copyright (c) 2007, Nicolas Roffet *
11  * nicolas-kde@roffet.com *
12  * *
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * This program is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with this program; if not, write to the *
26  * Free Software Foundation, Inc., *
27  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA *
28  ***************************************************************************/
29 
30 #ifndef KBBGRAPHICSITEMSET_H
31 #define KBBGRAPHICSITEMSET_H
32 
33 
34 
35 class QGraphicsScene;
36 #include <QList>
37 
38 
39 class KBBItemWithPosition;
40 
41 
42 
46 class KBBGraphicsItemSet
47 {
48  public:
49  KBBGraphicsItemSet(QGraphicsScene* scene);
50  ~KBBGraphicsItemSet();
51 
52 
53  static const int NO_INDEX = -1;
54 
58  int anyItemPosition();
59 
63  int count() const;
64 
68  void clear();
69 
74  bool containsVisible(int position);
75 
81  void insert(KBBItemWithPosition* item);
82 
88  KBBItemWithPosition* item(int position);
89 
95  void remove(int position);
96 
100  void setVisible(const int position, const bool visible);
101 
102 
103  private:
104  bool contains(int position);
105  int indexOf(int position);
106 
107  QGraphicsScene* m_scene;
108  QList<KBBItemWithPosition*> m_items;
109 };
110 
111 #endif // KBBGRAPHICSITEMSET_H
QGraphicsScene
KBBGraphicsItemSet::count
int count() const
Number of items.
Definition: kbbgraphicsitemset.cpp:72
KBBGraphicsItemSet::containsVisible
bool containsVisible(int position)
If an element is not visible, it is not contained.
Definition: kbbgraphicsitemset.cpp:92
KBBGraphicsItemSet
Set of graphic items with positions.
Definition: kbbgraphicsitemset.h:46
KBBGraphicsItemSet::anyItemPosition
int anyItemPosition()
A position of an item (anyone of them)
Definition: kbbgraphicsitemset.cpp:63
KBBGraphicsItemSet::KBBGraphicsItemSet
KBBGraphicsItemSet(QGraphicsScene *scene)
Definition: kbbgraphicsitemset.cpp:46
KBBItemWithPosition
Item with position.
Definition: kbbitemwithposition.h:37
KBBGraphicsItemSet::item
KBBItemWithPosition * item(int position)
Return the item at the given position.
Definition: kbbgraphicsitemset.cpp:116
KBBGraphicsItemSet::clear
void clear()
Remove all items.
Definition: kbbgraphicsitemset.cpp:78
KBBGraphicsItemSet::insert
void insert(KBBItemWithPosition *item)
Insert an item in the list.
Definition: kbbgraphicsitemset.cpp:106
KBBGraphicsItemSet::setVisible
void setVisible(const int position, const bool visible)
Change the visibility of an element.
Definition: kbbgraphicsitemset.cpp:139
QList< KBBItemWithPosition * >
KBBGraphicsItemSet::NO_INDEX
static const int NO_INDEX
Definition: kbbgraphicsitemset.h:53
KBBGraphicsItemSet::~KBBGraphicsItemSet
~KBBGraphicsItemSet()
Definition: kbbgraphicsitemset.cpp:52
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kblackbox

Skip menu "kblackbox"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal