Coverage Report

Created: 2026-11-06 11:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/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
    JXL                    = START + 66,
44
    Math                   = START + 68,
45
    MathTemplate           = START + 69,
46
    File                   = START + 74,
47
    PCD                    = START + 76,
48
    PCT                    = START + 77,
49
    PCX                    = START + 78,
50
    SIM                    = START + 79,
51
    TextFile               = START + 80,
52
    TIFF                   = START + 82,
53
    WMF                    = START + 84,
54
    Writer                 = START + 86,
55
    WriterTemplate         = START + 87,
56
    FixedDevice            = START + 88,
57
    RemoveableDevice       = START + 89,
58
    CDRomDevice            = START + 90,
59
    NetworkDevice          = START + 91,
60
    Table                  = START + 112,
61
    Folder                 = START + 113,
62
    DXF                    = START + 141,
63
    MET                    = START + 142,
64
    PNG                    = START + 143,
65
    //retired SGF          = START + 144,
66
    //retired SGV          = START + 145,
67
    SVM                    = START + 146,
68
    GlobalDoc              = START + 150,
69
    Draw                   = START + 151,
70
    DrawTemplate           = START + 152,
71
    OO_DatabaseDoc         = START + 169,
72
    OO_DrawDoc             = START + 170,
73
    OO_MathDoc             = START + 171,
74
    OO_GlobalDoc           = START + 172,
75
    OO_ImpressDoc          = START + 173,
76
    OO_CalcDoc             = START + 174,
77
    OO_WriterDoc           = START + 175,
78
    OO_DrawTemplate        = START + 176,
79
    OO_ImpressTemplate     = START + 177,
80
    OO_CalcTemplate        = START + 178,
81
    OO_WriterTemplate      = START + 179,
82
    Extension              = START + 180,
83
};
84
85
86
class Image;
87
class INetURLObject;
88
89
namespace svtools {
90
91
struct VolumeInfo
92
{
93
    bool    m_bIsVolume;
94
    bool    m_bIsRemote;
95
    bool    m_bIsRemoveable;
96
    bool    m_bIsFloppy;
97
    bool    m_bIsCompactDisc;
98
99
    VolumeInfo() :
100
0
        m_bIsVolume     ( false ),
101
0
        m_bIsRemote     ( false ),
102
0
        m_bIsRemoveable ( false ),
103
0
        m_bIsFloppy     ( false ),
104
0
        m_bIsCompactDisc( false ) {}
105
106
    VolumeInfo( bool _bIsVolume,
107
                bool _bIsRemote,
108
                bool _bIsRemoveable,
109
                bool _bIsFloppy,
110
                bool _bIsCompactDisc ) :
111
        m_bIsVolume     ( _bIsVolume ),
112
        m_bIsRemote     ( _bIsRemote ),
113
        m_bIsRemoveable ( _bIsRemoveable ),
114
        m_bIsFloppy     ( _bIsFloppy ),
115
0
        m_bIsCompactDisc( _bIsCompactDisc ) {}
116
};
117
118
}
119
120
class SvFileInformationManager
121
{
122
private:
123
    static OUString    GetDescription_Impl( const INetURLObject& rObject, bool bDetectFolder );
124
125
public:
126
    SVT_DLLPUBLIC static const OUString & GetImageId( const INetURLObject& rURL, bool bBig = false );
127
    SVT_DLLPUBLIC static Image  GetImage(
128
        const INetURLObject& rURL, bool bBig = false,
129
        css::uno::Reference<css::ucb::XCommandEnvironment> const & env
130
            = utl::UCBContentHelper::getDefaultCommandEnvironment());
131
    SVT_DLLPUBLIC static const OUString & GetFileImageId( const INetURLObject& rURL );
132
    SVT_DLLPUBLIC static Image  GetImageNoDefault(const INetURLObject& rURL, vcl::ImageType eImageType = vcl::ImageType::Small);
133
    SVT_DLLPUBLIC static const OUString & GetFolderImageId( const svtools::VolumeInfo& rInfo );
134
135
    SVT_DLLPUBLIC static OUString GetDescription( const INetURLObject& rObject );
136
    SVT_DLLPUBLIC static OUString GetFileDescription( const INetURLObject& rObject );
137
    SVT_DLLPUBLIC static OUString GetFolderDescription( const svtools::VolumeInfo& rInfo );
138
};
139
140
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */