From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- parts/filecreate/filecreate_widget2.h | 113 ++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 parts/filecreate/filecreate_widget2.h (limited to 'parts/filecreate/filecreate_widget2.h') diff --git a/parts/filecreate/filecreate_widget2.h b/parts/filecreate/filecreate_widget2.h new file mode 100644 index 00000000..8b3d14e8 --- /dev/null +++ b/parts/filecreate/filecreate_widget2.h @@ -0,0 +1,113 @@ +/*************************************************************************** + * Copyright (C) 2003 by Julian Rockey * + * linux@jrockey.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. * + ***************************************************************************/ + +#ifndef __FILECREATE_WIDGET2_H__ +#define __FILECREATE_WIDGET2_H__ + +#include +#include +#include +#include + +//#include + +#include "filecreate_typechooser.h" + +class KIconLoader; +class KDevProject; +class FileCreatePart; + +namespace FileCreate { + + class FileType; + + class FriendlyWidget : public QTable, public TypeChooser + { + Q_OBJECT + + public: + + FriendlyWidget(FileCreatePart *part); + virtual ~FriendlyWidget(); + + /** + * Refreshes the widget with the part's file type list. + */ + virtual void refresh(); + /** + * Sets the currently highlighted file type. + */ + virtual void setCurrent(const FileType * current); + +#if QT_VERSION < 0x030100 + void selectRow(int row); +#endif + + protected: + /** + * Sets row row to filetype filetype. + */ + virtual void setRow(int row, FileType * filetype); + /** + * Clears the table. + */ + virtual void empty(); + /** + * Sets some default column widths. + */ + virtual void setDefaultColumnWidths(); + /** + * Scans the cells in the table and adjusts their size based + * on their contents. + */ + virtual void resizeCells(); + /** + * Sets the height of a row to the highest + * cell in the row. + */ + virtual void resizeRow(int row); + /** + * Sets the width of a column to the widest + * cell in the column. + */ + virtual void resizeColumn(int col); + + /** + * The default icon loader, here for convenience. + */ + KIconLoader * m_iconLoader; + /** + * A mapping of each row number to a file type. + */ + QMap typeForRow; + /** + * The currently selected file type, or null if none. + */ + FileType * m_selected; + + protected slots: + /** + * When a cell is selected by the user. + */ + virtual void slotCellSelected(int row, int col); + /** + * Invoked as a single shot after slotCellSelected, with m_selected + * set to the selected file type, so that + * the GUI will be updated before the selection event + * takes place. + */ + virtual void slotDoSelection(); + + + }; + +} + +#endif -- cgit v1.2.1