(empty message)
[qanava.git] / src / can / canGrid.h
blob9b2a6d9569ad2d4f19e52fa578b719b8cb422a10
1 /*
2 Qanava - Graph drawing library for QT
3 Copyright (C) 2005 Benoit AUTHEMAN
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 //-----------------------------------------------------------------------------
21 // This file is a part of the Qanava software.
23 // \file canGrid.h
24 // \author Benoit Autheman (benoit@faktiss.net)
25 // \date 2004 December 05
26 //-----------------------------------------------------------------------------
29 #ifndef canGrid_h
30 #define canGrid_h
33 // Qanava headers
34 #include "../la/laTimeTree.h"
35 //#include "canCanvas.h"
38 // QT headers
39 #include <qobject.h>
40 #include <qcanvas.h>
43 // STL headers
44 #include <vector>
47 //-----------------------------------------------------------------------------
48 namespace qan { // ::qan
49 namespace can { // ::qan::can
51 class Canvas;
53 //! Implements the abstract methods defined in class la::Grid.
54 /*!
55 \nosubgrouping
57 class Grid : public la::Grid
59 /*! \name Grid Constructor/Destructor *///----------------------------
60 //@{
61 public:
63 Grid( can::Canvas& canvas );
65 private:
67 can::Canvas& _canvas;
68 //@}
69 //---------------------------------------------------------------------
73 /*! \name Grid Lines Management *///----------------------------------
74 //@{
75 public:
77 virtual void addLine( int ax, int ay, int bx, int by, int w = 1, bool dash = false, bool dot = false );
79 virtual void addRectangle( int x, int y, int w, int h, int r, int g, int b );
81 virtual void addText( const std::string& text, int x, int y, bool bold = false );
83 virtual void resize( int w, int h );
85 virtual void addHorizontalLine( int ax, int ay, int bx, int by, int w = 1, bool dash = false, bool dot = false );
87 virtual void addVerticalLine( int ax, int ay, int bx, int by, int w = 1, bool dash = false, bool dot = false );
89 private:
91 QCanvasLine* createLine( int ax, int ay, int bx, int by, int w = 1, bool dash = false, bool dot = false );
93 typedef std::list< QCanvasLine* > Lines;
95 Lines _horizontal;
97 Lines _vertical;
98 //@}
99 //---------------------------------------------------------------------
102 } // ::qan::can
103 } // ::qan
104 //-----------------------------------------------------------------------------
107 #endif // canGrid_h