KDEUI
kbreadcrumbselectionmodel.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2010 Klarälvdalens Datakonsult AB, 00003 a KDAB Group company, info@kdab.net, 00004 author Stephen Kelly <stephen@kdab.com> 00005 00006 This library is free software; you can redistribute it and/or modify it 00007 under the terms of the GNU Library General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or (at your 00009 option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, but WITHOUT 00012 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00013 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00014 License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to the 00018 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 02110-1301, USA. 00020 */ 00021 00022 #ifndef KBREADCRUMBSPROXYMODEL_H 00023 #define KBREADCRUMBSPROXYMODEL_H 00024 00025 #include <QtGui/QItemSelectionModel> 00026 #include <QtCore/QAbstractItemModel> 00027 00028 #include "kdeui_export.h" 00029 00030 class KBreadcrumbSelectionModelPrivate; 00031 00109 class KDEUI_EXPORT KBreadcrumbSelectionModel : public QItemSelectionModel 00110 { 00111 Q_OBJECT 00112 public: 00113 enum BreadcrumbTarget 00114 { 00115 MakeBreadcrumbSelectionInOther, 00116 MakeBreadcrumbSelectionInSelf 00117 }; 00118 00119 explicit KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, QObject* parent = 0); 00120 KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, BreadcrumbTarget target, QObject* parent = 0); 00121 virtual ~KBreadcrumbSelectionModel(); 00122 00128 bool isActualSelectionIncluded() const; 00129 00133 void setActualSelectionIncluded(bool isActualSelectionIncluded); 00134 00138 int breadcrumbLength() const; 00139 00146 void setBreadcrumbLength(int breadcrumbLength); 00147 00148 /* reimp */ void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command); 00149 00150 /* reimp */ void select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command); 00151 00152 protected: 00153 KBreadcrumbSelectionModelPrivate * const d_ptr; 00154 private: 00155 //@cond PRIVATE 00156 Q_DECLARE_PRIVATE(KBreadcrumbSelectionModel) 00157 Q_PRIVATE_SLOT( d_func(),void sourceSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)) 00158 Q_PRIVATE_SLOT( d_func(),void syncBreadcrumbs()) 00159 //@cond PRIVATE 00160 }; 00161 00162 00163 #endif
KDE 4.6 API Reference