annotate kdiff3/src-QT4/kreplacements/kreplacements.h @ 92:4e6ebbbae925 0.9.95

KDiff3 0.9.95
author joachim99
date Tue, 03 Mar 2009 23:50:12 +0000
parents fcd146072e0c
children 6f42f5bd218e
rev   line source
joachim99@8 1 /***************************************************************************
joachim99@8 2 kreplacements.h - description
joachim99@8 3 -------------------
joachim99@8 4 begin : Sat Aug 3 2002
joachim99@69 5 copyright : (C) 2002-2006 by Joachim Eibl
joachim99@69 6 email : joachim.eibl at gmx.de
joachim99@8 7 ***************************************************************************/
joachim99@8 8
joachim99@8 9 /***************************************************************************
joachim99@8 10 * *
joachim99@8 11 * This program is free software; you can redistribute it and/or modify *
joachim99@8 12 * it under the terms of the GNU General Public License as published by *
joachim99@8 13 * the Free Software Foundation; either version 2 of the License, or *
joachim99@8 14 * (at your option) any later version. *
joachim99@8 15 * *
joachim99@8 16 ***************************************************************************/
joachim99@8 17
joachim99@8 18 #ifndef KREPLACEMENTS_H
joachim99@8 19 #define KREPLACEMENTS_H
joachim99@80 20 #pragma once
joachim99@8 21
joachim99@69 22 #include "common.h"
joachim99@69 23
joachim99@92 24 #include <QSharedData>
joachim99@75 25 #include <QMainWindow>
joachim99@75 26 #include <QAction>
joachim99@75 27 #include <QDialog>
joachim99@75 28 #include <QApplication>
joachim99@75 29 #include <QPushButton>
joachim99@75 30 #include <QToolBar>
joachim99@75 31 #include <QProgressBar>
joachim99@75 32 #include <QPrinter>
joachim99@80 33 //Added by qt3to4:
joachim99@80 34 #include <QLabel>
joachim99@80 35 #include <QPixmap>
joachim99@80 36 #include <QFrame>
joachim99@80 37 #include <QPaintEvent>
joachim99@75 38
joachim99@75 39 class QTabWidget;
joachim99@75 40 class QLabel;
joachim99@8 41
joachim99@8 42 #include <map>
joachim99@66 43 #include <list>
joachim99@8 44
joachim99@92 45 QString getTranslationDir(const QString&);
joachim99@53 46
joachim99@8 47 class KMainWindow;
joachim99@80 48 class KAction;
joachim99@80 49 class KIcon;
joachim99@8 50
joachim99@80 51 typedef QString KGuiItem;
joachim99@80 52
joachim99@80 53 inline QString i18n( const char* x ){ return QObject::tr(x); }
joachim99@80 54
joachim99@80 55 template <typename A1>
joachim99@80 56 inline QString i18n (const char *text, const A1 &a1)
joachim99@80 57 { return QObject::tr(text).arg(a1); }
joachim99@80 58
joachim99@80 59 template <typename A1, typename A2>
joachim99@80 60 inline QString i18n (const char *text, const A1 &a1, const A2 &a2)
joachim99@80 61 { return QObject::tr(text).arg(a1).arg(a2); }
joachim99@80 62
joachim99@80 63 template <typename A1, typename A2, typename A3>
joachim99@80 64 inline QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
joachim99@80 65 { return QObject::tr(text).arg(a1).arg(a2).arg(a3); }
joachim99@80 66
joachim99@80 67 template <typename A1, typename A2, typename A3, typename A4>
joachim99@80 68 inline QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
joachim99@80 69 { return QObject::tr(text).arg(a1).arg(a2).arg(a3).arg(a4); }
joachim99@80 70
joachim99@80 71
joachim99@80 72 typedef QString KLocalizedString;
joachim99@80 73 #define ki18n(x) QObject::tr(x)
joachim99@80 74 #define I18N_NOOP(x) x
joachim99@80 75 #define RESTORE(x)
joachim99@80 76 #define _UNLOAD(x)
joachim99@80 77
joachim99@80 78 class KUrl
joachim99@8 79 {
joachim99@8 80 public:
joachim99@80 81 KUrl(){}
joachim99@80 82 KUrl(const QString& s){ m_s = s; }
joachim99@80 83 static KUrl fromPathOrUrl( const QString& s ){ return KUrl(s); }
joachim99@8 84 QString url() const { return m_s; }
joachim99@8 85 bool isEmpty() const { return m_s.isEmpty(); }
joachim99@80 86 QString prettyUrl() const { return m_s; }
joachim99@8 87 bool isLocalFile() const { return true; }
joachim99@80 88 bool isRelative() const { return true; }
joachim99@8 89 bool isValid() const { return true; }
joachim99@8 90 QString path() const { return m_s; }
joachim99@8 91 void setPath( const QString& s ){ m_s=s; }
joachim99@8 92 QString fileName() const { return m_s; } // not really needed
joachim99@8 93 void addPath( const QString& s ){ m_s += "/" + s; }
joachim99@8 94 private:
joachim99@8 95 QString m_s;
joachim99@8 96 };
joachim99@8 97
joachim99@80 98 typedef QString KGuiItem;
joachim99@80 99
joachim99@80 100 class KStandardGuiItem
joachim99@80 101 {
joachim99@80 102 public:
joachim99@80 103 static QString cont() { return i18n("Continue"); }
joachim99@80 104 static QString cancel() { return i18n("Cancel"); }
joachim99@80 105 static QString quit() { return i18n("Quit"); }
joachim99@80 106 };
joachim99@80 107
joachim99@8 108 class KMessageBox
joachim99@8 109 {
joachim99@8 110 public:
joachim99@8 111 static void error( QWidget* parent, const QString& text, const QString& caption=QString() );
joachim99@8 112 static int warningContinueCancel( QWidget* parent, const QString& text, const QString& caption=QString(),
joachim99@8 113 const QString& button1=QString("Continue") );
joachim99@8 114 static void sorry( QWidget* parent, const QString& text, const QString& caption=QString() );
joachim99@8 115 static void information( QWidget* parent, const QString& text, const QString& caption=QString() );
joachim99@8 116 static int warningYesNo( QWidget* parent, const QString& text, const QString& caption,
joachim99@8 117 const QString& button1, const QString& button2 );
joachim99@8 118 static int warningYesNoCancel(
joachim99@8 119 QWidget* parent, const QString& text, const QString& caption,
joachim99@8 120 const QString& button1, const QString& button2 );
joachim99@8 121
joachim99@8 122 enum {Cancel=-1, No=0, Yes=1, Continue=1};
joachim99@8 123 };
joachim99@8 124
joachim99@8 125
joachim99@8 126
joachim99@80 127 typedef QMenu KMenu;
joachim99@80 128
joachim99@80 129 class KPageWidgetItem : public QObject
joachim99@80 130 {
joachim99@80 131 public:
joachim99@80 132 QWidget* m_pWidget;
joachim99@80 133 QString m_title;
joachim99@80 134
joachim99@80 135 KPageWidgetItem( QWidget* pPage, const QString& title )
joachim99@80 136 {
joachim99@80 137 m_pWidget = pPage;
joachim99@80 138 m_title = title;
joachim99@80 139 }
joachim99@80 140 void setHeader( const QString& ) {}
joachim99@80 141 void setIcon( const KIcon& ) {}
joachim99@80 142 };
joachim99@80 143
joachim99@80 144
joachim99@80 145 class KPageDialog : public QDialog
joachim99@8 146 {
joachim99@8 147 Q_OBJECT
joachim99@75 148 QTabWidget* m_pTabWidget;
joachim99@8 149 public:
joachim99@80 150 KPageDialog( QWidget* parent );
joachim99@80 151 ~KPageDialog();
joachim99@8 152
joachim99@80 153 void incrementInitialSize ( const QSize& );
joachim99@8 154 void setHelp(const QString& helpfilename, const QString& );
joachim99@8 155 enum {IconList, Help, Default, Apply, Ok, Cancel };
joachim99@8 156
joachim99@8 157 int BarIcon(const QString& iconName, int );
joachim99@8 158
joachim99@80 159 void addPage( KPageWidgetItem* );
joachim99@73 160 QFrame* addPage( const QString& name, const QString& info, int );
joachim99@8 161 int spacingHint();
joachim99@8 162
joachim99@80 163 enum FaceType { List };
joachim99@80 164 void setFaceType(FaceType){}
joachim99@80 165 void setButtons(int){}
joachim99@80 166 void setDefaultButton(int){}
joachim99@80 167 void showButtonSeparator(bool){}
joachim99@80 168 private slots:
joachim99@80 169 void slotHelpClicked();
joachim99@8 170 signals:
joachim99@8 171 void applyClicked();
joachim99@80 172 void okClicked();
joachim99@80 173 void helpClicked();
joachim99@80 174 void defaultClicked();
joachim99@8 175 };
joachim99@8 176
joachim99@75 177 class KFileDialog //: public QFileDialog
joachim99@8 178 {
joachim99@8 179 public:
joachim99@80 180 static KUrl getSaveUrl( const QString &startDir=QString::null,
joachim99@8 181 const QString &filter=QString::null,
joachim99@8 182 QWidget *parent=0, const QString &caption=QString::null);
joachim99@80 183 static KUrl getOpenUrl( const QString & startDir = QString::null,
joachim99@8 184 const QString & filter = QString::null,
joachim99@8 185 QWidget * parent = 0,
joachim99@8 186 const QString & caption = QString::null );
joachim99@80 187 static KUrl getExistingDirectoryUrl( const QString & startDir = QString::null,
joachim99@8 188 QWidget * parent = 0,
joachim99@8 189 const QString & caption = QString::null );
joachim99@69 190 static QString getSaveFileName (const QString &startDir=QString::null,
joachim99@69 191 const QString &filter=QString::null,
joachim99@69 192 QWidget *parent=0,
joachim99@69 193 const QString &caption=QString::null);
joachim99@8 194 };
joachim99@8 195
joachim99@8 196 typedef QStatusBar KStatusBar;
joachim99@8 197
joachim99@75 198 class KToolBar : public QToolBar
joachim99@8 199 {
joachim99@8 200 public:
joachim99@75 201 KToolBar(QMainWindow* parent);
joachim99@8 202
joachim99@66 203 enum BarPosition {Top, Bottom, Left, Right};
joachim99@8 204 BarPosition barPos();
joachim99@8 205 void setBarPos(BarPosition);
joachim99@66 206 private:
joachim99@75 207 QMainWindow* m_pMainWindow;
joachim99@8 208 };
joachim99@8 209
joachim99@8 210 class KActionCollection
joachim99@8 211 {
joachim99@8 212 public:
joachim99@8 213 KMainWindow* m_pMainWindow;
joachim99@8 214 KActionCollection( KMainWindow* p){ m_pMainWindow=p; }
joachim99@80 215 void addAction(const QString& name, QAction* );
joachim99@80 216 KAction* addAction(const QString& name );
joachim99@8 217 };
joachim99@8 218
joachim99@80 219 typedef QKeySequence KShortcut;
joachim99@80 220
joachim99@80 221 class KShortcutsEditor
joachim99@8 222 {
joachim99@8 223 public:
joachim99@80 224 enum { LetterShortcutsAllowed };
joachim99@80 225 };
joachim99@80 226
joachim99@80 227 class KShortcutsDialog
joachim99@80 228 {
joachim99@80 229 public:
joachim99@80 230 static void configure(KActionCollection*){}
joachim99@8 231 static void configureKeys(KActionCollection*, const QString&){}
joachim99@80 232 static void configure(KActionCollection*, int, QWidget*){}
joachim99@8 233 };
joachim99@8 234
joachim99@8 235 namespace KParts
joachim99@8 236 {
joachim99@8 237 class ReadWritePart;
joachim99@8 238 }
joachim99@8 239
joachim99@75 240 class KMainWindow : public QMainWindow
joachim99@8 241 {
joachim99@8 242 Q_OBJECT
joachim99@8 243 private:
joachim99@8 244 KActionCollection m_actionCollection;
joachim99@8 245 protected:
joachim99@8 246 virtual bool queryClose() = 0;
joachim99@8 247 virtual bool queryExit() = 0;
joachim99@8 248 public:
joachim99@75 249 QMenu* fileMenu;
joachim99@75 250 QMenu* editMenu;
joachim99@75 251 QMenu* directoryMenu;
joachim99@75 252 QMenu* dirCurrentItemMenu;
joachim99@75 253 QMenu* dirCurrentSyncItemMenu;
joachim99@75 254 QMenu* movementMenu;
joachim99@75 255 QMenu* mergeMenu;
joachim99@75 256 QMenu* diffMenu;
joachim99@75 257 QMenu* windowsMenu;
joachim99@75 258 QMenu* settingsMenu;
joachim99@75 259 QMenu* helpMenu;
joachim99@8 260
joachim99@8 261 KToolBar* m_pToolBar;
joachim99@8 262
joachim99@80 263 KMainWindow( QWidget* parent );
joachim99@8 264 KToolBar* toolBar(const QString& s = QString::null);
joachim99@8 265 KActionCollection* actionCollection();
joachim99@8 266 void createGUI();
joachim99@8 267 void createGUI(KParts::ReadWritePart*){createGUI();}
joachim99@8 268
joachim99@70 269 QList<KMainWindow*>* memberList;
joachim99@8 270 public slots:
joachim99@80 271 void appHelpActivated();
joachim99@8 272 void slotAbout();
joachim99@8 273 };
joachim99@8 274
joachim99@80 275 class KConfigGroupData : public ValueMap, public QSharedData
joachim99@8 276 {
joachim99@80 277 public:
joachim99@8 278 QString m_fileName;
joachim99@80 279 ~KConfigGroupData();
joachim99@80 280 };
joachim99@80 281
joachim99@80 282 class KConfigGroup
joachim99@80 283 {
joachim99@80 284 private:
joachim99@80 285 QExplicitlySharedDataPointer<KConfigGroupData> d;
joachim99@8 286 public:
joachim99@80 287 KConfigGroup(const KConfigGroup*, const QString& ){}
joachim99@80 288 KConfigGroup();
joachim99@80 289 ~KConfigGroup();
joachim99@69 290 void readConfigFile(const QString& configFileName);
joachim99@8 291
joachim99@8 292 void setGroup(const QString&);
joachim99@80 293 KConfigGroup& group( const QString& groupName );
joachim99@80 294
joachim99@80 295 template <class T> void writeEntry(const QString& s, const T& v){ d->writeEntry(s,v); }
joachim99@80 296 void writeEntry(const QString& s, const QStringList& v, char separator ){ d->writeEntry(s,v,separator); }
joachim99@80 297 void writeEntry(const QString& s, const char* v){ d->writeEntry(s,v); }
joachim99@80 298
joachim99@80 299 template <class T> T readEntry (const QString& s, const T& defaultVal ){ return d->readEntry(s,defaultVal); }
joachim99@80 300 QString readEntry (const QString& s, const char* defaultVal ){ return d->readEntry(s,defaultVal); }
joachim99@80 301 QStringList readEntry (const QString& s, const QStringList& defaultVal, char separator='|' ){ return d->readEntry(s,defaultVal,separator); }
joachim99@8 302 };
joachim99@8 303
joachim99@80 304 typedef KConfigGroup* KSharedConfigPtr;
joachim99@80 305
joachim99@8 306 class KAction : public QAction
joachim99@8 307 {
joachim99@53 308 Q_OBJECT
joachim99@8 309 public:
joachim99@80 310 KAction( KActionCollection* actionCollection );
joachim99@80 311 KAction(const QString& text, KActionCollection* actionCollection );
joachim99@70 312 KAction(const QString& text, const QIcon& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true);
joachim99@68 313 KAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bToggle=false, bool bMenu=true);
joachim99@8 314 void setStatusText(const QString&);
joachim99@75 315 void plug(QMenu*);
joachim99@80 316 void setIcon( const QIcon& icon );
joachim99@8 317 };
joachim99@8 318
joachim99@8 319 class KToggleAction : public KAction
joachim99@8 320 {
joachim99@8 321 public:
joachim99@80 322 KToggleAction(KActionCollection* actionCollection);
joachim99@70 323 KToggleAction(const QString& text, const QIcon& icon, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true);
joachim99@68 324 KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu=true);
joachim99@70 325 KToggleAction(const QString& text, const QIcon& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu=true);
joachim99@8 326 void setChecked(bool);
joachim99@8 327 };
joachim99@8 328
joachim99@8 329
joachim99@80 330 class KStandardAction
joachim99@8 331 {
joachim99@8 332 public:
joachim99@8 333 static KAction* open( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 334 static KAction* save( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 335 static KAction* saveAs( QWidget* parent, const char* slot, KActionCollection* );
joachim99@69 336 static KAction* print( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 337 static KAction* quit( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 338 static KAction* cut( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 339 static KAction* copy( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 340 static KAction* paste( QWidget* parent, const char* slot, KActionCollection* );
joachim99@69 341 static KAction* selectAll( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 342 static KToggleAction* showToolbar( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 343 static KToggleAction* showStatusbar( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 344 static KAction* preferences( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 345 static KAction* about( QWidget* parent, const char* slot, KActionCollection* );
joachim99@69 346 static KAction* aboutQt( KActionCollection* );
joachim99@8 347 static KAction* help( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 348 static KAction* find( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 349 static KAction* findNext( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 350 static KAction* keyBindings( QWidget* parent, const char* slot, KActionCollection* );
joachim99@8 351 };
joachim99@8 352
joachim99@8 353 class KIcon
joachim99@8 354 {
joachim99@8 355 public:
joachim99@8 356 enum {SizeMedium,Small};
joachim99@80 357 KIcon( const QString& ) {}
joachim99@8 358 };
joachim99@8 359
joachim99@8 360 class KFontChooser : public QWidget
joachim99@8 361 {
joachim99@8 362 Q_OBJECT
joachim99@8 363 QFont m_font;
joachim99@8 364 QPushButton* m_pSelectFont;
joachim99@8 365 QLabel* m_pLabel;
joachim99@8 366 QWidget* m_pParent;
joachim99@8 367 public:
joachim99@80 368 KFontChooser( QWidget* pParent );
joachim99@8 369 QFont font();
joachim99@8 370 void setFont( const QFont&, bool );
joachim99@8 371 private slots:
joachim99@8 372 void slotSelectFont();
joachim99@8 373 };
joachim99@8 374
joachim99@8 375 class KColorButton : public QPushButton
joachim99@8 376 {
joachim99@8 377 Q_OBJECT
joachim99@8 378 QColor m_color;
joachim99@8 379 public:
joachim99@8 380 KColorButton(QWidget* parent);
joachim99@8 381 QColor color();
joachim99@8 382 void setColor(const QColor&);
joachim99@8 383 virtual void paintEvent(QPaintEvent* e);
joachim99@8 384 public slots:
joachim99@8 385 void slotClicked();
joachim99@8 386 };
joachim99@8 387
joachim99@69 388 class KPrinter : public QPrinter
joachim99@69 389 {
joachim99@69 390 public:
joachim99@69 391 KPrinter();
joachim99@69 392 enum e_PageSelection {ApplicationSide};
joachim99@75 393 QList<int> pageList();
joachim99@69 394 void setCurrentPage(int);
joachim99@69 395 void setPageSelection(e_PageSelection);
joachim99@69 396 };
joachim99@69 397
joachim99@69 398 class KStandardDirs
joachim99@69 399 {
joachim99@69 400 public:
joachim99@69 401 QString findResource(const QString& resource, const QString& appName);
joachim99@69 402 };
joachim99@69 403
joachim99@80 404 class KCmdLineOptions
joachim99@8 405 {
joachim99@80 406 public:
joachim99@80 407 KCmdLineOptions& add( const QString& name, const QString& description = 0 );
joachim99@8 408 };
joachim99@8 409
joachim99@69 410 #define KCmdLineLastOption {0,0,0}
joachim99@8 411
joachim99@8 412 class KAboutData
joachim99@8 413 {
joachim99@8 414 public:
joachim99@80 415 enum LicenseKey { License_GPL, License_GPL_V2, License_Unknown };
joachim99@80 416
joachim99@80 417 //KAboutData( const QString& name, const QString& appName, const QString& version,
joachim99@80 418 // const QString& description, int licence,
joachim99@80 419 // const QString& copyright, int w, const QString& homepage, const QString& email);
joachim99@80 420
joachim99@80 421 KAboutData (const QByteArray &appName, const QByteArray &catalogName, const KLocalizedString &programName,
joachim99@80 422 const QByteArray &version, const KLocalizedString &shortDescription, LicenseKey licenseType,
joachim99@80 423 const KLocalizedString &copyrightStatement, const KLocalizedString &text,
joachim99@80 424 const QByteArray &homePageAddress, const QByteArray &bugsEmailAddress);
joachim99@80 425 KAboutData( const QString& name, const QString& appName, const QString& appName2, const QString& version );
joachim99@80 426 void addAuthor(const QString& name, const QString& task=0, const QString& email=0, const QString& weblink=0);
joachim99@80 427 void addCredit(const QString& name, const QString& task=0, const QString& email=0, const QString& weblink=0);
joachim99@66 428
joachim99@66 429 struct AboutDataEntry
joachim99@66 430 {
joachim99@66 431 AboutDataEntry(const QString& name, const QString& task, const QString& email, const QString& weblink)
joachim99@66 432 : m_name(name), m_task(task), m_email(email), m_weblink(weblink)
joachim99@66 433 {}
joachim99@66 434 QString m_name;
joachim99@66 435 QString m_task;
joachim99@66 436 QString m_email;
joachim99@66 437 QString m_weblink;
joachim99@66 438 };
joachim99@66 439
joachim99@66 440 std::list<AboutDataEntry> m_authorList;
joachim99@66 441 std::list<AboutDataEntry> m_creditList;
joachim99@8 442 };
joachim99@8 443
joachim99@75 444 typedef QList<QString> QCStringList;
joachim99@8 445
joachim99@8 446 class KCmdLineArgs
joachim99@8 447 {
joachim99@8 448 public:
joachim99@8 449 static KCmdLineArgs* parsedArgs();
joachim99@8 450 static void init( int argc, char**argv, KAboutData* );
joachim99@80 451 static void addCmdLineOptions( const KCmdLineOptions& options ); // Add our own options.
joachim99@8 452
joachim99@8 453 int count();
joachim99@8 454 QString arg(int);
joachim99@80 455 KUrl url(int i){ return KUrl(arg(i)); }
joachim99@8 456 void clear();
joachim99@8 457 QString getOption(const QString&);
joachim99@80 458 QStringList getOptionList( const QString& );
joachim99@8 459 bool isSet(const QString&);
joachim99@8 460 };
joachim99@8 461
joachim99@8 462 class KIconLoader
joachim99@8 463 {
joachim99@8 464 public:
joachim99@80 465 enum { Small, NoGroup };
joachim99@80 466 QPixmap loadIcon(const QString& name, int, int =0);
joachim99@80 467 static KIconLoader* global() { return 0; }
joachim99@8 468 };
joachim99@8 469
joachim99@8 470 class KApplication : public QApplication
joachim99@8 471 {
joachim99@80 472 KConfigGroup m_config;
joachim99@8 473 KIconLoader m_iconLoader;
joachim99@8 474 public:
joachim99@8 475 KApplication();
joachim99@8 476 static KApplication* kApplication();
joachim99@8 477 KIconLoader* iconLoader();
joachim99@80 478 KConfigGroup* config();
joachim99@8 479 bool isRestored();
joachim99@8 480 };
joachim99@8 481
joachim99@8 482 extern KApplication* kapp;
joachim99@8 483
joachim99@8 484 class KLibFactory : public QObject
joachim99@8 485 {
joachim99@8 486 Q_OBJECT
joachim99@8 487 public:
joachim99@8 488 QObject* create(QObject*,const QString&,const QString&);
joachim99@8 489 };
joachim99@8 490
joachim99@8 491 class KLibLoader
joachim99@8 492 {
joachim99@8 493 public:
joachim99@8 494 static KLibLoader* self();
joachim99@8 495 KLibFactory* factory(const QString&);
joachim99@8 496 };
joachim99@8 497
joachim99@80 498 class KEditToolBar : public QDialog
joachim99@8 499 {
joachim99@8 500 public:
joachim99@80 501 KEditToolBar( int ){}
joachim99@8 502 };
joachim99@8 503
joachim99@8 504 class KGlobal
joachim99@8 505 {
joachim99@8 506 public:
joachim99@80 507 static KConfigGroup* config() { return 0; }
joachim99@80 508 };
joachim99@80 509
joachim99@80 510 class KJobUiDelegate
joachim99@80 511 {
joachim99@80 512 public:
joachim99@80 513 void showErrorMessage() {}
joachim99@80 514 };
joachim99@80 515
joachim99@80 516 class KJob : public QObject
joachim99@80 517 {
joachim99@80 518 public:
joachim99@80 519 bool error() {return false;}
joachim99@80 520 enum KillVerbosity { Quietly };
joachim99@80 521 bool kill( KillVerbosity ){return false;}
joachim99@80 522 KJobUiDelegate* uiDelegate() {return 0;}
joachim99@8 523 };
joachim99@8 524
joachim99@8 525 namespace KIO
joachim99@8 526 {
joachim99@80 527 enum { Overwrite, DefaultFlags, Resume, HideProgressInfo, NoReload };
joachim99@8 528 enum UDSEntry {};
joachim99@75 529 typedef QList<UDSEntry> UDSEntryList;
joachim99@80 530 class Job : public KJob
joachim99@80 531 {
joachim99@8 532 };
joachim99@80 533 class SimpleJob : public KJob {};
joachim99@80 534 SimpleJob* mkdir( KUrl );
joachim99@80 535 SimpleJob* rmdir( KUrl );
joachim99@80 536 SimpleJob* file_delete( KUrl, int );
joachim99@80 537 class FileCopyJob : public KJob {};
joachim99@80 538 FileCopyJob* file_move( KUrl, KUrl, int, int );
joachim99@80 539 FileCopyJob* file_copy( KUrl, KUrl, int, int );
joachim99@80 540 class CopyJob : public KJob {};
joachim99@80 541 CopyJob* link( KUrl, KUrl, bool );
joachim99@80 542 class ListJob : public KJob {};
joachim99@80 543 ListJob* listRecursive( KUrl, bool, bool );
joachim99@80 544 ListJob* listDir( KUrl, bool, bool );
joachim99@80 545 class StatJob : public KJob {
joachim99@80 546 public:
joachim99@80 547 enum {SourceSide,DestinationSide};
joachim99@80 548 UDSEntry statResult(){ return (UDSEntry)0; }
joachim99@8 549 };
joachim99@80 550 StatJob* stat( KUrl, bool, int, int );
joachim99@80 551 class TransferJob : public KJob {};
joachim99@80 552 TransferJob* get( KUrl, int );
joachim99@80 553 TransferJob* put( KUrl, int, int );
joachim99@8 554 };
joachim99@8 555
joachim99@75 556 typedef QProgressBar KProgress;
joachim99@8 557
joachim99@8 558 class KInstance : public QObject
joachim99@8 559 {
joachim99@8 560 public:
joachim99@8 561 KInstance(KAboutData*){}
joachim99@8 562 };
joachim99@8 563
joachim99@80 564 class KComponentData : public QObject
joachim99@80 565 {
joachim99@80 566 public:
joachim99@80 567 KComponentData(KAboutData*){}
joachim99@80 568 KConfigGroup* config() {return 0;}
joachim99@80 569 };
joachim99@80 570
joachim99@8 571 namespace KParts
joachim99@8 572 {
joachim99@8 573 class MainWindow : public KMainWindow
joachim99@8 574 {
joachim99@8 575 public:
joachim99@80 576 MainWindow( QWidget* parent=0 ) : KMainWindow(parent) {}
joachim99@8 577 void setXMLFile(const QString&){}
joachim99@8 578 void setAutoSaveSettings(){}
joachim99@80 579 void saveMainWindowSettings(KConfigGroup&){}
joachim99@80 580 void applyMainWindowSettings(KConfigGroup&){}
joachim99@8 581 int factory(){return 0;}
joachim99@8 582 };
joachim99@8 583
joachim99@8 584 class Part : public QObject
joachim99@8 585 {
joachim99@8 586 public:
joachim99@8 587 KActionCollection* actionCollection();
joachim99@8 588 KApplication* instance();
joachim99@8 589 void setWidget( QWidget* w ){ m_pWidget=w; }
joachim99@8 590 QWidget* widget(){return m_pWidget;}
joachim99@8 591 void setXMLFile(const QString&){}
joachim99@8 592 private:
joachim99@8 593 QWidget* m_pWidget;
joachim99@8 594 };
joachim99@8 595
joachim99@8 596 class ReadOnlyPart : public Part
joachim99@8 597 {
joachim99@8 598 public:
joachim99@8 599 ReadOnlyPart(){}
joachim99@75 600 ReadOnlyPart(QObject*,const QString&){}
joachim99@80 601 QString localFilePath() {return QString(); }
joachim99@80 602 void setComponentData(const KComponentData&){} // actually member of PartBase
joachim99@80 603 KComponentData& componentData() { return *(KComponentData*)0;}
joachim99@8 604 QString m_file;
joachim99@8 605 };
joachim99@8 606
joachim99@8 607 class ReadWritePart : public ReadOnlyPart
joachim99@8 608 {
joachim99@8 609 public:
joachim99@80 610 ReadWritePart(QObject*){}
joachim99@8 611 void setReadWrite(bool){}
joachim99@8 612 };
joachim99@8 613
joachim99@8 614 class Factory : public KLibFactory
joachim99@8 615 {
joachim99@8 616 Q_OBJECT
joachim99@8 617 public:
joachim99@80 618 virtual KParts::Part* createPartObject( QWidget* /*parentWidget*/, const char * /*widgetName*/,
joachim99@80 619 QObject* /*parent*/, const char * /*name*/,
joachim99@80 620 const char* /*classname*/, const QStringList& /*args*/ ){return 0;}
joachim99@8 621 };
joachim99@8 622 };
joachim99@8 623 #endif
joachim99@8 624
joachim99@8 625