~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to parts/filecreate/filecreate_widget2.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2003 by Julian Rockey                                   *
3
 
 *   linux@jrockey.com                                                     *
4
 
 *                                                                         *
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
 
 ***************************************************************************/
10
 
 
11
 
#ifndef __FILECREATE_WIDGET2_H__
12
 
#define __FILECREATE_WIDGET2_H__
13
 
 
14
 
#include <kdeversion.h>
15
 
#include <qtable.h>
16
 
#include <qstring.h>
17
 
#include <qmap.h>
18
 
 
19
 
//#include <klistview.h>
20
 
 
21
 
#include "filecreate_typechooser.h"
22
 
 
23
 
class KIconLoader;
24
 
class KDevProject;
25
 
class FileCreatePart;
26
 
 
27
 
namespace FileCreate {
28
 
 
29
 
  class FileType;
30
 
 
31
 
  class FriendlyWidget : public QTable, public TypeChooser
32
 
    {
33
 
      Q_OBJECT
34
 
 
35
 
      public:
36
 
 
37
 
        FriendlyWidget(FileCreatePart *part);
38
 
        virtual ~FriendlyWidget();
39
 
 
40
 
        /**
41
 
         * Refreshes the widget with the part's file type list.
42
 
         */
43
 
        virtual void refresh();
44
 
        /**
45
 
         * Sets the currently highlighted file type.
46
 
         */
47
 
        virtual void setCurrent(const FileType * current);
48
 
 
49
 
#if QT_VERSION < 0x030100
50
 
        void selectRow(int row);
51
 
#endif
52
 
 
53
 
      protected:
54
 
        /**
55
 
         * Sets row <i>row</i> to filetype <i>filetype</i>.
56
 
         */
57
 
        virtual void setRow(int row, FileType * filetype);
58
 
        /**
59
 
         * Clears the table.
60
 
         */
61
 
        virtual void empty();
62
 
        /**
63
 
         * Sets some default column widths.
64
 
         */
65
 
        virtual void setDefaultColumnWidths();
66
 
        /**
67
 
         * Scans the cells in the table and adjusts their size based
68
 
         * on their contents.
69
 
         */
70
 
        virtual void resizeCells();
71
 
        /**
72
 
         * Sets the height of a row to the highest
73
 
         * cell in the row.
74
 
         */
75
 
        virtual void resizeRow(int row);
76
 
        /**
77
 
         * Sets the width of a column to the widest
78
 
         * cell in the column.
79
 
         */
80
 
        virtual void resizeColumn(int col);
81
 
 
82
 
        /**
83
 
         * The default icon loader, here for convenience.
84
 
         */
85
 
        KIconLoader * m_iconLoader;
86
 
        /**
87
 
         * A mapping of each row number to a file type.
88
 
         */
89
 
        QMap<int,FileType*> typeForRow;
90
 
        /**
91
 
         * The currently selected file type, or null if none.
92
 
         */
93
 
        FileType * m_selected;
94
 
 
95
 
      protected slots:
96
 
        /**
97
 
         * When a cell is selected by the user.
98
 
         */
99
 
        virtual void slotCellSelected(int row, int col);
100
 
        /**
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
104
 
         * takes place.
105
 
         */
106
 
        virtual void slotDoSelection();
107
 
 
108
 
 
109
 
    };
110
 
 
111
 
}
112
 
 
113
 
#endif