/***************************************************************************
* Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com> *
* *
- * Based on the Itemviews NG project from Trolltech Labs: *
- * http://qt.gitorious.org/qt-labs/itemviews-ng *
+ * Based on the Itemviews NG project from Trolltech Labs *
* *
* 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 *
#ifndef KITEMLISTSELECTIONMANAGER_H
#define KITEMLISTSELECTIONMANAGER_H
-#include <libdolphin_export.h>
-
-#include <kitemviews/kitemmodelbase.h>
-#include <kitemviews/kitemset.h>
+#include "dolphin_export.h"
+#include "kitemviews/kitemmodelbase.h"
+#include "kitemviews/kitemset.h"
#include <QObject>
/**
* @brief Allows to select and deselect items of a KItemListView.
*/
-class LIBDOLPHINPRIVATE_EXPORT KItemListSelectionManager : public QObject
+class DOLPHIN_EXPORT KItemListSelectionManager : public QObject
{
Q_OBJECT
Toggle
};
- KItemListSelectionManager(QObject* parent = 0);
- virtual ~KItemListSelectionManager();
+ explicit KItemListSelectionManager(QObject* parent = nullptr);
+ ~KItemListSelectionManager() override;
void setCurrentItem(int current);
int currentItem() const;
bool hasSelection() const;
void setSelected(int index, int count = 1, SelectionMode mode = Select);
+ /**
+ * Equivalent to:
+ * clearSelection();
+ * setSelected(index, count);
+ * but emitting once only selectionChanged signal
+ */
+ void replaceSelection(int index, int count = 1);
void clearSelection();
void beginAnchoredSelection(int anchor);