[pt_PT] Added 11 new words to autocorrect.
[LibreOffice.git] / svx / inc / galobj.hxx
blobba93c31d386f0156f30068df913d51883919f2c2
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 INCLUDED_SVX_INC_GALOBJ_HXX
21 #define INCLUDED_SVX_INC_GALOBJ_HXX
23 #include <tools/urlobj.hxx>
24 #include <vcl/graph.hxx>
25 #include "svx/galmisc.hxx"
27 #define S_THUMB 80
30 enum GalSoundType
32 SOUND_STANDARD = 0,
33 SOUND_COMPUTER = 1,
34 SOUND_MISC = 2,
35 SOUND_MUSIC = 3,
36 SOUND_NATURE = 4,
37 SOUND_SPEECH = 5,
38 SOUND_TECHNIC = 6,
39 SOUND_ANIMAL = 7
42 class SVX_DLLPUBLIC SgaObject
44 friend class GalleryTheme;
46 private:
48 void ImplUpdateURL( const INetURLObject& rNewURL ) { aURL = rNewURL; }
50 protected:
52 BitmapEx aThumbBmp; // Allow transparence to survive
53 GDIMetaFile aThumbMtf;
54 INetURLObject aURL;
55 OUString aTitle;
56 bool bIsValid;
57 bool bIsThumbBmp;
59 virtual void WriteData( SvStream& rOut, const OUString& rDestDir ) const;
60 virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion );
62 bool CreateThumb( const Graphic& rGraphic );
64 public:
65 SgaObject();
66 virtual ~SgaObject() {};
68 virtual SgaObjKind GetObjKind() const = 0;
69 virtual sal_uInt16 GetVersion() const = 0;
71 virtual BitmapEx GetThumbBmp() const { return aThumbBmp; }
72 const GDIMetaFile& GetThumbMtf() const { return aThumbMtf; }
73 const INetURLObject& GetURL() const { return aURL; }
74 bool IsValid() const { return bIsValid; }
75 bool IsThumbBitmap() const { return bIsThumbBmp; }
77 const OUString GetTitle() const;
78 void SetTitle( const OUString& rTitle );
80 friend SvStream& WriteSgaObject( SvStream& rOut, const SgaObject& rObj );
81 friend SvStream& ReadSgaObject( SvStream& rIn, SgaObject& rObj );
83 BitmapEx createPreviewBitmapEx(const Size& rSizePixel) const;
86 class SgaObjectSound : public SgaObject
88 private:
90 GalSoundType eSoundType;
92 virtual void WriteData( SvStream& rOut, const OUString& rDestDir ) const override;
93 virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) override;
95 virtual sal_uInt16 GetVersion() const override { return 6; }
97 public:
99 SgaObjectSound();
100 SgaObjectSound( const INetURLObject& rURL );
101 virtual ~SgaObjectSound() override;
103 virtual SgaObjKind GetObjKind() const override { return SgaObjKind::Sound; }
104 virtual BitmapEx GetThumbBmp() const override;
107 class FmFormModel;
109 class SgaObjectSvDraw : public SgaObject
111 using SgaObject::CreateThumb;
113 private:
115 bool CreateThumb( const FmFormModel& rModel );
117 virtual void WriteData( SvStream& rOut, const OUString& rDestDir ) const override;
118 virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) override;
120 virtual sal_uInt16 GetVersion() const override { return 5; }
122 public:
124 SgaObjectSvDraw();
125 SgaObjectSvDraw( const FmFormModel& rModel, const INetURLObject& rURL );
126 SgaObjectSvDraw( SvStream& rIStm, const INetURLObject& rURL );
128 virtual SgaObjKind GetObjKind() const override { return SgaObjKind::SvDraw; }
131 class SgaObjectBmp: public SgaObject
133 private:
135 void Init( const Graphic& rGraphic, const INetURLObject& rURL );
137 virtual void WriteData( SvStream& rOut, const OUString& rDestDir ) const override;
138 virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) override;
140 virtual sal_uInt16 GetVersion() const override { return 5; }
142 public:
144 SgaObjectBmp();
145 SgaObjectBmp( const INetURLObject& rURL );
146 SgaObjectBmp( const Graphic& rGraphic, const INetURLObject& rURL, const OUString& rFormat );
148 virtual SgaObjKind GetObjKind() const override { return SgaObjKind::Bitmap; }
151 class SgaObjectAnim : public SgaObjectBmp
153 public:
155 SgaObjectAnim();
156 SgaObjectAnim( const Graphic& rGraphic, const INetURLObject& rURL, const OUString& rFormatName );
158 virtual SgaObjKind GetObjKind() const override { return SgaObjKind::Animation; }
161 class SgaObjectINet : public SgaObjectAnim
163 public:
165 SgaObjectINet();
166 SgaObjectINet( const Graphic& rGraphic, const INetURLObject& rURL, const OUString& rFormatName );
168 virtual SgaObjKind GetObjKind() const override { return SgaObjKind::Inet; }
170 #endif
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */