1 #ifndef _KVI_TAL_VBOX_H_
2 #define _KVI_TAL_VBOX_H_
3 //=============================================================================
4 //
5 //   File : KviTalVBox.h
6 //   Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
7 //
8 //   This file is part of the KVIrc IRC client distribution
9 //   Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
10 //   Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)
11 //
12 //   This program is FREE software. You can redistribute it and/or
13 //   modify it under the terms of the GNU General Public License
14 //   as published by the Free Software Foundation; either version 2
15 //   of the License, or (at your option) any later version.
16 //
17 //   This program is distributed in the HOPE that it will be USEFUL,
18 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 //   See the GNU General Public License for more details.
21 //
22 //   You should have received a copy of the GNU General Public License
23 //   along with this program. If not, write to the Free Software Foundation,
24 //   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
28 /**
29 * \file KviTalVBox.h
30 * \author Szymon Stefanek
31 * \brief Class for vertical box
32 */
33 
34 #include "kvi_settings.h"
35 
36 #include <QWidget>
37 #include <QVBoxLayout>
38 
39 /**
40 * \class KviTalVBox
41 * \brief Toolkit Abstraction Layer: vbox class
42 */
43 class KVILIB_API KviTalVBox : public QWidget
44 {
45 	Q_OBJECT
46 public:
47 	/**
48 	* \brief Constructs a vertical box object
49 	* \param pParent The parent object
50 	* \param pcName The name of the box
51 	* \return KviTalVBox
52 	*/
53 	KviTalVBox(QWidget * pParent, char * pcName = nullptr);
54 
55 	/**
56 	* \brief Destroys a vertical box object
57 	*/
58 	~KviTalVBox();
59 
60 private:
61 	QVBoxLayout * m_pLayout;
62 
63 public:
64 	/**
65 	* \brief Sets the stretch factor for an object
66 	* \param pChild The object to stretch
67 	* \param iStretch The stretch factor to use
68 	* \return void
69 	*/
70 	void setStretchFactor(QWidget * pChild, int iStretch);
71 
72 	/**
73 	* \brief Sets the spacing of the box
74 	* \param iSpacing The space in pixels
75 	* \return void
76 	*/
77 	void setSpacing(int iSpacing);
78 
79 	/**
80 	* \brief Sets the margin of the box
81 	* \param iMargin The margin in pixels
82 	* \return void
83 	*/
84 	void setMargin(int iMargin);
85 
86 	/**
87 	* \brief Sets the alignment of the box
88 	* \param alignment The alignment
89 	* \return void
90 	*/
91 	void setAlignment(Qt::Alignment alignment);
92 
93 	/**
94 	* \brief Sets the alignment of the box for a child object
95 	* \param pChild The object to align
96 	* \param alignment The alignment
97 	* \return void
98 	*/
99 	void setAlignment(QWidget * pChild, Qt::Alignment alignment);
100 
101 	/**
102 	* \brief Adds the stretch factor
103 	* \param iStretch The stretch factor
104 	* \return void
105 	*/
106 	void addStretch(int iStretch);
107 
108 protected:
109 	void childEvent(QChildEvent * e) override;
110 };
111 
112 #endif // _KVI_TAL_VBOX_H_
113