Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / kcontrol / kfontinst / kcmfontinst / KCmFontInst.h
blobcd2eefb412b4aca212091b938f9db24acad81438
1 #ifndef __KCM_FONT_INST_H__
2 #define __KCM_FONT_INST_H__
4 /*
5 * KFontInst - KDE Font Installer
7 * Copyright 2003-2007 Craig Drummond <craig@kde.org>
9 * ----
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.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; see the file COPYING. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
27 #include <config-workspace.h>
28 #include "GroupList.h"
29 #include "JobRunner.h"
30 #include <QtCore/QSet>
31 #include <KDE/KCModule>
32 #include <KDE/KUrl>
33 #include <KDE/KConfig>
34 #include <KDE/KIO/Job>
36 class KPushButton;
37 class KProgressDialog;
38 class KTempDir;
39 class KZip;
40 class KToggleAction;
41 class KActionMenu;
42 class QProcess;
43 class QLabel;
44 class QSplitter;
45 class QComboBox;
47 namespace KFI
50 class CFontFilter;
51 class CFontList;
52 class CFontPreview;
53 class CUpdateDialog;
54 class CFontListView;
55 class CProgressBar;
56 class CPreviewSelectAction;
58 class CKCmFontInst : public KCModule
60 Q_OBJECT
62 public:
64 explicit CKCmFontInst(QWidget *parent=NULL, const QVariantList &list=QVariantList());
65 virtual ~CKCmFontInst();
67 public Q_SLOTS:
69 QString quickHelp() const;
70 void fontSelected(const QModelIndex &index, bool en, bool dis);
71 void groupSelected(const QModelIndex &index);
72 void reload();
73 void addFonts();
74 void deleteFonts();
75 void copyFonts();
76 void moveFonts();
77 void enableFonts();
78 void disableFonts();
79 void addGroup();
80 void removeGroup();
81 void enableGroup();
82 void disableGroup();
83 void changeText();
84 void showPreview(bool s);
85 void duplicateFonts();
86 void print();
87 void printGroup();
88 void listingStarted();
89 void listingCompleted();
90 void refreshFontList();
91 void refreshFamilies();
92 void showInfo(const QString &info);
93 void setStatusBar();
94 void addFonts(const QSet<KUrl> &src);
95 void toggleFontManagement(bool on);
96 void selectMode(int mode);
98 private:
100 void selectGroup(CGroupListItem::EType grp);
101 void print(bool all);
102 void toggleGroup(bool enable);
103 void toggleFonts(bool enable, const QString &grp=QString());
104 void toggleFonts(CJobRunner::ItemList &urls, const QStringList &fonts, bool enable, const QString &grp,
105 bool hasSys);
106 bool working(bool displayMsg=true);
107 KUrl baseUrl(bool sys);
108 void selectMainGroup();
109 void doCmd(CJobRunner::ECommand cmd, const CJobRunner::ItemList &urls, const KUrl &dest);
110 CGroupListItem::EType getCurrentGroupType();
112 private:
114 QWidget *itsGroupsWidget,
115 *itsFontsWidget,
116 *itsPreviewWidget;
117 QComboBox *itsModeControl;
118 QAction *itsModeAct;
119 QSplitter *itsGroupSplitter,
120 *itsPreviewSplitter;
121 CFontPreview *itsPreview;
122 KConfig itsConfig;
123 QLabel *itsStatusLabel;
124 CProgressBar *itsListingProgress;
125 CFontList *itsFontList;
126 CFontListView *itsFontListView;
127 CGroupList *itsGroupList;
128 CGroupListView *itsGroupListView;
129 CPreviewSelectAction *itsPreviewControl;
130 KToggleAction *itsMgtMode,
131 *itsShowPreview;
132 KActionMenu *itsToolsMenu;
133 KPushButton *itsDeleteGroupControl,
134 *itsEnableGroupControl,
135 *itsDisableGroupControl,
136 *itsAddFontControl,
137 *itsDeleteFontControl,
138 *itsEnableFontControl,
139 *itsDisableFontControl;
140 CFontFilter *itsFilter;
141 QString itsLastStatusBarMsg;
142 KIO::Job *itsJob;
143 KProgressDialog *itsProgress;
144 CUpdateDialog *itsUpdateDialog;
145 KTempDir *itsTempDir;
146 QProcess *itsPrintProc;
147 KZip *itsExportFile;
148 QSet<QString> itsDeletedFonts;
149 KUrl::List itsModifiedUrls;
150 CJobRunner *itsRunner;
155 #endif