LibreOffice Module svx (master) 1
gallery.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_GALLERY_HXX
21#define INCLUDED_SVX_GALLERY_HXX
22
23#include <svx/svxdllapi.h>
24#include <rtl/ustring.hxx>
25#include <vector>
26
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
40
41#define RID_GALLERY_THEME_START (6000)
42
43// ATTENTION: This list has to be in sync with
44// * share/gallery (theme files are identified by id)
45//
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)
50
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)
65
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)
69
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)
84
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)
91
92#define RID_GALLERY_THEME_FIRST RID_GALLERY_THEME_3D
93#define RID_GALLERY_THEME_LAST RID_GALLERY_THEME_TXTSHAPES
94
95class SdrModel;
96class Graphic;
97class BitmapEx;
98
100{
101public:
102
103 static bool FillThemeList( std::vector<OUString>& rThemeList );
104
105 // FillObjList is filling rObjList with Strings of the internal Gallery Object URL
106 static bool FillObjList( std::u16string_view rThemeName, std::vector<OUString> &rObjList );
107 static bool FillObjList( const sal_uInt32 nThemeId, std::vector<OUString> &rObjList );
108
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 );
111
112 static bool InsertURL( std::u16string_view rThemeName, std::u16string_view rURL );
113 static bool InsertURL( sal_uInt32 nThemeId, std::u16string_view rURL );
114
115 static bool GetGraphicObj( std::u16string_view rThemeName, sal_uInt32 nPos,
116 Graphic* pGraphic );
117 static bool GetGraphicObj( sal_uInt32 nThemeId, sal_uInt32 nPos,
118 Graphic* pGraphic );
119
120 static sal_uInt32 GetSdrObjCount( std::u16string_view rThemeName );
121 static sal_uInt32 GetSdrObjCount( sal_uInt32 nThemeId );
122
123 static bool GetSdrObj( std::u16string_view 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 );
127
128 static bool BeginLocking( std::u16string_view rThemeName );
129 static bool BeginLocking( sal_uInt32 nThemeId );
130
131 static bool EndLocking( std::u16string_view rThemeName );
132 static bool EndLocking( sal_uInt32 nThemeId );
133};
134
135#endif // INCLUDED_SVX_GALLERY_HXX
136
137/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 nPos
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35