joachim99@69: /*************************************************************************** joachim99@77: * Copyright (C) 2003-2007 Joachim Eibl * joachim99@69: * * joachim99@69: * This program is free software; you can redistribute it and/or modify * joachim99@69: * it under the terms of the GNU General Public License as published by * joachim99@69: * the Free Software Foundation; either version 2 of the License, or * joachim99@69: * (at your option) any later version. * joachim99@69: * * joachim99@69: * This program is distributed in the hope that it will be useful, * joachim99@69: * but WITHOUT ANY WARRANTY; without even the implied warranty of * joachim99@69: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * joachim99@69: * GNU General Public License for more details. * joachim99@69: * * joachim99@69: * You should have received a copy of the GNU General Public License * joachim99@69: * along with this program; if not, write to the * joachim99@69: * Free Software Foundation, Inc., * joachim99@69: * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * joachim99@69: ***************************************************************************/ 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 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@69: * @author Joachim Eibl joachim99@8: */ joachim99@80: class KDiff3Part : public KParts::ReadWritePart 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@80: QObject *parent ); 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@80: class KComponentData; 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@80: virtual KParts::Part* createPartObject( QWidget *parentWidget, joachim99@80: QObject *parent, joachim99@80: const char *classname, joachim99@80: const QStringList &args ); joachim99@80: static KComponentData* instance(); joachim99@8: joachim99@8: private: joachim99@80: static KComponentData* s_instance; joachim99@8: static KAboutData* s_about; joachim99@8: }; joachim99@8: joachim99@8: #endif // _KDIFF3PART_H_