1 /***************************************************************************
2                           materialkatalogview.h
3                              -------------------
4     begin                : 2006-11-30
5     copyright            : (C) 2006 by Klaas Freitag
6     email                : freitag@kde.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 #ifndef MATERIALKATALOGVIEW_H
18 #define MATERIALKATALOGVIEW_H
19 
20 #include <katalogview.h>
21 
22 #include "materialkataloglistview.h"
23 
24 class QBoxLayout;
25 class QTreeWidgetItem;
26 class BrunsKatalogListView;
27 class QLabel;
28 class MaterialTemplDialog;
29 
30 /**
31 @author Klaas Freitag
32 */
33 class MaterialKatalogView : public KatalogView
34 {
35   Q_OBJECT
36 public:
37   MaterialKatalogView();
38 
39   ~MaterialKatalogView();
40 
41   void createCentralWidget(QBoxLayout*, QWidget *w);
getListView()42   KatalogListView* getListView() { return m_materialListView; }
43 
44   static const QString MaterialCatalogName;
45 
46 protected slots:
47   void slNewTemplate();
48   void slEditTemplate();
49   void slDeleteTemplate();
50 
51   void openDialog( QTreeWidgetItem *, StockMaterial *, bool );
52   void slotEditRejected();
53   void slotEditOk( StockMaterial * );
54 
55 protected:
56   Katalog* getKatalog( const QString& );
57 
58   void saveWindowState( const QByteArray& arr );
59   QByteArray windowState();
60 
61   void saveWindowGeo( const QByteArray& arr );
62   QByteArray windowGeo();
63 
64   MaterialKatalogListView *m_materialListView;
65   QLabel               *m_detailLabel;
66   QTreeWidget           *m_details;
67   MaterialTemplDialog *mDialog;
68   QTreeWidgetItem *mNewItem;
69 };
70 
71 #endif
72