1 /* This file is part of the KDE project
2  * Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
3  * Copyright (C) 2013 Jean-Nicolas Artaud <jeannicolasartaud@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #include "KoPABackgroundFillWidget.h"
22 
23 #include <KoPageApp.h>
24 #include <KoPAViewBase.h>
25 #include <KoCanvasBase.h>
26 #include <KoShape.h>
27 #include <KoDocumentResourceManager.h>
28 
29 #include <klocalizedstring.h>
30 
KoPABackgroundFillWidget(QWidget * parent)31 KoPABackgroundFillWidget::KoPABackgroundFillWidget(QWidget *parent)
32 : KoFillConfigWidget(parent)
33 {
34     setWindowTitle(i18n("Background"));
35 }
36 
setView(KoPAViewBase * view)37 void KoPABackgroundFillWidget::setView(KoPAViewBase *view)
38 {
39     Q_ASSERT(view);
40     connect(view->proxyObject, SIGNAL(activePageChanged()),
41              this, SLOT(shapeChanged()));
42 }
43 
currentShape()44 KoShape* KoPABackgroundFillWidget::currentShape()
45 {
46     KoShape *slide = canvas()->resourceManager()->koShapeResource(KoPageApp::CurrentPage);
47     return slide;
48 }
49 
currentShapes()50 QList<KoShape*> KoPABackgroundFillWidget::currentShapes()
51 {
52     KoShape *slide = canvas()->resourceManager()->koShapeResource(KoPageApp::CurrentPage);
53     QList<KoShape*> list;
54     list.append(slide);
55     return list;
56 }
57