summaryrefslogtreecommitdiff
path: root/src/lib/SDWHeader.h
blob: f3e2df417a2dd456858562122a8b7605a1d81e08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* Version: MPL 2.0 / LGPLv2.1+
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Alternatively, the contents of this file may be used under the terms
 * of the GNU Lesser General Public License Version 2.1 or later
 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
 * applicable instead of those above.
 */

#ifndef SDWHEADER_H
#define SDWHEADER_H

#include <librevenge/librevenge.h>
#include <librevenge-stream/librevenge-stream.h>
#include "libsdw_internal.h"

namespace libsdw
{

class SDWEncryption;

class SDWHeader
{
    // disable copying
    SDWHeader(const SDWHeader &);
    SDWHeader &operator=(const SDWHeader &);

public:
	SDWHeader(librevenge::RVNGInputStream *input, const char *password);
	virtual ~SDWHeader();
	
	bool isValid()
	{
		return m_validHeader;
	}
	
	bool needsPassword()
	{
		return m_needsPassword;
	}

	SDWEncryption *getEncryption() const
	{
		return m_encryption;
	}

private:
	bool m_needsPassword;
	bool m_validHeader;
	SDWEncryption *m_encryption;

	bool loadHeader(librevenge::RVNGInputStream *input, const char *password);
};

} // namespace libsdw

#endif /* SDWHEADER_H */
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */