home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / pageitempointer.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-11-12  |  1.1 KB  |  64 lines

  1. //
  2. // C++ Interface: pageitempointer
  3. //
  4. // Description:
  5. //
  6. //
  7. // Author: Pierre Marchand <pierremarc@oep-h.com>, (C) 2008
  8. //
  9. // Copyright: See COPYING file that comes with this distribution
  10. //
  11. //
  12.  
  13. #ifndef PAGEITEMPOINTER_H
  14. #define PAGEITEMPOINTER_H
  15.  
  16. #include <QDataStream>
  17. #include <QMap>
  18. #include <QObject>
  19. #include <QPointer>
  20. #include <QString>
  21.  
  22.  
  23. class PageItem;
  24.  
  25. class PageItemPointerDB : public QObject ,public QMap<QString, PageItem*> 
  26. {
  27.         Q_OBJECT
  28.     public:
  29.         PageItemPointerDB(){}
  30.         ~PageItemPointerDB(){}
  31.         
  32.         void addToDB(const QString& key, PageItem* value );
  33.                 
  34.     public slots:
  35.         void removeFromDB ( QObject* obj );
  36. };
  37.  
  38. /**
  39.  * Holds a guarded pointer and offers some kind of serialization.
  40.  *
  41.  */
  42.  
  43. class PageItemPointer :  public QPointer<PageItem>
  44. {
  45.     static PageItemPointerDB PIdb;
  46.     public:
  47.         PageItemPointer() :QPointer<PageItem>() {}
  48.         PageItemPointer ( PageItem* pi );
  49.         PageItemPointer ( const PageItemPointer& pip );
  50.         PageItemPointer ( const QString& objname );
  51.         ~PageItemPointer();
  52.  
  53.  
  54. };
  55.  
  56. QDataStream & operator<< ( QDataStream & out , const PageItemPointer& pip );
  57. QDataStream & operator>> ( QDataStream & in  , PageItemPointer& pip );
  58.  
  59.  
  60.  
  61.  
  62. #endif
  63.  
  64.