File indexing completed on 2024-04-28 04:32:44

0001 /*
0002     SPDX-FileCopyrightText: 2007 Pino Toscano <pino@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef _OKULAR_PAGESIZE_H_
0008 #define _OKULAR_PAGESIZE_H_
0009 
0010 #include <QList>
0011 #include <QSharedDataPointer>
0012 #include <QString>
0013 
0014 #include "okularcore_export.h"
0015 
0016 namespace Okular
0017 {
0018 class PageSizePrivate;
0019 
0020 /**
0021  * @short A small class that represents the size of a page.
0022  */
0023 class OKULARCORE_EXPORT PageSize
0024 {
0025 public:
0026     typedef QList<PageSize> List;
0027 
0028     /**
0029      * Construct a null page size.
0030      * @see isNull()
0031      */
0032     PageSize();
0033     /**
0034      * Construct a page size with the specified @p width and @p height,
0035      * having the ID @p name.
0036      */
0037     PageSize(double width, double height, const QString &name);
0038     /**
0039      * Copy constructor.
0040      */
0041     PageSize(const PageSize &pageSize);
0042     ~PageSize();
0043 
0044     /**
0045      * Returns the width of the page size.
0046      */
0047     double width() const;
0048     /**
0049      * Returns the height of the page size.
0050      */
0051     double height() const;
0052     /**
0053      * Returns the ID of the page size.
0054      */
0055     QString name() const;
0056 
0057     /**
0058      * Whether the page size is null.
0059      */
0060     bool isNull() const;
0061 
0062     PageSize &operator=(const PageSize &pageSize);
0063 
0064     /**
0065      * Comparison operator.
0066      */
0067     bool operator==(const PageSize &pageSize) const;
0068 
0069     bool operator!=(const PageSize &pageSize) const;
0070 
0071 private:
0072     /// @cond PRIVATE
0073     friend class PageSizePrivate;
0074     /// @endcond
0075     QSharedDataPointer<PageSizePrivate> d;
0076 };
0077 
0078 }
0079 
0080 #endif