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 .
20 #ifndef INCLUDED_SVX_GALLERY_HXX
21 #define INCLUDED_SVX_GALLERY_HXX
23 #include <svx/svxdllapi.h>
24 #include <rtl/ustring.hxx>
27 // Defines for preinstalled themes
28 #define GALLERY_THEME_3D 1
29 #define GALLERY_THEME_BULLETS 3
30 #define GALLERY_THEME_HOMEPAGE 10
31 #define GALLERY_THEME_HTMLBUTTONS 15
32 #define GALLERY_THEME_POWERPOINT 16
33 #define GALLERY_THEME_RULERS 17
34 #define GALLERY_THEME_SOUNDS 18
35 #define GALLERY_THEME_MYTHEME 20
36 #define GALLERY_THEME_USERSOUNDS 21
37 #define GALLERY_THEME_DUMMY5 36
38 #define GALLERY_THEME_FONTWORK 37
39 #define GALLERY_THEME_FONTWORK_VERTICAL 38
41 #define RID_GALLERY_THEME_START (6000)
43 // ATTENTION: This list has to be in sync with
44 // * share/gallery (theme files are identified by id)
46 // Since galleries may be copied from older offices to newer, do *never* change
47 // these IDs except adding new ones (and adapting GALLERY_THEME_LAST). The ID
48 // *is* written into the binary file *.thm (which is a gallery theme combined
49 // of three files, *.thm, *.sdv and *.sdg)
51 #define RID_GALLERY_THEME_3D (RID_GALLERY_THEME_START + 1)
52 #define RID_GALLERY_THEME_ANIMATIONS (RID_GALLERY_THEME_START + 2)
53 #define RID_GALLERY_THEME_BULLETS (RID_GALLERY_THEME_START + 3)
54 #define RID_GALLERY_THEME_OFFICE (RID_GALLERY_THEME_START + 4)
55 #define RID_GALLERY_THEME_FLAGS (RID_GALLERY_THEME_START + 5)
56 #define RID_GALLERY_THEME_FLOWCHARTS (RID_GALLERY_THEME_START + 6)
57 #define RID_GALLERY_THEME_EMOTICONS (RID_GALLERY_THEME_START + 7)
58 #define RID_GALLERY_THEME_PHOTOS (RID_GALLERY_THEME_START + 8)
59 #define RID_GALLERY_THEME_BACKGROUNDS (RID_GALLERY_THEME_START + 9)
60 #define RID_GALLERY_THEME_HOMEPAGE (RID_GALLERY_THEME_START + 10)
61 #define RID_GALLERY_THEME_INTERACTION (RID_GALLERY_THEME_START + 11)
62 #define RID_GALLERY_THEME_MAPS (RID_GALLERY_THEME_START + 12)
63 #define RID_GALLERY_THEME_PEOPLE (RID_GALLERY_THEME_START + 13)
64 #define RID_GALLERY_THEME_SURFACES (RID_GALLERY_THEME_START + 14)
66 #define RID_GALLERY_THEME_SOUNDS (RID_GALLERY_THEME_START + 18)
67 #define RID_GALLERY_THEME_SYMBOLS (RID_GALLERY_THEME_START + 19)
68 #define RID_GALLERY_THEME_MYTHEME (RID_GALLERY_THEME_START + 20)
70 #define RID_GALLERY_THEME_ARROWS (RID_GALLERY_THEME_START + 22)
71 #define RID_GALLERY_THEME_BALLOONS (RID_GALLERY_THEME_START + 23)
72 #define RID_GALLERY_THEME_KEYBOARD (RID_GALLERY_THEME_START + 24)
73 #define RID_GALLERY_THEME_TIME (RID_GALLERY_THEME_START + 25)
74 #define RID_GALLERY_THEME_PRESENTATION (RID_GALLERY_THEME_START + 26)
75 #define RID_GALLERY_THEME_CALENDAR (RID_GALLERY_THEME_START + 27)
76 #define RID_GALLERY_THEME_NAVIGATION (RID_GALLERY_THEME_START + 28)
77 #define RID_GALLERY_THEME_COMMUNICATION (RID_GALLERY_THEME_START + 29)
78 #define RID_GALLERY_THEME_FINANCES (RID_GALLERY_THEME_START + 30)
79 #define RID_GALLERY_THEME_COMPUTER (RID_GALLERY_THEME_START + 31)
80 #define RID_GALLERY_THEME_CLIMA (RID_GALLERY_THEME_START + 32)
81 #define RID_GALLERY_THEME_EDUCATION (RID_GALLERY_THEME_START + 33)
82 #define RID_GALLERY_THEME_TROUBLE (RID_GALLERY_THEME_START + 34)
83 #define RID_GALLERY_THEME_SCREENBEANS (RID_GALLERY_THEME_START + 35)
85 #define RID_GALLERY_THEME_COMPUTERS (RID_GALLERY_THEME_START + 39)
86 #define RID_GALLERY_THEME_DIAGRAMS (RID_GALLERY_THEME_START + 40)
87 #define RID_GALLERY_THEME_ENVIRONMENT (RID_GALLERY_THEME_START + 41)
88 #define RID_GALLERY_THEME_FINANCE (RID_GALLERY_THEME_START + 42)
89 #define RID_GALLERY_THEME_TRANSPORT (RID_GALLERY_THEME_START + 43)
90 #define RID_GALLERY_THEME_TXTSHAPES (RID_GALLERY_THEME_START + 44)
92 #define RID_GALLERY_THEME_FIRST RID_GALLERY_THEME_3D
93 #define RID_GALLERY_THEME_LAST RID_GALLERY_THEME_TXTSHAPES
99 class SVX_DLLPUBLIC GalleryExplorer
103 static bool FillThemeList( std::vector
<OUString
>& rThemeList
);
105 // FillObjList is filling rObjList with Strings of the internal Gallery Object URL
106 static bool FillObjList( const OUString
& rThemeName
, std::vector
<OUString
> &rObjList
);
107 static bool FillObjList( const sal_uInt32 nThemeId
, std::vector
<OUString
> &rObjList
);
109 // FillObjTitleList is filling the rList with the title for each gallery object
110 static bool FillObjListTitle( const sal_uInt32 nThemeId
, std::vector
< OUString
>& rList
);
112 static bool InsertURL( const OUString
& rThemeName
, const OUString
& rURL
);
113 static bool InsertURL( sal_uInt32 nThemeId
, const OUString
& rURL
);
115 static bool GetGraphicObj( const OUString
& rThemeName
, sal_uInt32 nPos
,
117 static bool GetGraphicObj( sal_uInt32 nThemeId
, sal_uInt32 nPos
,
120 static sal_uInt32
GetSdrObjCount( const OUString
& rThemeName
);
121 static sal_uInt32
GetSdrObjCount( sal_uInt32 nThemeId
);
123 static bool GetSdrObj( const OUString
& rThemeName
, sal_uInt32 nSdrModelPos
,
124 SdrModel
* pModel
, BitmapEx
* pThumb
= nullptr );
125 static bool GetSdrObj( sal_uInt32 nThemeId
, sal_uInt32 nSdrModelPos
,
126 SdrModel
* pModel
, BitmapEx
* pThumb
= nullptr );
128 static bool BeginLocking( const OUString
& rThemeName
);
129 static bool BeginLocking( sal_uInt32 nThemeId
);
131 static bool EndLocking( const OUString
& rThemeName
);
132 static bool EndLocking( sal_uInt32 nThemeId
);
135 #endif // INCLUDED_SVX_GALLERY_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */