annotate kdiff3/src-QT4/kreplacements/kreplacements.h @ 80:fcd146072e0c

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