1
/***************************************************************************
2
* Copyright (C) 2003 by Julian Rockey *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
9
***************************************************************************/
11
#ifndef __FILECREATE_WIDGET2_H__
12
#define __FILECREATE_WIDGET2_H__
14
#include <kdeversion.h>
19
//#include <klistview.h>
21
#include "filecreate_typechooser.h"
27
namespace FileCreate {
31
class FriendlyWidget : public QTable, public TypeChooser
37
FriendlyWidget(FileCreatePart *part);
38
virtual ~FriendlyWidget();
41
* Refreshes the widget with the part's file type list.
43
virtual void refresh();
45
* Sets the currently highlighted file type.
47
virtual void setCurrent(const FileType * current);
49
#if QT_VERSION < 0x030100
50
void selectRow(int row);
55
* Sets row <i>row</i> to filetype <i>filetype</i>.
57
virtual void setRow(int row, FileType * filetype);
63
* Sets some default column widths.
65
virtual void setDefaultColumnWidths();
67
* Scans the cells in the table and adjusts their size based
70
virtual void resizeCells();
72
* Sets the height of a row to the highest
75
virtual void resizeRow(int row);
77
* Sets the width of a column to the widest
80
virtual void resizeColumn(int col);
83
* The default icon loader, here for convenience.
85
KIconLoader * m_iconLoader;
87
* A mapping of each row number to a file type.
89
QMap<int,FileType*> typeForRow;
91
* The currently selected file type, or null if none.
93
FileType * m_selected;
97
* When a cell is selected by the user.
99
virtual void slotCellSelected(int row, int col);
101
* Invoked as a single shot after slotCellSelected, with m_selected
102
* set to the selected file type, so that
103
* the GUI will be updated before the selection event
106
virtual void slotDoSelection();