Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / konqueror / settings / filetypes / kservicelistwidget.h
blob219d1a98cd4af208d37324c318ccae8d1f6e32c3
1 /* This file is part of the KDE project
2 Copyright (C) 2003 Waldo Bastian <bastian@kde.org>
3 Copyright (C) 2003 David Faure <faure@kde.org>
4 Copyright (C) 2002 Daniel Molkentin <molkentin@kde.org>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License version 2 or at your option version 3 as published
9 by the Free Software Foundation.
11 This program 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 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #ifndef _KSERVICELISTWIDGET_H
23 #define _KSERVICELISTWIDGET_H
25 #include <QGroupBox>
26 #include <QtGui/QListWidget>
27 #include <kservice.h>
28 class MimeTypeData;
29 class QPushButton;
30 class KService;
32 class KServiceListItem : public QListWidgetItem
34 public:
35 KServiceListItem( /*TODO const &*/ KService::Ptr pService, int kind );
36 bool isImmutable();
37 QString desktopPath;
38 QString localPath;
41 /**
42 * This widget holds a list of services, with 5 buttons to manage it.
43 * It's a separate class so that it can be used by both tabs of the
44 * module, once for applications and once for services.
45 * The "kind" is determined by the argument given to the constructor.
47 class KServiceListWidget : public QGroupBox
49 Q_OBJECT
50 public:
51 enum { SERVICELIST_APPLICATIONS, SERVICELIST_SERVICES };
52 explicit KServiceListWidget(int kind, QWidget *parent = 0);
54 void setMimeTypeData( MimeTypeData * item );
56 Q_SIGNALS:
57 void changed(bool);
59 protected Q_SLOTS:
60 void promoteService();
61 void demoteService();
62 void addService();
63 void editService();
64 void removeService();
65 void enableMoveButtons();
67 protected:
68 void updatePreferredServices();
70 private:
71 int m_kind;
72 QListWidget *servicesLB;
73 QPushButton *servUpButton, *servDownButton;
74 QPushButton *servNewButton, *servEditButton, *servRemoveButton;
75 MimeTypeData *m_mimeTypeData;
78 #endif