File indexing completed on 2025-03-09 04:06:00
0001 /* This file is part of the KDE project 0002 * SPDX-FileCopyrightText: 2012 Arjen Hiemstra <ahiemstra@heimr.nl> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "KritaNamespace.h" 0008 0009 #include "ImageBuilder.h" 0010 #include "MouseTracker.h" 0011 #include "VirtualKeyboardController.h" 0012 #include "DocumentManager.h" 0013 #include "ProgressProxy.h" 0014 #include <QDir> 0015 0016 class KritaNamespace::Private 0017 { 0018 public: 0019 QObject *imageBuilder; 0020 QObject *mouseTracker; 0021 QObject* window; 0022 }; 0023 0024 KritaNamespace::KritaNamespace(QObject* parent) 0025 : QObject(parent), d(new Private) 0026 { 0027 d->imageBuilder = new ImageBuilder(this); 0028 d->mouseTracker = new MouseTracker(this); 0029 d->window = 0; 0030 } 0031 0032 KritaNamespace::~KritaNamespace() 0033 { 0034 delete d; 0035 } 0036 0037 QObject* KritaNamespace::imageBuilder() const 0038 { 0039 return d->imageBuilder; 0040 } 0041 0042 QObject* KritaNamespace::mouseTracker() const 0043 { 0044 return d->mouseTracker; 0045 } 0046 0047 QObject* KritaNamespace::window() const 0048 { 0049 return d->window; 0050 } 0051 0052 void KritaNamespace::setWindow(QObject* window) 0053 { 0054 d->window = window; 0055 emit windowChanged(); 0056 } 0057 0058 QObject* KritaNamespace::virtualKeyboardController() const 0059 { 0060 return VirtualKeyboardController::instance(); 0061 } 0062 0063 QObject* KritaNamespace::progressProxy() const 0064 { 0065 return DocumentManager::instance()->progressProxy(); 0066 } 0067 0068 bool KritaNamespace::fileExists(const QString& filename) const 0069 { 0070 return QDir().exists(filename); 0071 }