joachim99@8: /* joachim99@8: * Copyright (C) 2003 Joachim Eibl joachim99@8: */ joachim99@8: joachim99@8: #ifndef _KDIFF3PART_H_ joachim99@8: #define _KDIFF3PART_H_ joachim99@8: joachim99@8: #include joachim99@8: #include joachim99@8: joachim99@8: class QWidget; joachim99@8: class QPainter; joachim99@8: class KURL; joachim99@8: class KDiff3App; joachim99@8: joachim99@8: /** joachim99@8: * This is a "Part". It that does all the real work in a KPart joachim99@8: * application. joachim99@8: * joachim99@8: * @short Main Part joachim99@8: * @author Joachim Eibl joachim99@8: */ joachim99@8: class KDiff3Part : public KParts::ReadOnlyPart joachim99@8: { joachim99@8: Q_OBJECT joachim99@8: public: joachim99@8: /** joachim99@8: * Default constructor joachim99@8: */ joachim99@8: KDiff3Part(QWidget *parentWidget, const char *widgetName, joachim99@8: QObject *parent, const char *name); joachim99@8: joachim99@8: /** joachim99@8: * Destructor joachim99@8: */ joachim99@8: virtual ~KDiff3Part(); joachim99@8: joachim99@8: /** joachim99@8: * This is a virtual function inherited from KParts::ReadWritePart. joachim99@8: * A shell will use this to inform this Part if it should act joachim99@8: * read-only joachim99@8: */ joachim99@8: virtual void setReadWrite(bool rw); joachim99@8: joachim99@8: /** joachim99@8: * Reimplemented to disable and enable Save action joachim99@8: */ joachim99@8: virtual void setModified(bool modified); joachim99@8: joachim99@8: protected: joachim99@8: /** joachim99@8: * This must be implemented by each part joachim99@8: */ joachim99@8: virtual bool openFile(); joachim99@8: joachim99@8: /** joachim99@8: * This must be implemented by each read-write part joachim99@8: */ joachim99@8: virtual bool saveFile(); joachim99@8: joachim99@8: private: joachim99@8: KDiff3App* m_widget; joachim99@8: bool m_bIsShell; joachim99@8: }; joachim99@8: joachim99@8: class KInstance; joachim99@8: class KAboutData; joachim99@8: joachim99@8: class KDiff3PartFactory : public KParts::Factory joachim99@8: { joachim99@8: Q_OBJECT joachim99@8: public: joachim99@8: KDiff3PartFactory(); joachim99@8: virtual ~KDiff3PartFactory(); joachim99@8: virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, joachim99@8: QObject *parent, const char *name, joachim99@8: const char *classname, const QStringList &args ); joachim99@8: static KInstance* instance(); joachim99@8: joachim99@8: private: joachim99@8: static KInstance* s_instance; joachim99@8: static KAboutData* s_about; joachim99@8: }; joachim99@8: joachim99@8: #endif // _KDIFF3PART_H_