2006-11-21 06:02:05 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Peter Penz *
|
|
|
|
* peter.penz@gmx.at *
|
|
|
|
* *
|
|
|
|
* 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., *
|
2006-12-08 21:24:08 +00:00
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
2006-11-21 06:02:05 +00:00
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef DOLPHINDETAILSVIEW_H
|
|
|
|
#define DOLPHINDETAILSVIEW_H
|
|
|
|
|
2007-02-05 23:18:22 +00:00
|
|
|
#include <dolphinview.h>
|
2007-02-27 20:46:21 +00:00
|
|
|
#include <QStyleOptionViewItem>
|
2007-01-15 06:43:17 +00:00
|
|
|
#include <QTreeView>
|
2006-11-21 06:02:05 +00:00
|
|
|
|
2007-02-14 21:54:24 +00:00
|
|
|
class DolphinController;
|
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
/**
|
|
|
|
* @brief Represents the details view which shows the name, size,
|
2007-01-25 22:28:04 +00:00
|
|
|
* date, permissions, owner and group of an item.
|
2006-11-21 06:02:05 +00:00
|
|
|
*
|
2007-01-25 22:28:04 +00:00
|
|
|
* The width of the columns is automatically adjusted in a way
|
2006-11-21 06:02:05 +00:00
|
|
|
* that full available width of the view is used by stretching the width
|
|
|
|
* of the name column.
|
|
|
|
*/
|
2007-01-15 06:43:17 +00:00
|
|
|
class DolphinDetailsView : public QTreeView
|
2006-11-21 06:02:05 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2007-02-14 21:54:24 +00:00
|
|
|
explicit DolphinDetailsView(QWidget* parent, DolphinController* controller);
|
2006-11-21 06:02:05 +00:00
|
|
|
virtual ~DolphinDetailsView();
|
2007-01-25 22:28:04 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool event(QEvent* event);
|
|
|
|
virtual QStyleOptionViewItem viewOptions() const;
|
|
|
|
virtual void contextMenuEvent(QContextMenuEvent* event);
|
|
|
|
virtual void mouseReleaseEvent(QMouseEvent* event);
|
|
|
|
virtual void dragEnterEvent(QDragEnterEvent* event);
|
|
|
|
virtual void dropEvent(QDropEvent* event);
|
|
|
|
|
2007-02-05 23:18:22 +00:00
|
|
|
private slots:
|
|
|
|
/**
|
|
|
|
* Sets the sort indicator section of the header view
|
|
|
|
* corresponding to \a sorting.
|
|
|
|
*/
|
|
|
|
void setSortIndicatorSection(DolphinView::Sorting sorting);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the sort indicator order of the header view
|
|
|
|
* corresponding to \a sortOrder.
|
|
|
|
*/
|
|
|
|
void setSortIndicatorOrder(Qt::SortOrder sortOrder);
|
|
|
|
|
2007-02-06 06:43:34 +00:00
|
|
|
/**
|
|
|
|
* Synchronizes the sorting state of the Dolphin menu 'View -> Sort'
|
|
|
|
* with the current state of the details view.
|
|
|
|
* @param column Index of the current sorting column.
|
|
|
|
*/
|
|
|
|
void synchronizeSortingState(int column);
|
|
|
|
|
2007-01-25 22:28:04 +00:00
|
|
|
private:
|
2007-02-14 21:54:24 +00:00
|
|
|
DolphinController* m_controller;
|
2007-02-27 20:46:21 +00:00
|
|
|
QStyleOptionViewItem m_viewOptions;
|
2006-11-21 06:02:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|