File indexing completed on 2024-04-21 04:41:50

0001 /* This file is part of the KDE project
0002    Copyright (C) 2015 by Adam Pigg <adam@piggz.co.uk>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2.1 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017    Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef KREPORTPAGESIZE_H
0021 #define KREPORTPAGESIZE_H
0022 #include <QPageSize>
0023 #include "kreport_export.h"
0024 
0025 /**
0026  * @brief Handle the page sizes we support in reports
0027  *
0028  * A group of helper functions and definitions of the page sizes
0029  * we support in KReport.
0030  *
0031  * We don't support all the sizes supported by Qt, so here we provide a list
0032  * of supported sizes and translatable descriptions, with helper functions to
0033  * switch between QString and QPageSizeId
0034  *
0035  */
0036 namespace KReportPageSize
0037 {
0038 
0039 /**
0040  * @return list of translated names of all the available formats
0041  */
0042 KREPORT_EXPORT QStringList pageFormatNames();
0043 
0044 /**
0045  * @return list of non-translated names of all the available formats
0046  */
0047 KREPORT_EXPORT QStringList pageFormatKeys();
0048 
0049 /**
0050  * @return the default format (based on the default printer)
0051  */
0052 KREPORT_EXPORT QPageSize::PageSizeId defaultSize();
0053 
0054 /**
0055  * @return the page size Id for the given key
0056  */
0057 KREPORT_EXPORT QPageSize::PageSizeId pageSize(const QString& key);
0058 
0059 /**
0060  * @return the page size string for the given Id
0061  */
0062 KREPORT_EXPORT QString pageSizeKey(QPageSize::PageSizeId id);
0063 
0064 
0065 }
0066 
0067 #endif // KREPORTPAGESIZE_H