2 * This file is part of the System Settings package
3 * Copyright (C) 2005 Benjamin C Meyer (ben+systempreferences at meyerhome dot net)
4 * (C) 2007 Will Stephenson <wstephenson@kde.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
27 #include <KXmlGuiWindow>
29 class QAbstractItemModel
;
41 class MainWindow
: public KXmlGuiWindow
46 explicit MainWindow(QWidget
*parent
=0);
50 * Called when the mainwindow is closed.
52 virtual bool queryClose();
55 virtual QSize
sizeHint() const;
58 void selectionChanged( const QModelIndex
& selected
);
59 void updateSearchHits();
64 void readMenu( MenuItem
* );
67 const KService::List categories
;
68 const KService::List modules
;
70 QStackedWidget
*windowStack
;
71 KTabWidget
*moduleTabs
;
74 KCMultiWidget
*groupWidget
;
76 QHash
<KService::Ptr
,KCMultiWidget
*> moduleItemToWidgetDict
;
77 QHash
<const QAbstractItemModel
*,int> modelToTabHash
;
79 KAction
*showOverviewAction
;
82 KAction
*searchAction
;
84 void buildMainWidget();
87 QLabel
*generalHitLabel
;
88 QLabel
*advancedHitLabel
;
91 bool pageLessThan( MenuItem
*page1
, MenuItem
*page2
);