kivio

kiviodragobject.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Peter Simonsson <psn@linux.se>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KIVIODRAGOBJECT_H
00021 #define KIVIODRAGOBJECT_H
00022 
00023 #include <qdragobject.h>
00024 #include <qptrlist.h>
00025 
00026 #include "kivio_stencil.h"
00027 #include <KoRect.h>
00028 
00029 class KivioPage;
00030 
00031 class KivioDragObject : public QDragObject
00032 {
00033   Q_OBJECT
00034   public:
00035     KivioDragObject(QWidget* dragSource = 0, const char* name = 0);
00036 
00037     const char* format(int i) const;
00038     QByteArray encodedData(const char* mimetype) const;
00039     bool canDecode(QMimeSource*);
00040     bool decode(QMimeSource* e, QPtrList<KivioStencil>& sl, KivioPage* page);
00041     void setStencilList(QPtrList<KivioStencil> l);
00042     void setStencilRect(KoRect r);
00043 
00044   protected:
00045     QByteArray kivioEncoded() const;
00046     QByteArray imageEncoded(const char* mimetype) const;
00047 
00048   private:
00049     enum { NumEncodeFormats = 2 };
00050     QCString m_encodeMimeList[NumEncodeFormats];
00051     QPtrList<KivioStencil> m_stencilList;
00052     KoRect m_stencilRect;
00053 };
00054 
00055 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys