xref: /AOO42X/main/svx/inc/svx/gallery.hxx (revision 9bce9b0d387299c68bd81d539e1478357a103de5)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _GALLERY_HXX_
25 #define _GALLERY_HXX_
26 
27 #include <tools/solar.h>
28 #include <tools/string.hxx>
29 #include <tools/urlobj.hxx>
30 #include <vector>
31 #include "svx/svxdllapi.h"
32 
33 // -----------
34 // - Defines -
35 // -----------
36 
37 // Defines for preinstalled themes
38 #define GALLERY_THEME_3D                1
39 #define GALLERY_THEME_ANIMATIONS    2
40 #define GALLERY_THEME_BULLETS       3
41 #define GALLERY_THEME_OFFICE            4
42 #define GALLERY_THEME_FLAGS             5
43 #define GALLERY_THEME_FLOWCHARTS    6
44 #define GALLERY_THEME_EMOTICONS         7
45 #define GALLERY_THEME_PHOTOS        8
46 #define GALLERY_THEME_BACKGROUNDS   9
47 #define GALLERY_THEME_HOMEPAGE      10
48 #define GALLERY_THEME_INTERACTION   11
49 #define GALLERY_THEME_MAPS              12
50 #define GALLERY_THEME_PEOPLE            13
51 #define GALLERY_THEME_SURFACES      14
52 #define GALLERY_THEME_HTMLBUTTONS   15
53 #define GALLERY_THEME_POWERPOINT    16
54 #define GALLERY_THEME_RULERS        17
55 #define GALLERY_THEME_SOUNDS        18
56 #define GALLERY_THEME_SYMBOLS       19
57 #define GALLERY_THEME_MYTHEME       20
58 #define GALLERY_THEME_USERSOUNDS    21
59 #define GALLERY_THEME_ARROWS            22
60 #define GALLERY_THEME_BALLOONS          23
61 #define GALLERY_THEME_KEYBOARD          24
62 #define GALLERY_THEME_TIME              25
63 #define GALLERY_THEME_PRESENTATION      26
64 #define GALLERY_THEME_CALENDAR          27
65 #define GALLERY_THEME_NAVIGATION        28
66 #define GALLERY_THEME_COMMUNICATION     29
67 #define GALLERY_THEME_FINANCES          30
68 #define GALLERY_THEME_COMPUTER          31
69 #define GALLERY_THEME_CLIMA             32
70 #define GALLERY_THEME_EDUCATION         33
71 #define GALLERY_THEME_TROUBLE           34
72 #define GALLERY_THEME_SCREENBEANS       35
73 #define GALLERY_THEME_FONTWORK          36
74 #define GALLERY_THEME_FONTWORK_VERTICAL 37
75 
76 #define GALLERY_THEME_DUMMY5            38
77 
78 // -------------------
79 // - GalleryExplorer -
80 // -------------------
81 
82 class List;
83 class Gallery;
84 class VCDrawModel;
85 class FmFormModel;
86 class SdrModel;
87 class Graphic;
88 class FmFormModel;
89 class BitmapEx;
90 class OutputDevice;
91 
92 class SVX_DLLPUBLIC GalleryExplorer
93 {
94 public:
95 
96     static sal_Bool                 FillThemeList( List& rThemeList );
97 
98                                 // FillObjList is filling rObjList with Strings of the internal Gallery Object URL
99     static sal_Bool                 FillObjList( const String& rThemeName, List& rObjList );
100     static sal_Bool                 FillObjList( sal_uIntPtr nThemeId, List& rObjList );
101 
102                                 // FillObjTitleList is filling the rList with the title for each gallery object
103     static sal_Bool             FillObjListTitle( const sal_uInt32 nThemeId, std::vector< rtl::OUString >& rList );
104 
105     static sal_Bool                 InsertURL( const String& rThemeName, const String& rURL );
106     static sal_Bool                 InsertURL( sal_uIntPtr nThemeId, const String& rURL );
107 
108     static sal_uIntPtr              GetObjCount( const String& rThemeName );
109     static sal_uIntPtr              GetObjCount( sal_uIntPtr nThemeId );
110 
111     static sal_Bool                 GetGraphicObj( const String& rThemeName, sal_uIntPtr nPos,
112                                                Graphic* pGraphic = NULL, BitmapEx* pThumb = NULL,
113                                                sal_Bool bProgess = sal_False );
114     static sal_Bool                 GetGraphicObj( sal_uIntPtr nThemeId, sal_uIntPtr nPos,
115                                                Graphic* pGraphic = NULL, BitmapEx* pThumb = NULL,
116                                                sal_Bool bProgess = sal_False );
117 
118     static sal_Bool                 InsertGraphicObj( const String& rThemeName, const Graphic& rGraphic );
119     static sal_Bool                 InsertGraphicObj( sal_uIntPtr nThemeId, const Graphic& rGraphic );
120 
121     static sal_uIntPtr              GetSdrObjCount( const String& rThemeName );
122     static sal_uIntPtr              GetSdrObjCount( sal_uIntPtr nThemeId );
123 
124     static sal_Bool                 GetSdrObj( const String& rThemeName, sal_uIntPtr nSdrModelPos,
125                                            SdrModel* pModel = NULL, BitmapEx* pThumb = NULL );
126     static sal_Bool                 GetSdrObj( sal_uIntPtr nThemeId, sal_uIntPtr nSdrModelPos,
127                                            SdrModel* pModel = NULL, BitmapEx* pThumb = NULL );
128 
129     static sal_Bool                 InsertSdrObj( const String& rThemeName, FmFormModel& rModel );
130     static sal_Bool                 InsertSdrObj( sal_uIntPtr nThemeId, FmFormModel& rModel );
131 
132     static sal_Bool                 BeginLocking( const String& rThemeName );
133     static sal_Bool                 BeginLocking( sal_uIntPtr nThemeId );
134 
135     static sal_Bool                 EndLocking( const String& rThemeName );
136     static sal_Bool                 EndLocking( sal_uIntPtr nThemeId );
137 };
138 
139 #endif // _GALLERY_HXX_
140