]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistheader.h
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / kitemviews / kitemlistheader.h
index ef1dd0f859a2b6b510e3cf98896304916fe5bc2e..d84832dab63a608bf9b7631afa2e68f947b2967b 100644 (file)
@@ -1,26 +1,14 @@
-/***************************************************************************
- *   Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com>             *
- *                                                                         *
- *   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 of the License, 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.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2012 Peter Penz <peter.penz19@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #ifndef KITEMLISTHEADER_H
 #define KITEMLISTHEADER_H
 
 #include "dolphin_export.h"
+
 #include <QHash>
 #include <QObject>
 
@@ -53,8 +41,8 @@ public:
      * the width only gets applied if KItemListHeader::automaticColumnResizing()
      * has been turned off.
      */
-    void setColumnWidth(const QByteArrayrole, qreal width);
-    qreal columnWidth(const QByteArrayrole) const;
+    void setColumnWidth(const QByteArray &role, qreal width);
+    qreal columnWidth(const QByteArray &role) const;
 
     /**
      * Sets the widths of the columns for all roles. From a performance point of
@@ -63,39 +51,44 @@ public:
      * Note that the widths only get applied if KItemListHeader::automaticColumnResizing()
      * has been turned off.
      */
-    void setColumnWidths(const QHash<QByteArray, qreal>columnWidths);
+    void setColumnWidths(const QHash<QByteArray, qreal> &columnWidths);
 
     /**
      * @return The column width that is required to show the role unclipped.
      */
-    qreal preferredColumnWidth(const QByteArray& role) const;
+    qreal preferredColumnWidth(const QByteArray &role) const;
+
+    /**
+     * Sets the widths of the columns *before* the first column and *after* the last column.
+     * This is intended to facilitate an empty region for deselection in the main viewport.
+     */
+    void setSidePadding(qreal leftPaddingWidth, qreal rightPaddingWidth);
+    qreal leftPadding() const;
+    qreal rightPadding() const;
+
+Q_SIGNALS:
+    void sidePaddingChanged(qreal leftPaddingWidth, qreal rightPaddingWidth);
 
-signals:
     /**
      * Is emitted if the width of a column has been adjusted by the user with the mouse
      * (no signal is emitted if KItemListHeader::setColumnWidth() is invoked).
      */
-    void columnWidthChanged(const QByteArray& role,
-                            qreal currentWidth,
-                            qreal previousWidth);
+    void columnWidthChanged(const QByteArray &role, qreal currentWidth, qreal previousWidth);
 
     /**
      * Is emitted if the user has released the mouse button after adjusting the
      * width of a visible role.
      */
-    void columnWidthChangeFinished(const QByteArray& role,
-                                   qreal currentWidth);
+    void columnWidthChangeFinished(const QByteArray &role, qreal currentWidth);
 
 private:
-    explicit KItemListHeader(KItemListViewlistView);
+    explicit KItemListHeader(KItemListView *listView);
 
 private:
-    KItemListViewm_view;
-    KItemListHeaderWidgetm_headerWidget;
+    KItemListView *m_view;
+    KItemListHeaderWidget *m_headerWidget;
 
     friend class KItemListView; // Constructs the KItemListHeader instance
 };
 
 #endif
-
-