[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [digikam] utilities/imageeditor/printiface: missing files
From:       Gilles Caulier <caulier.gilles () gmail ! com>
Date:       2016-05-17 11:41:39
Message-ID: E1b2dNb-0007Oo-Md () scm ! kde ! org
[Download RAW message or body]

Git commit dd847d2bb61c337428eb7dbd2ae0cde689ab86eb by Gilles Caulier.
Committed on 17/05/2016 at 11:41.
Pushed by cgilles into branch 'master'.

missing files

A  +143  -0    utilities/imageeditor/printiface/printconfig.cpp     [License: GPL \
(v2+)] A  +227  -0    utilities/imageeditor/printiface/printconfig.h     [License: \
GPL (v2+)]

http://commits.kde.org/digikam/dd847d2bb61c337428eb7dbd2ae0cde689ab86eb

diff --git a/utilities/imageeditor/printiface/printconfig.cpp \
b/utilities/imageeditor/printiface/printconfig.cpp new file mode 100644
index 0000000..a447697
--- /dev/null
+++ b/utilities/imageeditor/printiface/printconfig.cpp
@@ -0,0 +1,143 @@
+/* ============================================================
+ *
+ * This file is a part of digiKam project
+ * http://www.digikam.org
+ *
+ * Date        : 2009-02-06
+ * Description : image editor printing interface.
+ *               inspired from  Gwenview code (Aurelien Gateau).
+ *
+ * Copyright (C) 2009 by Angelo Naselli <anaselli at linux dot it>
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * ============================================================ */
+
+#include "printconfig.h"
+
+// Qt includes
+
+#include <qglobal.h>
+#include <QFile>
+
+namespace Digikam
+{
+
+class PrintConfigHelper
+{
+    public:
+
+        PrintConfigHelper()
+            : q(0)
+        {
+        }
+
+        ~PrintConfigHelper()
+        {
+            delete q;
+        }
+
+        PrintConfig* q;
+};
+
+Q_GLOBAL_STATIC(PrintConfigHelper, s_globalPrintConfig)
+
+PrintConfig *PrintConfig::self()
+{
+    if (!s_globalPrintConfig()->q)
+    {
+        new PrintConfig;
+        s_globalPrintConfig()->q->read();
+    }
+
+    return s_globalPrintConfig()->q;
+}
+
+PrintConfig::PrintConfig()
+    : KConfigSkeleton(QLatin1String("digikamrc"))
+{
+    Q_ASSERT(!s_globalPrintConfig()->q);
+    s_globalPrintConfig()->q = this;
+    setCurrentGroup( QLatin1String( "Print" ) );
+
+    KConfigSkeleton::ItemInt* itemPrintPosition = new \
KConfigSkeleton::ItemInt(currentGroup(), QLatin1String("PrintPosition"), \
mPrintPosition, Qt::AlignHCenter | Qt::AlignVCenter); +    addItem( \
itemPrintPosition, QLatin1String("PrintPosition")); +
+    QList<KConfigSkeleton::ItemEnum::Choice> valuesPrintScaleMode;
+    {
+        KConfigSkeleton::ItemEnum::Choice choice;
+        choice.name = QLatin1String("PrintOptionsPage::NoScale");
+        valuesPrintScaleMode.append( choice );
+    }
+
+    {
+        KConfigSkeleton::ItemEnum::Choice choice;
+        choice.name = QLatin1String("PrintOptionsPage::ScaleToPage");
+        valuesPrintScaleMode.append( choice );
+    }
+
+    {
+        KConfigSkeleton::ItemEnum::Choice choice;
+        choice.name = QLatin1String("PrintOptionsPage::ScaleToCustomSize");
+        valuesPrintScaleMode.append( choice );
+    }
+
+    KConfigSkeleton::ItemEnum* itemPrintScaleMode = new \
KConfigSkeleton::ItemEnum(currentGroup(), QLatin1String("PrintScaleMode"), \
mPrintScaleMode, valuesPrintScaleMode, Digikam::PrintOptionsPage::ScaleToPage); +    \
addItem( itemPrintScaleMode, QLatin1String( "PrintScaleMode" ) ); +
+    KConfigSkeleton::ItemBool* itemPrintEnlargeSmallerImages = new \
KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "PrintEnlargeSmallerImages" \
), mPrintEnlargeSmallerImages, false ); +    addItem( itemPrintEnlargeSmallerImages, \
QLatin1String( "PrintEnlargeSmallerImages" ) ); +
+    KConfigSkeleton::ItemDouble* itemPrintWidth = new KConfigSkeleton::ItemDouble( \
currentGroup(), QLatin1String( "PrintWidth" ), mPrintWidth, 15.0 ); +    addItem( \
itemPrintWidth, QLatin1String( "PrintWidth" ) ); +
+    KConfigSkeleton::ItemDouble* itemPrintHeight = new KConfigSkeleton::ItemDouble( \
currentGroup(), QLatin1String( "PrintHeight" ), mPrintHeight, 10.0 ); +    addItem( \
itemPrintHeight, QLatin1String( "PrintHeight" ) ); +
+    QList<KConfigSkeleton::ItemEnum::Choice> valuesPrintUnit;
+    {
+        KConfigSkeleton::ItemEnum::Choice choice;
+        choice.name = QLatin1String("PrintOptionsPage::Millimeters");
+        valuesPrintUnit.append( choice );
+    }
+
+    {
+        KConfigSkeleton::ItemEnum::Choice choice;
+        choice.name = QLatin1String("PrintOptionsPage::Centimeters");
+        valuesPrintUnit.append( choice );
+    }
+
+    {
+        KConfigSkeleton::ItemEnum::Choice choice;
+        choice.name = QLatin1String("PrintOptionsPage::Inches");
+        valuesPrintUnit.append( choice );
+    }
+
+    KConfigSkeleton::ItemEnum* itemPrintUnit = new KConfigSkeleton::ItemEnum( \
currentGroup(), QLatin1String( "PrintUnit" ), mPrintUnit, valuesPrintUnit, \
Digikam::PrintOptionsPage::Centimeters ); +    addItem( itemPrintUnit, QLatin1String( \
"PrintUnit" ) ); +
+    KConfigSkeleton::ItemBool* itemPrintKeepRatio = new KConfigSkeleton::ItemBool( \
currentGroup(), QLatin1String( "PrintKeepRatio" ), mPrintKeepRatio, true ); +    \
addItem( itemPrintKeepRatio, QLatin1String( "PrintKeepRatio" ) ); +
+    KConfigSkeleton::ItemBool* itemPrintColorManaged = new \
KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "PrintColorManaged" ), \
mPrintColorManaged, false ); +    addItem( itemPrintColorManaged, QLatin1String( \
"PrintColorManaged" ) ); +
+    KConfigSkeleton::ItemBool* itemPrintAutoRotate = new KConfigSkeleton::ItemBool( \
currentGroup(), QLatin1String( "PrintAutoRotate" ), mPrintAutoRotate, false ); +    \
addItem( itemPrintAutoRotate, QLatin1String( "PrintAutoRotate" ) ); +}
+
+PrintConfig::~PrintConfig()
+{
+    s_globalPrintConfig()->q = 0;
+}
+
+} // namespace Digikam
diff --git a/utilities/imageeditor/printiface/printconfig.h \
b/utilities/imageeditor/printiface/printconfig.h new file mode 100644
index 0000000..aafad23
--- /dev/null
+++ b/utilities/imageeditor/printiface/printconfig.h
@@ -0,0 +1,227 @@
+/* ============================================================
+ *
+ * This file is a part of digiKam project
+ * http://www.digikam.org
+ *
+ * Date        : 2009-02-06
+ * Description : image editor printing interface.
+ *               inspired from  Gwenview code (Aurelien Gateau).
+ *
+ * Copyright (C) 2009 by Angelo Naselli <anaselli at linux dot it>
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef _DIGIKAM_CONFIG_H_
+#define _DIGIKAM_CONFIG_H_
+
+// Qt includes
+
+#include <QCoreApplication>
+#include <QDebug>
+
+// KDE includes
+
+#include <kconfigskeleton.h>
+
+// Local includes
+
+#include <digikam_export.h>
+#include <printoptionspage.h>
+
+namespace Digikam
+{
+
+class DIGIKAM_EXPORT PrintConfig : public KConfigSkeleton
+{
+    public:
+
+        static PrintConfig* self();
+        ~PrintConfig();
+
+    public:
+
+        /**
+         * Set PrintPosition
+         */
+        static void setPrintPosition( int v )
+        {
+            if (!self()->isImmutable( QString::fromLatin1( "PrintPosition" ) ))
+                self()->mPrintPosition = v;
+        }
+
+        /**
+         * Get PrintPosition
+         */
+        static int printPosition()
+        {
+            return self()->mPrintPosition;
+        }
+
+        /**
+         * Set PrintScaleMode
+         */
+        static void setPrintScaleMode(Digikam::PrintOptionsPage::ScaleMode v)
+        {
+            if (!self()->isImmutable( QString::fromLatin1( "PrintScaleMode" ) ))
+                self()->mPrintScaleMode = v;
+        }
+
+        /**
+         * Get PrintScaleMode
+         */
+        static PrintOptionsPage::ScaleMode printScaleMode()
+        {
+            return static_cast<PrintOptionsPage::ScaleMode>(self()->mPrintScaleMode);
 +        }
+
+        /**
+         * Set PrintEnlargeSmallerImages
+         */
+        static void setPrintEnlargeSmallerImages(bool v)
+        {
+            if (!self()->isImmutable( QString::fromLatin1( \
"PrintEnlargeSmallerImages" ) )) +                self()->mPrintEnlargeSmallerImages \
= v; +        }
+
+        /**
+         * Get PrintEnlargeSmallerImages
+         */
+        static bool printEnlargeSmallerImages()
+        {
+            return self()->mPrintEnlargeSmallerImages;
+        }
+
+        /**
+         * Set PrintWidth
+         */
+        static void setPrintWidth(double v)
+        {
+            if (!self()->isImmutable( QString::fromLatin1( "PrintWidth" ) ))
+                self()->mPrintWidth = v;
+        }
+
+        /**
+         * Get PrintWidth
+         */
+        static double printWidth()
+        {
+            return self()->mPrintWidth;
+        }
+
+        /**
+         * Set PrintHeight
+         */
+        static void setPrintHeight( double v )
+        {
+            if (!self()->isImmutable( QString::fromLatin1( "PrintHeight" ) ))
+                self()->mPrintHeight = v;
+        }
+
+        /**
+         * Get PrintHeight
+         */
+        static double printHeight()
+        {
+            return self()->mPrintHeight;
+        }
+
+        /**
+         * Set PrintUnit
+         */
+        static void setPrintUnit( PrintOptionsPage::Unit v )
+        {
+            if (!self()->isImmutable( QString::fromLatin1( "PrintUnit" ) ))
+                self()->mPrintUnit = v;
+        }
+
+        /**
+         * Get PrintUnit
+         */
+        static PrintOptionsPage::Unit printUnit()
+        {
+            return static_cast<PrintOptionsPage::Unit>(self()->mPrintUnit);
+        }
+
+        /** 
+         * Set PrintKeepRatio
+         */
+        static void setPrintKeepRatio( bool v )
+        {
+            if (!self()->isImmutable( QString::fromLatin1( "PrintKeepRatio" ) ))
+                self()->mPrintKeepRatio = v;
+        }
+
+        /**
+         * Get PrintKeepRatio
+         */
+        static bool printKeepRatio()
+        {
+            return self()->mPrintKeepRatio;
+        }
+
+        /**
+         * Set PrintColorManaged
+         */
+        static void setPrintColorManaged( bool v )
+        {
+            if (!self()->isImmutable( QString::fromLatin1( "PrintColorManaged" ) ))
+                self()->mPrintColorManaged = v;
+        }
+
+        /**
+         * Get PrintColorManaged
+         */
+        static bool printColorManaged()
+        {
+            return self()->mPrintColorManaged;
+        }
+
+        /**
+         * Set PrintAutoRotate
+         */
+        static void setPrintAutoRotate( bool v )
+        {
+            if (!self()->isImmutable( QString::fromLatin1( "PrintAutoRotate" ) ))
+                self()->mPrintAutoRotate = v;
+        }
+
+        /**
+         * Get PrintAutoRotate
+         */
+        static bool printAutoRotate()
+        {
+            return self()->mPrintAutoRotate;
+        }
+
+    protected:
+
+        PrintConfig();
+        friend class PrintConfigHelper;
+
+    protected:
+
+        int    mPrintPosition;
+        int    mPrintScaleMode;
+        bool   mPrintEnlargeSmallerImages;
+        double mPrintWidth;
+        double mPrintHeight;
+        int    mPrintUnit;
+        bool   mPrintKeepRatio;
+        bool   mPrintColorManaged;
+        bool   mPrintAutoRotate;
+};
+
+} // namespace Digikam
+
+#endif // _DIGIKAM_CONFIG_H_


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic