2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2004-02-03 16:25:18 +00:00
|
|
|
|
2013-10-28 03:41:20 +01:00
|
|
|
#ifndef INCLUDED_SVX_INC_GALOBJ_HXX
|
|
|
|
#define INCLUDED_SVX_INC_GALOBJ_HXX
|
2004-02-03 16:25:18 +00:00
|
|
|
|
|
|
|
#include <tools/urlobj.hxx>
|
|
|
|
#include <vcl/graph.hxx>
|
2009-11-04 12:06:36 +01:00
|
|
|
#include "svx/galmisc.hxx"
|
2004-02-03 16:25:18 +00:00
|
|
|
|
|
|
|
#define S_THUMB 80
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum GalSoundType
|
|
|
|
{
|
|
|
|
SOUND_STANDARD = 0,
|
|
|
|
SOUND_COMPUTER = 1,
|
|
|
|
SOUND_MISC = 2,
|
|
|
|
SOUND_MUSIC = 3,
|
|
|
|
SOUND_NATURE = 4,
|
|
|
|
SOUND_SPEECH = 5,
|
|
|
|
SOUND_TECHNIC = 6,
|
|
|
|
SOUND_ANIMAL = 7
|
|
|
|
};
|
|
|
|
|
2009-10-01 10:29:37 +00:00
|
|
|
class SVX_DLLPUBLIC SgaObject
|
2004-02-03 16:25:18 +00:00
|
|
|
{
|
|
|
|
friend class GalleryTheme;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void ImplUpdateURL( const INetURLObject& rNewURL ) { aURL = rNewURL; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2012-12-07 17:15:12 +00:00
|
|
|
BitmapEx aThumbBmp; // Allow transparence to survive
|
2004-02-03 16:25:18 +00:00
|
|
|
GDIMetaFile aThumbMtf;
|
|
|
|
INetURLObject aURL;
|
2013-09-04 11:25:23 +02:00
|
|
|
OUString aUserName;
|
|
|
|
OUString aTitle;
|
2014-04-14 16:15:22 +02:00
|
|
|
bool bIsValid;
|
|
|
|
bool bIsThumbBmp;
|
2004-02-03 16:25:18 +00:00
|
|
|
|
2013-09-04 11:25:23 +02:00
|
|
|
virtual void WriteData( SvStream& rOut, const OUString& rDestDir ) const;
|
2011-01-10 16:11:35 +01:00
|
|
|
virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion );
|
2004-02-03 16:25:18 +00:00
|
|
|
|
2014-04-14 16:15:22 +02:00
|
|
|
bool CreateThumb( const Graphic& rGraphic );
|
2004-02-03 16:25:18 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
SgaObject();
|
|
|
|
virtual ~SgaObject() {};
|
|
|
|
|
|
|
|
virtual SgaObjKind GetObjKind() const = 0;
|
2013-09-04 11:25:23 +02:00
|
|
|
virtual sal_uInt16 GetVersion() const = 0;
|
2004-02-03 16:25:18 +00:00
|
|
|
|
2012-12-07 17:15:12 +00:00
|
|
|
virtual BitmapEx GetThumbBmp() const { return aThumbBmp; }
|
2004-02-03 16:25:18 +00:00
|
|
|
const GDIMetaFile& GetThumbMtf() const { return aThumbMtf; }
|
|
|
|
const INetURLObject& GetURL() const { return aURL; }
|
2014-04-14 16:15:22 +02:00
|
|
|
bool IsValid() const { return bIsValid; }
|
|
|
|
bool IsThumbBitmap() const { return bIsThumbBmp; }
|
2004-02-03 16:25:18 +00:00
|
|
|
|
2013-09-04 11:25:23 +02:00
|
|
|
const OUString GetTitle() const;
|
|
|
|
void SetTitle( const OUString& rTitle );
|
2004-02-03 16:25:18 +00:00
|
|
|
|
2014-01-14 13:52:54 +02:00
|
|
|
friend SvStream& WriteSgaObject( SvStream& rOut, const SgaObject& rObj );
|
2014-01-30 13:46:42 +02:00
|
|
|
friend SvStream& ReadSgaObject( SvStream& rIn, SgaObject& rObj );
|
2013-05-07 13:53:03 +00:00
|
|
|
|
|
|
|
BitmapEx createPreviewBitmapEx(const Size& rSizePixel) const;
|
2004-02-03 16:25:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SgaObjectSound : public SgaObject
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
GalSoundType eSoundType;
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void WriteData( SvStream& rOut, const OUString& rDestDir ) const SAL_OVERRIDE;
|
|
|
|
virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) SAL_OVERRIDE;
|
2004-02-03 16:25:18 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual sal_uInt16 GetVersion() const SAL_OVERRIDE { return 6; }
|
2004-02-03 16:25:18 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
SgaObjectSound();
|
|
|
|
SgaObjectSound( const INetURLObject& rURL );
|
|
|
|
virtual ~SgaObjectSound();
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual SgaObjKind GetObjKind() const SAL_OVERRIDE { return SGA_OBJ_SOUND; }
|
|
|
|
virtual BitmapEx GetThumbBmp() const SAL_OVERRIDE;
|
2004-02-03 16:25:18 +00:00
|
|
|
GalSoundType GetSoundType() const { return eSoundType; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class FmFormModel;
|
|
|
|
|
|
|
|
class SgaObjectSvDraw : public SgaObject
|
|
|
|
{
|
2006-10-12 10:44:15 +00:00
|
|
|
using SgaObject::CreateThumb;
|
|
|
|
|
2004-02-03 16:25:18 +00:00
|
|
|
private:
|
|
|
|
|
2014-04-14 16:15:22 +02:00
|
|
|
bool CreateThumb( const FmFormModel& rModel );
|
2004-02-03 16:25:18 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void WriteData( SvStream& rOut, const OUString& rDestDir ) const SAL_OVERRIDE;
|
|
|
|
virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) SAL_OVERRIDE;
|
2004-02-03 16:25:18 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual sal_uInt16 GetVersion() const SAL_OVERRIDE { return 5; }
|
2004-02-03 16:25:18 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
SgaObjectSvDraw();
|
|
|
|
SgaObjectSvDraw( const FmFormModel& rModel, const INetURLObject& rURL );
|
|
|
|
SgaObjectSvDraw( SvStream& rIStm, const INetURLObject& rURL );
|
|
|
|
virtual ~SgaObjectSvDraw() {};
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual SgaObjKind GetObjKind() const SAL_OVERRIDE { return SGA_OBJ_SVDRAW; }
|
2004-02-03 16:25:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SgaObjectBmp: public SgaObject
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
void Init( const Graphic& rGraphic, const INetURLObject& rURL );
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void WriteData( SvStream& rOut, const OUString& rDestDir ) const SAL_OVERRIDE;
|
|
|
|
virtual void ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) SAL_OVERRIDE;
|
2004-02-03 16:25:18 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual sal_uInt16 GetVersion() const SAL_OVERRIDE { return 5; }
|
2004-02-03 16:25:18 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
SgaObjectBmp();
|
|
|
|
SgaObjectBmp( const INetURLObject& rURL );
|
2013-09-04 11:25:23 +02:00
|
|
|
SgaObjectBmp( const Graphic& rGraphic, const INetURLObject& rURL, const OUString& rFormat );
|
2004-02-03 16:25:18 +00:00
|
|
|
virtual ~SgaObjectBmp() {};
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual SgaObjKind GetObjKind() const SAL_OVERRIDE { return SGA_OBJ_BMP; }
|
2004-02-03 16:25:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SgaObjectAnim : public SgaObjectBmp
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2006-06-19 13:37:49 +00:00
|
|
|
SgaObjectAnim( const INetURLObject& ) {};
|
2004-02-03 16:25:18 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
SgaObjectAnim();
|
2013-09-04 11:25:23 +02:00
|
|
|
SgaObjectAnim( const Graphic& rGraphic, const INetURLObject& rURL, const OUString& rFormatName );
|
2004-02-03 16:25:18 +00:00
|
|
|
|
|
|
|
virtual ~SgaObjectAnim() {};
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual SgaObjKind GetObjKind() const SAL_OVERRIDE { return SGA_OBJ_ANIM; }
|
2004-02-03 16:25:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SgaObjectINet : public SgaObjectAnim
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2006-06-19 13:37:49 +00:00
|
|
|
SgaObjectINet( const INetURLObject& ) {};
|
2004-02-03 16:25:18 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
SgaObjectINet();
|
2013-09-04 11:25:23 +02:00
|
|
|
SgaObjectINet( const Graphic& rGraphic, const INetURLObject& rURL, const OUString& rFormatName );
|
2004-02-03 16:25:18 +00:00
|
|
|
|
|
|
|
virtual ~SgaObjectINet() {};
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual SgaObjKind GetObjKind() const SAL_OVERRIDE { return SGA_OBJ_INET; }
|
2004-02-03 16:25:18 +00:00
|
|
|
};
|
|
|
|
#endif
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|