Salome HOME
New item (FontItem), allowing to show information about font setting and to select...
[modules/gui.git] / src / GLViewer / GLViewer_MimeSource.h
1 // File:      GLViewer_MimeSource.h
2 // Created:   November, 2004
3 // Author:    OCC team
4 // Copyright (C) CEA 2004
5
6 #ifndef GLVIEWER_MIMESOURCE_H
7 #define GLVIEWER_MIMESOURCE_H
8
9 #ifdef WNT
10 #include <windows.h>
11 #endif
12
13 #include "GLViewer.h"
14
15 #include <qmime.h>
16 #include <qvaluelist.h>
17
18 #ifdef WNT
19 #pragma warning( disable:4251 )
20 #endif
21
22 class GLViewer_Object;
23
24 /*! Class GLViewer_MimeSource
25 * Needs for a work with QClipboard
26 */
27
28 class GLVIEWER_API GLViewer_MimeSource: public QMimeSource
29 {
30 public:
31   GLViewer_MimeSource():QMimeSource(){};
32   ~GLViewer_MimeSource();
33   
34   //! Translate objects to byte array
35   bool                                setObjects( QValueList<GLViewer_Object*> );
36   //! Gets objects from byte array
37   /*If you want to use new class, following two method must be redefined*/
38   static QValueList<GLViewer_Object*> getObjects( QByteArray, QString theType);
39   //! Get object from byte array
40   /*If you want to use new class, following two method must be redefined*/
41   static GLViewer_Object*             getObject( QByteArray, QString theType);
42   
43   // Redefined methods
44   virtual const char*                 format( int theIndex = 0 ) const;
45   virtual QByteArray                  encodedData( const char* ) const;
46   
47 private:
48   QByteArray                          myByteArray;
49 };
50
51 #ifdef WNT
52 #pragma warning ( default:4251 )
53 #endif
54
55 #endif