]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/dataform.h
wxAuiMDI* patches through images to wxAuiNotebook
[wxWidgets.git] / include / wx / motif / dataform.h
CommitLineData
e1ee679c 1///////////////////////////////////////////////////////////////////////////////
925f7740 2// Name: wx/motif/dataform.h
e1ee679c 3// Purpose: declaration of the wxDataFormat class
76db86e7 4// Author: Robert Roebling
e1ee679c
VZ
5// Modified by:
6// Created: 19.10.99 (extracted from motif/dataobj.h)
7// RCS-ID: $Id$
76db86e7 8// Copyright: (c) 1999 Robert Roebling
65571936 9// Licence: wxWindows licence
e1ee679c
VZ
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_MOTIF_DATAFORM_H
13#define _WX_MOTIF_DATAFORM_H
14
94c7b088 15class WXDLLIMPEXP_CORE wxDataFormat
e1ee679c
VZ
16{
17public:
76db86e7
RR
18 // the clipboard formats under Xt are Atoms
19 typedef Atom NativeFormat;
925f7740 20
e1ee679c
VZ
21 wxDataFormat();
22 wxDataFormat( wxDataFormatId type );
23 wxDataFormat( const wxString &id );
24 wxDataFormat( const wxChar *id );
76db86e7 25 wxDataFormat( NativeFormat format );
925f7740 26
76db86e7 27 wxDataFormat& operator=(NativeFormat format)
83df96d6 28 { SetId(format); return *this; }
925f7740 29
76db86e7
RR
30 // comparison (must have both versions)
31 bool operator==(NativeFormat format) const
83df96d6 32 { return m_format == (NativeFormat)format; }
76db86e7 33 bool operator!=(NativeFormat format) const
83df96d6 34 { return m_format != (NativeFormat)format; }
76db86e7 35 bool operator==(wxDataFormatId format) const
83df96d6 36 { return m_type == (wxDataFormatId)format; }
76db86e7 37 bool operator!=(wxDataFormatId format) const
83df96d6 38 { return m_type != (wxDataFormatId)format; }
925f7740 39
76db86e7
RR
40 // explicit and implicit conversions to NativeFormat which is one of
41 // standard data types (implicit conversion is useful for preserving the
42 // compatibility with old code)
43 NativeFormat GetFormatId() const { return m_format; }
44 operator NativeFormat() const { return m_format; }
925f7740 45
76db86e7 46 void SetId( NativeFormat format );
925f7740 47
76db86e7
RR
48 // string ids are used for custom types - this SetId() must be used for
49 // application-specific formats
50 wxString GetId() const;
51 void SetId( const wxChar *id );
925f7740 52
76db86e7
RR
53 // implementation
54 wxDataFormatId GetType() const;
925f7740 55
e1ee679c 56private:
76db86e7
RR
57 wxDataFormatId m_type;
58 NativeFormat m_format;
925f7740 59
76db86e7
RR
60 void PrepareFormats();
61 void SetType( wxDataFormatId type );
e1ee679c
VZ
62};
63
76db86e7 64
e1ee679c 65#endif // _WX_MOTIF_DATAFORM_H