1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
23 #include <tools/solar.h>
24 #include <tools/string.hxx>
25 #include <tools/urlobj.hxx>
27 #include "svx/svxdllapi.h"
29 #define SGA_FORMAT_NONE 0x00000000L
30 #define SGA_FORMAT_STRING 0x00000001L
31 #define SGA_FORMAT_GRAPHIC 0x00000010L
32 #define SGA_FORMAT_SOUND 0x00000100L
33 #define SGA_FORMAT_OLE 0x00001000L
34 #define SGA_FORMAT_SVDRAW 0x00010000L
35 #define SGA_FORMAT_ALL 0xFFFFFFFFL
37 #define SVX_GALLERY() (GalleryExplorer::GetGallery())
39 // Defines for preinstalled themes
40 // Has to be in sync with svx/inc/galtheme.hrc
41 #define GALLERY_THEME_3D 1
42 #define GALLERY_THEME_BULLETS 3
43 #define GALLERY_THEME_HOMEPAGE 10
44 #define GALLERY_THEME_HTMLBUTTONS 15
45 #define GALLERY_THEME_POWERPOINT 16
46 #define GALLERY_THEME_SOUNDS 18
47 #define GALLERY_THEME_USERSOUNDS 21
49 #define GALLERY_THEME_FONTWORK 37
50 #define GALLERY_THEME_FONTWORK_VERTICAL 38
61 class SVX_DLLPUBLIC GalleryExplorer
65 SVX_DLLPRIVATE
static Gallery
* ImplGetGallery();
69 static GalleryExplorer
* GetGallery();
73 INetURLObject
GetURL() const;
74 String
GetFilterName() const;
75 Graphic
GetGraphic() const;
76 sal_Bool
IsLinkage() const;
78 static bool FillThemeList( std::vector
<String
>& rThemeList
);
80 // FillObjList is filling rObjList with Strings of the internal Gallery Object URL
81 static sal_Bool
FillObjList( const String
& rThemeName
, std::vector
<String
> &rObjList
);
82 static sal_Bool
FillObjList( const sal_uInt32 nThemeId
, std::vector
<String
> &rObjList
);
83 static bool FillObjList( const sal_uInt32 nThemeId
, std::vector
<OUString
> &rObjList
);
85 // FillObjTitleList is filling the rList with the title for each gallery object
86 static sal_Bool
FillObjListTitle( const sal_uInt32 nThemeId
, std::vector
< OUString
>& rList
);
88 static sal_Bool
InsertURL( const String
& rThemeName
, const String
& rURL
);
89 static sal_Bool
InsertURL( sal_uIntPtr nThemeId
, const String
& rURL
);
91 static sal_Bool
InsertURL( const String
& rThemeName
, const String
& rURL
,
92 const sal_uIntPtr nSgaFormat
/* = SGA_FORMAT_ALL */ );
93 static sal_Bool
InsertURL( sal_uIntPtr nThemeId
, const String
& rURL
,
94 const sal_uIntPtr nSgaFormat
/* = SGA_FORMAT_ALL */ );
96 static sal_Bool
GetGraphicObj( const String
& rThemeName
, sal_uIntPtr nPos
,
97 Graphic
* pGraphic
= NULL
, BitmapEx
* pThumb
= NULL
,
98 sal_Bool bProgess
= sal_False
);
99 static sal_Bool
GetGraphicObj( sal_uIntPtr nThemeId
, sal_uIntPtr nPos
,
100 Graphic
* pGraphic
= NULL
, BitmapEx
* pThumb
= NULL
,
101 sal_Bool bProgess
= sal_False
);
103 static sal_uIntPtr
GetSdrObjCount( const String
& rThemeName
);
104 static sal_uIntPtr
GetSdrObjCount( sal_uIntPtr nThemeId
);
106 static sal_Bool
GetSdrObj( const String
& rThemeName
, sal_uIntPtr nSdrModelPos
,
107 SdrModel
* pModel
= NULL
, BitmapEx
* pThumb
= NULL
);
108 static sal_Bool
GetSdrObj( sal_uIntPtr nThemeId
, sal_uIntPtr nSdrModelPos
,
109 SdrModel
* pModel
= NULL
, BitmapEx
* pThumb
= NULL
);
111 static sal_Bool
BeginLocking( const String
& rThemeName
);
112 static sal_Bool
BeginLocking( sal_uIntPtr nThemeId
);
114 static sal_Bool
EndLocking( const String
& rThemeName
);
115 static sal_Bool
EndLocking( sal_uIntPtr nThemeId
);
118 #endif // _GALLERY_HXX_
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */