bump product version to 4.1.6.2
[LibreOffice.git] / svx / inc / galobj.hxx
blob09e038267002218f45a658d323c97806f86c32d4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _SVX_GALOBJ_HXX_
21 #define _SVX_GALOBJ_HXX_
23 #include <tools/urlobj.hxx>
24 #include <vcl/graph.hxx>
25 #include "svx/galmisc.hxx"
27 #define S_THUMB 80
30 #define SGA_FORMAT_NONE 0x00000000L
31 #define SGA_FORMAT_STRING 0x00000001L
32 #define SGA_FORMAT_GRAPHIC 0x00000010L
33 #define SGA_FORMAT_SOUND 0x00000100L
34 #define SGA_FORMAT_OLE 0x00001000L
35 #define SGA_FORMAT_SVDRAW 0x00010000L
36 #define SGA_FORMAT_ALL 0xFFFFFFFFL
38 enum GalSoundType
40 SOUND_STANDARD = 0,
41 SOUND_COMPUTER = 1,
42 SOUND_MISC = 2,
43 SOUND_MUSIC = 3,
44 SOUND_NATURE = 4,
45 SOUND_SPEECH = 5,
46 SOUND_TECHNIC = 6,
47 SOUND_ANIMAL = 7
50 class SVX_DLLPUBLIC SgaObject
52 friend class GalleryTheme;
54 private:
56 void ImplUpdateURL( const INetURLObject& rNewURL ) { aURL = rNewURL; }
58 protected:
60 BitmapEx aThumbBmp; // Allow transparence to survive
61 GDIMetaFile aThumbMtf;
62 INetURLObject aURL;
63 String aUserName;
64 String aTitle;
65 sal_Bool bIsValid;
66 sal_Bool bIsThumbBmp;
68 virtual void WriteData( SvStream& rOut, const String& rDestDir ) const;
69 virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion );
71 sal_Bool CreateThumb( const Graphic& rGraphic );
73 public:
75 SgaObject();
76 virtual ~SgaObject() {};
78 virtual SgaObjKind GetObjKind() const = 0;
79 virtual sal_uInt16 GetVersion() const = 0;
81 virtual BitmapEx GetThumbBmp() const { return aThumbBmp; }
82 const GDIMetaFile& GetThumbMtf() const { return aThumbMtf; }
83 const INetURLObject& GetURL() const { return aURL; }
84 sal_Bool IsValid() const { return bIsValid; }
85 sal_Bool IsThumbBitmap() const { return bIsThumbBmp; }
87 const String GetTitle() const;
88 void SetTitle( const String& rTitle );
90 friend SvStream& operator<<( SvStream& rOut, const SgaObject& rObj );
91 friend SvStream& operator>>( SvStream& rIn, SgaObject& rObj );
94 class SgaObjectSound : public SgaObject
96 private:
98 GalSoundType eSoundType;
100 virtual void WriteData( SvStream& rOut, const String& rDestDir ) const;
101 virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion );
103 virtual sal_uInt16 GetVersion() const { return 6; }
105 public:
107 SgaObjectSound();
108 SgaObjectSound( const INetURLObject& rURL );
109 virtual ~SgaObjectSound();
111 virtual SgaObjKind GetObjKind() const { return SGA_OBJ_SOUND; }
112 virtual BitmapEx GetThumbBmp() const;
113 GalSoundType GetSoundType() const { return eSoundType; }
116 class FmFormModel;
118 class SgaObjectSvDraw : public SgaObject
120 using SgaObject::CreateThumb;
122 private:
124 sal_Bool CreateThumb( const FmFormModel& rModel );
126 virtual void WriteData( SvStream& rOut, const String& rDestDir ) const;
127 virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion );
129 virtual sal_uInt16 GetVersion() const { return 5; }
131 public:
133 SgaObjectSvDraw();
134 SgaObjectSvDraw( const FmFormModel& rModel, const INetURLObject& rURL );
135 SgaObjectSvDraw( SvStream& rIStm, const INetURLObject& rURL );
136 virtual ~SgaObjectSvDraw() {};
138 virtual SgaObjKind GetObjKind() const { return SGA_OBJ_SVDRAW; }
141 class SgaObjectBmp: public SgaObject
143 private:
145 void Init( const Graphic& rGraphic, const INetURLObject& rURL );
147 virtual void WriteData( SvStream& rOut, const String& rDestDir ) const;
148 virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion );
150 virtual sal_uInt16 GetVersion() const { return 5; }
152 public:
154 SgaObjectBmp();
155 SgaObjectBmp( const INetURLObject& rURL );
156 SgaObjectBmp( const Graphic& rGraphic, const INetURLObject& rURL, const String& rFormat );
157 virtual ~SgaObjectBmp() {};
159 virtual SgaObjKind GetObjKind() const { return SGA_OBJ_BMP; }
162 class SgaObjectAnim : public SgaObjectBmp
164 private:
166 SgaObjectAnim( const INetURLObject& ) {};
168 public:
170 SgaObjectAnim();
171 SgaObjectAnim( const Graphic& rGraphic, const INetURLObject& rURL, const String& rFormatName );
173 virtual ~SgaObjectAnim() {};
175 virtual SgaObjKind GetObjKind() const { return SGA_OBJ_ANIM; }
178 class SgaObjectINet : public SgaObjectAnim
180 private:
182 SgaObjectINet( const INetURLObject& ) {};
184 public:
186 SgaObjectINet();
187 SgaObjectINet( const Graphic& rGraphic, const INetURLObject& rURL, const String& rFormatName );
189 virtual ~SgaObjectINet() {};
191 virtual SgaObjKind GetObjKind() const { return SGA_OBJ_INET; }
193 #endif
195 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */