LibreOffice Module vcl (master)  1
GraphicFormatDetector.hxx
Go to the documentation of this file.
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 #ifndef INCLUDED_VCL_INC_GRAPHICFORMATDETECTOR_HXX
21 #define INCLUDED_VCL_INC_GRAPHICFORMATDETECTOR_HXX
22 
23 #include <tools/stream.hxx>
24 #include <vector>
25 
26 VCL_DLLPUBLIC bool ImpPeekGraphicFormat(SvStream& rStream, OUString& rFormatExtension, bool bTest);
27 
28 namespace vcl
29 {
31 {
32 public:
34  OUString maExtension;
35 
36  std::vector<sal_uInt8> maFirstBytes;
37  sal_uInt32 mnFirstLong;
38  sal_uInt32 mnSecondLong;
39 
40  sal_uInt64 mnStreamPosition;
41  sal_uInt64 mnStreamLength;
42 
43  OUString msDetectedFormat;
44 
45  GraphicFormatDetector(SvStream& rStream, OUString const& rFormatExtension);
46 
47  bool detect();
48 
49  bool checkMET();
50  bool checkBMP();
51  bool checkWMForEMF();
52  bool checkPCX();
53  bool checkTIF();
54  bool checkGIF();
55  bool checkPNG();
56  bool checkJPG();
57  bool checkSVM();
58  bool checkPCD();
59  bool checkPSD();
60  bool checkEPS();
61  bool checkDXF();
62  bool checkPCT();
63  bool checkPBMorPGMorPPM();
64  bool checkRAS();
65  bool checkXPM();
66  bool checkXBM();
67  bool checkSVG();
68  bool checkTGA();
69  bool checkMOV();
70  bool checkPDF();
71 };
72 }
73 
74 #endif // INCLUDED_VCL_INC_GRAPHICFORMATDETECTOR_HXX
75 
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
std::vector< sal_uInt8 > maFirstBytes
VCL_DLLPUBLIC bool ImpPeekGraphicFormat(SvStream &rStream, OUString &rFormatExtension, bool bTest)