LibreOffice Module svx (master)
1
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
svx
inc
galobj.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
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/.
8
*
9
* This file incorporates work covered by the following license notice:
10
*
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 .
18
*/
19
20
#ifndef INCLUDED_SVX_INC_GALOBJ_HXX
21
#define INCLUDED_SVX_INC_GALOBJ_HXX
22
23
#include <config_options.h>
24
#include <
tools/urlobj.hxx
>
25
#include <
vcl/graph.hxx
>
26
#include <
vcl/gdimtf.hxx
>
27
#include <
svx/galmisc.hxx
>
28
29
#define S_THUMB 80
30
31
32
enum
GalSoundType
33
{
34
SOUND_STANDARD
= 0,
35
SOUND_COMPUTER
= 1,
36
SOUND_MISC
= 2,
37
SOUND_MUSIC
= 3,
38
SOUND_NATURE
= 4,
39
SOUND_SPEECH
= 5,
40
SOUND_TECHNIC
= 6,
41
SOUND_ANIMAL
= 7
42
};
43
44
class
UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SgaObject
45
{
46
friend
class
GalleryTheme
;
47
friend
class
GalleryBinaryEngine
;
48
49
private
:
50
51
void
ImplUpdateURL(
const
INetURLObject
& rNewURL ) {
aURL
= rNewURL; }
52
53
protected
:
54
55
BitmapEx
aThumbBmp;
// Allow transparence to survive
56
GDIMetaFile
aThumbMtf;
57
INetURLObject
aURL
;
58
OUString aTitle;
59
bool
bIsValid;
60
bool
bIsThumbBmp;
61
62
virtual
void
WriteData(
SvStream
& rOut,
const
OUString& rDestDir )
const
;
63
virtual
void
ReadData(
SvStream
& rIn, sal_uInt16& rReadVersion );
64
65
bool
CreateThumb(
const
Graphic
& rGraphic );
66
67
public
:
68
SgaObject();
69
SgaObject(
const
SgaObject& aObject);
70
71
virtual
~SgaObject() {};
72
73
virtual
SgaObjKind
GetObjKind()
const
= 0;
74
virtual
sal_uInt16
GetVersion
()
const
= 0;
75
76
virtual
BitmapEx
GetThumbBmp()
const
{
return
aThumbBmp; }
77
const
GDIMetaFile
& GetThumbMtf()
const
{
return
aThumbMtf; }
78
const
INetURLObject
& GetURL()
const
{
return
aURL; }
79
bool
IsValid()
const
{
return
bIsValid; }
80
bool
IsThumbBitmap()
const
{
return
bIsThumbBmp; }
81
82
OUString
const
&
GetTitle
()
const
;
83
void
SetTitle(
const
OUString& rTitle );
84
85
friend
SvStream
&
WriteSgaObject
(
SvStream
& rOut,
const
SgaObject& rObj );
86
friend
SvStream
&
ReadSgaObject
(
SvStream
& rIn, SgaObject& rObj );
87
88
BitmapEx
createPreviewBitmapEx(
const
Size
& rSizePixel)
const
;
89
};
90
91
class
SgaObjectSound
final :
public
SgaObject
92
{
93
private
:
94
95
GalSoundType
eSoundType
;
96
97
virtual
void
WriteData(
SvStream
& rOut,
const
OUString& rDestDir )
const override
;
98
virtual
void
ReadData(
SvStream
& rIn, sal_uInt16& rReadVersion )
override
;
99
100
virtual
sal_uInt16
GetVersion
()
const override
{
return
6; }
101
102
public
:
103
104
SgaObjectSound
();
105
SgaObjectSound
(
const
INetURLObject
& rURL );
106
virtual
~
SgaObjectSound
()
override
;
107
108
virtual
SgaObjKind
GetObjKind
()
const override
{
return
SgaObjKind::Sound
; }
109
virtual
BitmapEx
GetThumbBmp()
const override
;
110
};
111
112
class
FmFormModel
;
113
114
class
SgaObjectSvDraw
final :
public
SgaObject
115
{
116
using
SgaObject::CreateThumb;
117
118
private
:
119
120
bool
CreateThumb(
const
FmFormModel
& rModel );
121
122
virtual
void
WriteData(
SvStream
& rOut,
const
OUString& rDestDir )
const override
;
123
virtual
void
ReadData(
SvStream
& rIn, sal_uInt16& rReadVersion )
override
;
124
125
virtual
sal_uInt16
GetVersion
()
const override
{
return
5; }
126
127
public
:
128
129
SgaObjectSvDraw
();
130
SgaObjectSvDraw
(
const
FmFormModel
& rModel,
const
INetURLObject
& rURL );
131
SgaObjectSvDraw
(
SvStream
& rIStm,
const
INetURLObject
& rURL );
132
133
virtual
SgaObjKind
GetObjKind
()
const override
{
return
SgaObjKind::SvDraw
; }
134
};
135
136
class
SgaObjectBmp
:
public
SgaObject
137
{
138
private
:
139
140
void
Init
(
const
Graphic
& rGraphic,
const
INetURLObject
& rURL );
141
142
virtual
void
WriteData(
SvStream
& rOut,
const
OUString& rDestDir )
const override
;
143
virtual
void
ReadData(
SvStream
& rIn, sal_uInt16& rReadVersion )
override
;
144
145
virtual
sal_uInt16
GetVersion
()
const override
{
return
5; }
146
147
public
:
148
149
SgaObjectBmp
();
150
SgaObjectBmp
(
const
INetURLObject
& rURL );
151
SgaObjectBmp
(
const
Graphic
& rGraphic,
const
INetURLObject
& rURL );
152
153
virtual
SgaObjKind
GetObjKind
()
const override
{
return
SgaObjKind::Bitmap
; }
154
};
155
156
class
SgaObjectAnim
:
public
SgaObjectBmp
157
{
158
public
:
159
160
SgaObjectAnim
();
161
SgaObjectAnim
(
const
Graphic
& rGraphic,
const
INetURLObject
& rURL );
162
163
virtual
SgaObjKind
GetObjKind
()
const override
{
return
SgaObjKind::Animation
; }
164
};
165
166
class
SgaObjectINet
final :
public
SgaObjectAnim
167
{
168
public
:
169
170
SgaObjectINet
();
171
SgaObjectINet
(
const
Graphic
& rGraphic,
const
INetURLObject
& rURL );
172
173
virtual
SgaObjKind
GetObjKind
()
const override
{
return
SgaObjKind::Inet
; }
174
};
175
#endif
176
177
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SOUND_NATURE
Definition:
galobj.hxx:38
SgaObjectINet
Definition:
galobj.hxx:166
aURL
URL aURL
Init
void Init()
SgaObjKind::SvDraw
graph.hxx
SgaObjectBmp::GetVersion
virtual sal_uInt16 GetVersion() const override
Definition:
galobj.hxx:145
ReadSgaObject
SvStream & ReadSgaObject(SvStream &rIn, SgaObject &rObj)
Definition:
galobj.cxx:238
GalleryBinaryEngine
Definition:
gallerybinaryengine.hxx:48
WriteSgaObject
SvStream & WriteSgaObject(SvStream &rOut, const SgaObject &rObj)
Definition:
galobj.cxx:232
Graphic
SOUND_MUSIC
Definition:
galobj.hxx:37
SgaObjectSound::GetObjKind
virtual SgaObjKind GetObjKind() const override
Definition:
galobj.hxx:108
GDIMetaFile
GetTitle
UNOTOOLS_DLLPUBLIC bool GetTitle(OUString const &url, OUString *title)
SOUND_TECHNIC
Definition:
galobj.hxx:40
SOUND_ANIMAL
Definition:
galobj.hxx:41
GalleryTheme
Definition:
galtheme.hxx:52
FmFormModel
Definition:
fmmodel.hxx:32
BitmapEx
SgaObjectSvDraw::GetVersion
virtual sal_uInt16 GetVersion() const override
Definition:
galobj.hxx:125
Size
SgaObjKind
SgaObjKind
Definition:
galmisc.hxx:56
SgaObjectAnim
Definition:
galobj.hxx:156
SgaObjectBmp
Definition:
galobj.hxx:136
SgaObjKind::Inet
galmisc.hxx
SgaObjectSound::GetVersion
virtual sal_uInt16 GetVersion() const override
Definition:
galobj.hxx:100
SgaObjectSvDraw
Definition:
galobj.hxx:114
urlobj.hxx
SgaObjectSvDraw::GetObjKind
virtual SgaObjKind GetObjKind() const override
Definition:
galobj.hxx:133
INetURLObject
SgaObjKind::Animation
SgaObjectSound::eSoundType
GalSoundType eSoundType
Definition:
galobj.hxx:95
SgaObjectSound
Definition:
galobj.hxx:91
SgaObjectINet::GetObjKind
virtual SgaObjKind GetObjKind() const override
Definition:
galobj.hxx:173
SgaObjKind::Sound
GalSoundType
GalSoundType
Definition:
galobj.hxx:32
SOUND_STANDARD
Definition:
galobj.hxx:34
SOUND_COMPUTER
Definition:
galobj.hxx:35
gdimtf.hxx
SOUND_MISC
Definition:
galobj.hxx:36
legacy::SvxOrientation::GetVersion
sal_uInt16 GetVersion(sal_uInt16)
Definition:
legacyitem.cxx:29
SOUND_SPEECH
Definition:
galobj.hxx:39
SgaObjectBmp::GetObjKind
virtual SgaObjKind GetObjKind() const override
Definition:
galobj.hxx:153
SgaObjectAnim::GetObjKind
virtual SgaObjKind GetObjKind() const override
Definition:
galobj.hxx:163
SgaObjKind::Bitmap
SvStream
Generated on Thu Jan 14 2021 06:08:45 for LibreOffice Module svx (master) by
1.8.10