xref: /trunk/main/vcl/inc/vcl/imagerepository.hxx (revision 7168672c)
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 VCL_IMAGEREPOSITORY_HXX
25 #define VCL_IMAGEREPOSITORY_HXX
26 
27 #include <vcl/dllapi.h>
28 #include <rtl/ustring.hxx>
29 
30 class BitmapEx;
31 class Image;
32 
33 namespace vcl
34 {
35 
36     /**
37         provides access to the application's image repository
38         (packed images and brand images)
39      */
40     class VCL_DLLPUBLIC ImageRepository
41     {
42     public:
43         /** loads an image from the application's image repository
44             @param  _rName
45                 the name of the image to load.
46             @param  _out_rImage
47                 will take the image upon successful return.
48             @param  bSearchLanguageDependent
49                 determines whether a language-dependent image is to be searched.
50             @return
51                 whether or not the image could be loaded successfully.
52         */
53         static bool loadImage(
54             const ::rtl::OUString& _rName,
55             BitmapEx& _out_rImage,
56             bool bSearchLanguageDependent
57         );
58 
59         /** load an image from the application's branding directory
60 
61             @param rName
62                 the name of the image to load, without extension
63             @param rImage
64                 will take the image upon successful return.
65             @param bIgnoreHighContrast
66                 if true, high contrast mode is not taken into account when
67                 searching for the image
68             @param  bSearchLanguageDependent
69                 determines whether a language-dependent image is to be searched.
70          */
71         static bool loadBrandingImage(
72             const rtl::OUString &rName,
73             Image &rImage,
74             bool bSearchLanguageDependent = false
75         );
76     };
77 }
78 
79 #endif // VCL_IMAGEREPOSITORY_HXX
80 
81