IOT  0.5
I Only Think
Box.h
Go to the documentation of this file.
00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
00002 
00003 /* IOT Copyright (C) 2010 CEG development team
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 version 2
00007  * as published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00017  *
00018  * Authors: CEG <ceg@ionlythink.com>, http://www.ionlythink.com
00019  */
00020 
00021 #ifndef BOX_H_
00022 #define BOX_H_
00023 
00024 #include <QRect>
00025 #include <QList>
00026 #include <QMap>
00027 
00028 #include "IDomFactory.h"
00029 #include "BoxType.h"
00030 #include "BoxStyle.h"
00031 
00032 class IAction;
00033 
00042 class Box : public IDomFactory
00043 {
00044 public:
00045     Box(int level, QRect const & geometry); // Utiliser lors des box par defaut, construction des enfants
00046     Box(QDomElement const & domElement, Box const * parent); // Utiliser pour la creation par XML
00047     ~Box();
00048 
00049     IAction  *                      getAction() const;
00050     BoxType                         getBoxType() const;
00051     QList<Box const *> const &  getChilden() const;
00052     QRect const &                   getGeometry() const;
00053     unsigned short                  getLevel() const;
00054     Box const *                     getParent() const;
00055     BoxStyle const &                getGraphicStyle() const;
00056 
00057 private:
00058         virtual void initializeFromXml(QDomElement const & boxElement);
00059 void    createChildren(QDomElement const & childrenElement);
00060 
00061 private:
00062     BoxType                 _type; // Le type de la box
00063     union
00064     {
00065         Box const *         _parent; // Le parent dans le cas d'une box CUSTOM_BOX
00066         int                 _level; // La profondeur (de zoom) d'une box DEFAULT_BOX
00067     }                       _topUnion;
00068     QRect                           _geometry; // Les dimensions de la boite
00069     IAction  *              _action; // L'action que la box entraine
00070     BoxStyle                _graphicStyle; // Toutes les options graphiques d'une box
00071     QList<Box const *>   _children; // le sous patron
00072 };
00073 
00074 #endif // BOX_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator