merge the formfield patch from ooo-build
[ooovba.git] / svx / inc / gallery.hxx
blobc362b8ff920e3d4e26d7c7ad108693aea9871f1a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: gallery.hxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _GALLERY_HXX_
32 #define _GALLERY_HXX_
34 #include <tools/solar.h>
35 #include <tools/string.hxx>
36 #include <tools/urlobj.hxx>
37 #include <vector>
38 #include "svx/svxdllapi.h"
40 // -----------
41 // - Defines -
42 // -----------
44 #define SGA_FORMAT_NONE 0x00000000L
45 #define SGA_FORMAT_STRING 0x00000001L
46 #define SGA_FORMAT_GRAPHIC 0x00000010L
47 #define SGA_FORMAT_SOUND 0x00000100L
48 #define SGA_FORMAT_OLE 0x00001000L
49 #define SGA_FORMAT_SVDRAW 0x00010000L
50 #define SGA_FORMAT_ALL 0xFFFFFFFFL
52 #define SVX_GALLERY() (GalleryExplorer::GetGallery())
54 // Defines for preinstalled themes
55 #define GALLERY_THEME_3D 1
56 #define GALLERY_THEME_ANIMATIONS 2
57 #define GALLERY_THEME_BULLETS 3
58 #define GALLERY_THEME_OFFICE 4
59 #define GALLERY_THEME_FLAGS 5
60 #define GALLERY_THEME_FLOWCHARTS 6
61 #define GALLERY_THEME_EMOTICONS 7
62 #define GALLERY_THEME_PHOTOS 8
63 #define GALLERY_THEME_BACKGROUNDS 9
64 #define GALLERY_THEME_HOMEPAGE 10
65 #define GALLERY_THEME_INTERACTION 11
66 #define GALLERY_THEME_MAPS 12
67 #define GALLERY_THEME_PEOPLE 13
68 #define GALLERY_THEME_SURFACES 14
69 #define GALLERY_THEME_HTMLBUTTONS 15
70 #define GALLERY_THEME_POWERPOINT 16
71 #define GALLERY_THEME_RULERS 17
72 #define GALLERY_THEME_SOUNDS 18
73 #define GALLERY_THEME_SYMBOLS 19
74 #define GALLERY_THEME_MYTHEME 20
75 #define GALLERY_THEME_USERSOUNDS 21
76 #define GALLERY_THEME_ARROWS 22
77 #define GALLERY_THEME_BALLOONS 23
78 #define GALLERY_THEME_KEYBOARD 24
79 #define GALLERY_THEME_TIME 25
80 #define GALLERY_THEME_PRESENTATION 26
81 #define GALLERY_THEME_CALENDAR 27
82 #define GALLERY_THEME_NAVIGATION 28
83 #define GALLERY_THEME_COMMUNICATION 29
84 #define GALLERY_THEME_FINANCES 30
85 #define GALLERY_THEME_COMPUTER 31
86 #define GALLERY_THEME_CLIMA 32
87 #define GALLERY_THEME_EDUCATION 33
88 #define GALLERY_THEME_TROUBLE 34
89 #define GALLERY_THEME_SCREENBEANS 35
90 #define GALLERY_THEME_FONTWORK 36
91 #define GALLERY_THEME_FONTWORK_VERTICAL 37
93 #define GALLERY_THEME_DUMMY5 38
95 // -------------------
96 // - GalleryExplorer -
97 // -------------------
99 class List;
100 class Gallery;
101 class VCDrawModel;
102 class FmFormModel;
103 class SdrModel;
104 class Graphic;
105 class FmFormModel;
106 class Bitmap;
107 class OutputDevice;
109 class SVX_DLLPUBLIC GalleryExplorer
111 private:
113 SVX_DLLPRIVATE static Gallery* ImplGetGallery();
115 public:
117 static GalleryExplorer* GetGallery();
119 public:
121 INetURLObject GetURL() const;
122 String GetFilterName() const;
123 Graphic GetGraphic() const;
124 BOOL GetVCDrawModel( FmFormModel& rModel ) const;
125 BOOL IsLinkage() const;
127 static BOOL FillThemeList( List& rThemeList );
129 // FillObjList is filling rObjList with Strings of the internal Gallery Object URL
130 static BOOL FillObjList( const String& rThemeName, List& rObjList );
131 static BOOL FillObjList( ULONG nThemeId, List& rObjList );
133 // FillObjTitleList is filling the rList with the title for each gallery object
134 static sal_Bool FillObjListTitle( const sal_uInt32 nThemeId, std::vector< rtl::OUString >& rList );
136 static BOOL InsertURL( const String& rThemeName, const String& rURL );
137 static BOOL InsertURL( ULONG nThemeId, const String& rURL );
139 static BOOL InsertURL( const String& rThemeName, const String& rURL,
140 const ULONG nSgaFormat /* = SGA_FORMAT_ALL */ );
141 static BOOL InsertURL( ULONG nThemeId, const String& rURL,
142 const ULONG nSgaFormat /* = SGA_FORMAT_ALL */ );
144 static ULONG GetObjCount( const String& rThemeName );
145 static ULONG GetObjCount( ULONG nThemeId );
147 static BOOL GetGraphicObj( const String& rThemeName, ULONG nPos,
148 Graphic* pGraphic = NULL, Bitmap* pThumb = NULL,
149 BOOL bProgess = FALSE );
150 static BOOL GetGraphicObj( ULONG nThemeId, ULONG nPos,
151 Graphic* pGraphic = NULL, Bitmap* pThumb = NULL,
152 BOOL bProgess = FALSE );
154 static BOOL InsertGraphicObj( const String& rThemeName, const Graphic& rGraphic );
155 static BOOL InsertGraphicObj( ULONG nThemeId, const Graphic& rGraphic );
157 static ULONG GetSdrObjCount( const String& rThemeName );
158 static ULONG GetSdrObjCount( ULONG nThemeId );
160 static BOOL GetSdrObj( const String& rThemeName, ULONG nSdrModelPos,
161 SdrModel* pModel = NULL, Bitmap* pThumb = NULL );
162 static BOOL GetSdrObj( ULONG nThemeId, ULONG nSdrModelPos,
163 SdrModel* pModel = NULL, Bitmap* pThumb = NULL );
165 static BOOL InsertSdrObj( const String& rThemeName, FmFormModel& rModel );
166 static BOOL InsertSdrObj( ULONG nThemeId, FmFormModel& rModel );
168 static BOOL BeginLocking( const String& rThemeName );
169 static BOOL BeginLocking( ULONG nThemeId );
171 static BOOL EndLocking( const String& rThemeName );
172 static BOOL EndLocking( ULONG nThemeId );
174 static BOOL DrawCentered( OutputDevice* pOut, const FmFormModel& rModel );
177 #endif // _GALLERY_HXX_