not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kcontrol / kfontinst / kcmfontinst / KCmFontInst.h
blob2c3fc947cc28b8e2517c675115fd48f2bbe4d962
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 KAction;
43 class QProcess;
44 class QLabel;
45 class QSplitter;
46 class QComboBox;
48 namespace KFI
51 class CFontFilter;
52 class CFontList;
53 class CFontPreview;
54 class CUpdateDialog;
55 class CFontListView;
56 class CProgressBar;
57 class CPreviewSelectAction;
59 class CKCmFontInst : public KCModule
61 Q_OBJECT
63 public:
65 explicit CKCmFontInst(QWidget *parent=NULL, const QVariantList &list=QVariantList());
66 virtual ~CKCmFontInst();
68 public Q_SLOTS:
70 QString quickHelp() const;
71 void fontSelected(const QModelIndex &index, bool en, bool dis);
72 void groupSelected(const QModelIndex &index);
73 void reload();
74 void addFonts();
75 void deleteFonts();
76 void copyFonts();
77 void moveFonts();
78 void enableFonts();
79 void disableFonts();
80 void addGroup();
81 void removeGroup();
82 void enableGroup();
83 void disableGroup();
84 void changeText();
85 void showPreview(bool s);
86 void duplicateFonts();
87 void print();
88 void printGroup();
89 void listingStarted();
90 void listingCompleted();
91 void refreshFontList();
92 void refreshFamilies();
93 void showInfo(const QString &info);
94 void setStatusBar();
95 void addFonts(const QSet<KUrl> &src);
96 void toggleFontManagement(bool on);
97 void selectMode(int mode);
98 void zoomIn();
99 void zoomOut();
101 private:
103 void selectGroup(CGroupListItem::EType grp);
104 void print(bool all);
105 void toggleGroup(bool enable);
106 void toggleFonts(bool enable, const QString &grp=QString());
107 void toggleFonts(CJobRunner::ItemList &urls, const QStringList &fonts, bool enable, const QString &grp,
108 bool hasSys);
109 bool working(bool displayMsg=true);
110 KUrl baseUrl(bool sys);
111 void selectMainGroup();
112 void doCmd(CJobRunner::ECommand cmd, const CJobRunner::ItemList &urls, const KUrl &dest);
113 CGroupListItem::EType getCurrentGroupType();
115 private:
117 QWidget *itsGroupsWidget,
118 *itsFontsWidget,
119 *itsPreviewWidget;
120 QComboBox *itsModeControl;
121 QAction *itsModeAct;
122 QSplitter *itsGroupSplitter,
123 *itsPreviewSplitter;
124 CFontPreview *itsPreview;
125 KConfig itsConfig;
126 QLabel *itsStatusLabel;
127 CProgressBar *itsListingProgress;
128 CFontList *itsFontList;
129 CFontListView *itsFontListView;
130 CGroupList *itsGroupList;
131 CGroupListView *itsGroupListView;
132 CPreviewSelectAction *itsPreviewControl;
133 KToggleAction *itsMgtMode,
134 *itsShowPreview;
135 KActionMenu *itsToolsMenu;
136 KAction *itsZoomInAction,
137 *itsZoomOutAction;
138 KPushButton *itsDeleteGroupControl,
139 *itsEnableGroupControl,
140 *itsDisableGroupControl,
141 *itsAddFontControl,
142 *itsDeleteFontControl,
143 *itsEnableFontControl,
144 *itsDisableFontControl;
145 CFontFilter *itsFilter;
146 QString itsLastStatusBarMsg;
147 KIO::Job *itsJob;
148 KProgressDialog *itsProgress;
149 CUpdateDialog *itsUpdateDialog;
150 KTempDir *itsTempDir;
151 QProcess *itsPrintProc;
152 KZip *itsExportFile;
153 QSet<QString> itsDeletedFonts;
154 KUrl::List itsModifiedUrls;
155 CJobRunner *itsRunner;
160 #endif