delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / kuiserver / uiserver.h
blob286bb122d53a49ae775cdd8e4c9d92ed6804606d
1 /**
2 * This file is part of the KDE project
3 * Copyright (C) 2006-2008 Rafael Fernández López <ereslibre@kde.org>
4 * Copyright (C) 2000 Matej Koss <koss@miesto.sk>
5 * David Faure <faure@kde.org>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License version 2 as published by the Free Software Foundation.
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.
22 #ifndef UISERVER_H
23 #define UISERVER_H
25 #include <QtGui/QListView>
26 #include <QtDBus/QDBusObjectPath>
28 #include <kxmlguiwindow.h>
29 #include <kio/global.h>
30 #include <kio/authinfo.h>
31 #include <kurl.h>
32 #include <ktoolbar.h>
34 #include <kuiserversettings.h>
36 class ProgressListModel;
37 class ProgressListDelegate;
38 class JobViewServerAdaptor;
39 class QToolBar;
40 class KTabWidget;
41 class KLineEdit;
42 class KPushButton;
43 class OrgKdeJobViewInterface;
44 class JobViewAdaptor;
46 class UIServer
47 : public KXmlGuiWindow
49 Q_OBJECT
50 Q_CLASSINFO("D-Bus Interface", "org.kde.JobViewServer")
52 public:
53 class JobView;
55 static UIServer* createInstance();
57 QDBusObjectPath requestView(const QString &appName, const QString &appIconName, int capabilities);
59 public Q_SLOTS:
60 void updateConfiguration();
61 void applySettings();
63 protected:
64 virtual void closeEvent(QCloseEvent *event);
66 private Q_SLOTS:
67 void showConfigurationDialog();
68 void slotServiceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
70 private:
71 UIServer();
72 virtual ~UIServer();
74 ProgressListModel *m_progressListModel;
75 ProgressListModel *m_progressListFinishedModel;
76 ProgressListDelegate *progressListDelegate;
77 ProgressListDelegate *progressListDelegateFinished;
78 QListView *listProgress;
79 QListView *listFinished;
80 KTabWidget *tabWidget;
82 QToolBar *toolBar;
83 KLineEdit *searchText;
85 static uint s_jobId;
86 static UIServer *s_uiserver;
88 friend class JobView;
91 class UIServer::JobView
92 : public QObject
94 Q_OBJECT
95 Q_CLASSINFO("D-Bus Interface", "org.kde.JobView")
97 public:
98 JobView(QObject *parent = 0);
100 void terminate(const QString &errorMessage);
101 void setSuspended(bool suspended);
102 void setTotalAmount(qlonglong amount, const QString &unit);
103 void setProcessedAmount(qlonglong amount, const QString &unit);
104 void setPercent(uint percent);
105 void setSpeed(qlonglong bytesPerSecond);
106 void setInfoMessage(const QString &infoMessage);
107 bool setDescriptionField(uint number, const QString &name, const QString &value);
108 void clearDescriptionField(uint number);
110 QDBusObjectPath objectPath() const;
112 Q_SIGNALS:
113 void suspendRequested();
114 void resumeRequested();
115 void cancelRequested();
117 private:
118 QDBusObjectPath m_objectPath;
120 friend class ProgressListDelegate;
123 #endif // UISERVER_H