/src/libreoffice/include/svtools/imagemgr.hxx
Line | Count | Source |
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 | | #pragma once |
21 | | |
22 | | #include <rtl/ustring.hxx> |
23 | | #include <svtools/svtdllapi.h> |
24 | | #include <unotools/ucbhelper.hxx> |
25 | | #include <vcl/vclenum.hxx> |
26 | | |
27 | | #include <com/sun/star/uno/Reference.hxx> |
28 | | |
29 | | enum class SvImageId { |
30 | | NONE = 0, |
31 | | START = 3076, // must match to old Id's in SFX! |
32 | | |
33 | | Impress = START + 47, |
34 | | Bitmap = START + 49, |
35 | | Calc = START + 50, |
36 | | CalcTemplate = START + 51, |
37 | | Database = START + 53, |
38 | | ImpressTemplate = START + 54, |
39 | | GIF = START + 61, |
40 | | HTML = START + 63, |
41 | | JPG = START + 64, |
42 | | WEBP = START + 65, |
43 | | Math = START + 68, |
44 | | MathTemplate = START + 69, |
45 | | File = START + 74, |
46 | | PCD = START + 76, |
47 | | PCT = START + 77, |
48 | | PCX = START + 78, |
49 | | SIM = START + 79, |
50 | | TextFile = START + 80, |
51 | | TIFF = START + 82, |
52 | | WMF = START + 84, |
53 | | Writer = START + 86, |
54 | | WriterTemplate = START + 87, |
55 | | FixedDevice = START + 88, |
56 | | RemoveableDevice = START + 89, |
57 | | CDRomDevice = START + 90, |
58 | | NetworkDevice = START + 91, |
59 | | Table = START + 112, |
60 | | Folder = START + 113, |
61 | | DXF = START + 141, |
62 | | MET = START + 142, |
63 | | PNG = START + 143, |
64 | | //retired SGF = START + 144, |
65 | | //retired SGV = START + 145, |
66 | | SVM = START + 146, |
67 | | GlobalDoc = START + 150, |
68 | | Draw = START + 151, |
69 | | DrawTemplate = START + 152, |
70 | | OO_DatabaseDoc = START + 169, |
71 | | OO_DrawDoc = START + 170, |
72 | | OO_MathDoc = START + 171, |
73 | | OO_GlobalDoc = START + 172, |
74 | | OO_ImpressDoc = START + 173, |
75 | | OO_CalcDoc = START + 174, |
76 | | OO_WriterDoc = START + 175, |
77 | | OO_DrawTemplate = START + 176, |
78 | | OO_ImpressTemplate = START + 177, |
79 | | OO_CalcTemplate = START + 178, |
80 | | OO_WriterTemplate = START + 179, |
81 | | Extension = START + 180, |
82 | | }; |
83 | | |
84 | | |
85 | | class Image; |
86 | | class INetURLObject; |
87 | | |
88 | | namespace svtools { |
89 | | |
90 | | struct VolumeInfo |
91 | | { |
92 | | bool m_bIsVolume; |
93 | | bool m_bIsRemote; |
94 | | bool m_bIsRemoveable; |
95 | | bool m_bIsFloppy; |
96 | | bool m_bIsCompactDisc; |
97 | | |
98 | | VolumeInfo() : |
99 | 0 | m_bIsVolume ( false ), |
100 | 0 | m_bIsRemote ( false ), |
101 | 0 | m_bIsRemoveable ( false ), |
102 | 0 | m_bIsFloppy ( false ), |
103 | 0 | m_bIsCompactDisc( false ) {} |
104 | | |
105 | | VolumeInfo( bool _bIsVolume, |
106 | | bool _bIsRemote, |
107 | | bool _bIsRemoveable, |
108 | | bool _bIsFloppy, |
109 | | bool _bIsCompactDisc ) : |
110 | | m_bIsVolume ( _bIsVolume ), |
111 | | m_bIsRemote ( _bIsRemote ), |
112 | | m_bIsRemoveable ( _bIsRemoveable ), |
113 | | m_bIsFloppy ( _bIsFloppy ), |
114 | 0 | m_bIsCompactDisc( _bIsCompactDisc ) {} |
115 | | }; |
116 | | |
117 | | } |
118 | | |
119 | | class SvFileInformationManager |
120 | | { |
121 | | private: |
122 | | static OUString GetDescription_Impl( const INetURLObject& rObject, bool bDetectFolder ); |
123 | | |
124 | | public: |
125 | | SVT_DLLPUBLIC static const OUString & GetImageId( const INetURLObject& rURL, bool bBig = false ); |
126 | | SVT_DLLPUBLIC static Image GetImage( |
127 | | const INetURLObject& rURL, bool bBig = false, |
128 | | css::uno::Reference<css::ucb::XCommandEnvironment> const & env |
129 | | = utl::UCBContentHelper::getDefaultCommandEnvironment()); |
130 | | SVT_DLLPUBLIC static const OUString & GetFileImageId( const INetURLObject& rURL ); |
131 | | SVT_DLLPUBLIC static Image GetImageNoDefault(const INetURLObject& rURL, vcl::ImageType eImageType = vcl::ImageType::Small); |
132 | | SVT_DLLPUBLIC static const OUString & GetFolderImageId( const svtools::VolumeInfo& rInfo ); |
133 | | |
134 | | SVT_DLLPUBLIC static OUString GetDescription( const INetURLObject& rObject ); |
135 | | SVT_DLLPUBLIC static OUString GetFileDescription( const INetURLObject& rObject ); |
136 | | SVT_DLLPUBLIC static OUString GetFolderDescription( const svtools::VolumeInfo& rInfo ); |
137 | | }; |
138 | | |
139 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |