annotate kdiff3/src-QT4/kreplacements/kreplacements.h @ 113:7bca1f1340f6 tip

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