SVN_SILENT made messages (.desktop file)
[kdeadmin.git] / kpackage / packageDisplay.h
blob319d6cd0068fc5ec07afad2a8be162d9e2c6e658
1 /*
2 ** Copyright (C) 1999,2000 Toivo Pedaste <toivo@ucs.uwa.edu.au>
3 **
4 // This widget is used to display information and the file list of a
5 // package.
6 //
7 // Package information will be displayed using (another) sub-widget
8 // that is inherited from a QTableView.
9 //
10 // The file list will be displayed using a tree list.
12 // The widget is mainly a QTabDialog with two tabs: Info and FileList.
13 // The Info tab is the default one.
17 ** This program is free software; you can redistribute it and/or modify
18 ** it under the terms of the GNU General Public License as published by
19 ** the Free Software Foundation; either version 2 of the License, or
20 ** (at your option) any later version.
22 ** This program is distributed in the hope that it will be useful,
23 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
24 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ** GNU General Public License for more details.
27 ** You should have received a copy of the GNU General Public License
28 ** along with this program in a file called COPYING; if not, write to
29 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
30 ** MA 02110-1301, USA.
34 ** Bug reports and questions can be sent to kde-devel@kde.org
37 #ifndef PACKAGEDISPLAY_H
38 #define PACKAGEDISPLAY_H
40 // Qt Headers
41 #include <QtGui/QTabBar>
42 #include <QtGui/QTabWidget>
43 #include <kvbox.h>
44 //Added by qt3to4:
45 #include <QtGui/QPixmap>
46 #include <kmenu.h>
47 #include <k3listview.h>
49 class packagePropertiesWidget;
50 class packageDepends;
51 class packageInfo;
52 class Q3ListViewItem;
53 class QTextEdit;
54 class packageDisplayWidget;
55 class kpFileList : public K3ListView
57 Q_OBJECT
59 public:
61 kpFileList(QWidget* parent, packageDisplayWidget* parent2);
62 virtual ~kpFileList() {}
63 QString item2Path(Q3ListViewItem *it);
66 public slots:
68 void openContext(K3ListView *, Q3ListViewItem *, const QPoint &);
70 virtual void clear();
72 Q3ListViewItem* insert(const QString &cur, const QPixmap &pixmap);
75 private:
76 KMenu *FileListMenu;
77 packageDisplayWidget* pkDisplay;
79 int openwith;
83 class packageDisplayWidget : public QTabWidget
85 Q_OBJECT
87 friend class kpFileList;
88 ///////////// METHODS ------------------------------------------------------
89 public:
90 packageDisplayWidget(QWidget *parent=0);
91 // Constructor
93 ~packageDisplayWidget();
94 // Destructor
96 void noPackage();
97 // clear package display in right panel
99 void changePackage(packageInfo *p);
100 // Set currently selected package
102 private:
103 void setupWidgets();
104 // This sets up the sub-widgets
106 void updateFileList();
107 // This updates the file list to match that found with the currently
108 // selected package
110 void updateDepends();
111 // Update dependency list
113 void updateChangeLog();
114 // This updates the change log to match that found with the currently
115 // selected package
117 void tabSet(QWidget *);
118 // Set display for corresponding tab
120 ///////////// SLOTS --------------------------------------------------------
121 public slots:
123 void tabSelected(QWidget *);
125 void openBinding(Q3ListViewItem *);
127 void openBindingWith(Q3ListViewItem *);
129 void __openBindingWith();
132 ///////////// SIGNALS ------------------------------------------------------
134 ///////////// DATA ---------------------------------------------------------
135 public:
136 packageInfo *package;
137 // the currently selected package
139 private:
141 QTabWidget *tabbar;
142 // The tab bar
144 KVBox *proptab, *deptab, *fltab, *cltab;
146 QWidget *curTab;
147 // current active tab
149 kpFileList *fileList;
150 // This holds the file list (and is used as a page on the tab dialog)
152 QTextEdit *changeLog;
153 // Holds changelog
155 QPixmap tick, cross, question, *blank;
156 // The pixmaps for the filelist
158 packagePropertiesWidget *packageProperties;
159 // This displays the package properties (and is used as a page on the
160 // tab dialog)
162 packageDepends *depends;
163 // Dependency display in tab dialog
165 bool initList;
166 // True is file list has been initialised
168 #endif