1 //=========================================================
2 //  MusE
3 //  Linux Music Editor
4 //    $Id: header.h,v 1.1.1.1 2003/10/27 18:55:03 wschweer Exp $
5 //  (C) Copyright 2000 Werner Schweer (ws@seh.de)
6 //
7 //  This program is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU General Public License
9 //  as published by the Free Software Foundation; version 2 of
10 //  the License, or (at your option) any later version.
11 //
12 //  This program is distributed in the hope that it will be useful,
13 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 //  GNU General Public License for more details.
16 //
17 //  You should have received a copy of the GNU General Public License
18 //  along with this program; if not, write to the Free Software
19 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 //=========================================================
22 
23 #ifndef __HEADER_H__
24 #define __HEADER_H__
25 
26 #include <QHeaderView>
27 #include <QString>
28 #include <QIcon>
29 
30 class QStandardItemModel;
31 class QAction;
32 class QWidget;
33 class QMouseEvent;
34 
35 namespace MusECore {
36 class Xml;
37 }
38 
39 namespace MusEGui {
40 
41 class Header : public QHeaderView {
42       Q_OBJECT
43 
44       QStandardItemModel *itemModel;
45 
46    public:
47       Header(QWidget* parent=0, const char* name=0);
48       void writeStatus(int level, MusECore::Xml&) const;
49       void readStatus(MusECore::Xml&);
50       QString columnLabel(int col);
51       QIcon columnIcon(int col);
52       void setColumnLabel( const QString & s, int col, int width = -1 );
53       void setColumnIcon(QIcon &icon, int col, int width = -1 );
54       void setToolTip(int col, const QString &text);
55       void setWhatsThis(int col, const QString &text);
56       void setStatusTip(int col, const QString &text);
57       void mousePressEvent ( QMouseEvent * e );
58       void removeColumn(int col);
59     private slots:
60       void changeColumns(QAction* a);
61 };
62 
63 } // namespace MusEGui
64 
65 #endif
66 
67