1 /***************************************************************************
2  *   This file is part of the Lime Report project                          *
3  *   Copyright (C) 2015 by Alexander Arin                                  *
4  *   arin_a@bk.ru                                                          *
5  *                                                                         *
6  **                   GNU General Public License Usage                    **
7  *                                                                         *
8  *   This library is free software: you can redistribute it and/or modify  *
9  *   it under the terms of the GNU General Public License as published by  *
10  *   the Free Software Foundation, either version 3 of the License, or     *
11  *   (at your option) any later version.                                   *
12  *   You should have received a copy of the GNU General Public License     *
13  *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
14  *                                                                         *
15  **                  GNU Lesser General Public License                    **
16  *                                                                         *
17  *   This library is free software: you can redistribute it and/or modify  *
18  *   it under the terms of the GNU Lesser General Public License as        *
19  *   published by the Free Software Foundation, either version 3 of the    *
20  *   License, or (at your option) any later version.                       *
21  *   You should have received a copy of the GNU Lesser General Public      *
22  *   License along with this library.                                      *
23  *   If not, see <http://www.gnu.org/licenses/>.                           *
24  *                                                                         *
25  *   This library is distributed in the hope that it will be useful,       *
26  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
27  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
28  *   GNU General Public License for more details.                          *
29  ****************************************************************************/
30 #ifndef LRITEMSALIGNEDITORWIDGET_H
31 #define LRITEMSALIGNEDITORWIDGET_H
32 
33 #include "lrreportdesignwidget.h"
34 #include <QToolBar>
35 #include <QAction>
36 
37 namespace LimeReport{
38 
39 class ItemsAlignmentEditorWidget : public QToolBar
40 {
41     Q_OBJECT
42 public:
43     explicit ItemsAlignmentEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
44     explicit ItemsAlignmentEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
45     explicit ItemsAlignmentEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
46     explicit ItemsAlignmentEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
47 private slots:
48     void slotBringToFront();
49     void slotSendToBack();
50     void slotAlignToLeft();
51     void slotAlignToRight();
52     void slotAlignToVCenter();
53     void slotAlignToTop();
54     void slotAlignToBottom();
55     void slotAlignToHCenter();
56     void slotSameHeight();
57     void slotSameWidth();
58 private:
59     void initEditor();
60     ReportDesignWidget* m_reportEditor;
61     PageDesignIntf* m_page;
62 
63     QAction* m_bringToFront;
64     QAction* m_sendToBack;
65     QAction* m_alignToLeft;
66     QAction* m_alignToRight;
67     QAction* m_alignToVCenter;
68     QAction* m_alignToTop;
69     QAction* m_alignToBottom;
70     QAction* m_alignToHCenter;
71     QAction* m_sameHeight;
72     QAction* m_sameWidth;
73 };
74 
75 } //namespace LimeReport
76 
77 #endif // LRITEMSALIGNEDITORWIDGET_H
78