// // C++ Interface: pageitempointer // // Description: // // // Author: Pierre Marchand , (C) 2008 // // Copyright: See COPYING file that comes with this distribution // // #ifndef PAGEITEMPOINTER_H #define PAGEITEMPOINTER_H #include #include #include #include #include class PageItem; class PageItemPointerDB : public QObject ,public QMap { Q_OBJECT public: PageItemPointerDB(){} ~PageItemPointerDB(){} void addToDB(const QString& key, PageItem* value ); public slots: void removeFromDB ( QObject* obj ); }; /** * Holds a guarded pointer and offers some kind of serialization. * */ class PageItemPointer : public QPointer { static PageItemPointerDB PIdb; public: PageItemPointer() :QPointer() {} PageItemPointer ( PageItem* pi ); PageItemPointer ( const PageItemPointer& pip ); PageItemPointer ( const QString& objname ); ~PageItemPointer(); }; QDataStream & operator<< ( QDataStream & out , const PageItemPointer& pip ); QDataStream & operator>> ( QDataStream & in , PageItemPointer& pip ); #endif