1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_OOX_OLE_VBAHELPER_HXX
21 #define INCLUDED_OOX_OLE_VBAHELPER_HXX
23 #include <oox/helper/binarystreambase.hxx>
24 #include <rtl/ustring.hxx>
25 #include <sal/types.h>
27 namespace oox
{ class BinaryInputStream
; }
32 // Directory stream record identifiers ========================================
34 const sal_uInt16 VBA_ID_MODULECOOKIE
= 0x002C;
35 const sal_uInt16 VBA_ID_MODULEDOCSTRING
= 0x001C;
36 const sal_uInt16 VBA_ID_MODULEDOCSTRINGUNICODE
= 0x0048;
37 const sal_uInt16 VBA_ID_MODULEEND
= 0x002B;
38 const sal_uInt16 VBA_ID_MODULEHELPCONTEXT
= 0x001E;
39 const sal_uInt16 VBA_ID_MODULENAME
= 0x0019;
40 const sal_uInt16 VBA_ID_MODULENAMEUNICODE
= 0x0047;
41 const sal_uInt16 VBA_ID_MODULEOFFSET
= 0x0031;
42 const sal_uInt16 VBA_ID_MODULEPRIVATE
= 0x0028;
43 const sal_uInt16 VBA_ID_MODULEREADONLY
= 0x0025;
44 const sal_uInt16 VBA_ID_MODULESTREAMNAME
= 0x001A;
45 const sal_uInt16 VBA_ID_MODULESTREAMNAMEUNICODE
= 0x0032;
46 const sal_uInt16 VBA_ID_MODULETYPEDOCUMENT
= 0x0022;
47 const sal_uInt16 VBA_ID_MODULETYPEPROCEDURAL
= 0x0021;
48 const sal_uInt16 VBA_ID_PROJECTCODEPAGE
= 0x0003;
49 const sal_uInt16 VBA_ID_PROJECTEND
= 0x0010;
50 const sal_uInt16 VBA_ID_PROJECTMODULES
= 0x000F;
51 const sal_uInt16 VBA_ID_PROJECTNAME
= 0x0004;
52 const sal_uInt16 VBA_ID_PROJECTVERSION
= 0x0009;
55 /** Static helper functions for the VBA filters. */
58 /** Reads the next record from the VBA directory stream 'dir'.
60 @param rnRecId (out parameter) The record identifier of the new record.
61 @param rRecData (out parameter) The contents of the new record.
62 @param rInStrm The 'dir' stream.
64 @return True = next record successfully read. False on any error, or
69 StreamDataSequence
& rRecData
,
70 BinaryInputStream
& rInStrm
);
72 /** Extracts a key/value pair from a string separated by an equality sign.
74 @param rKey (out parameter) The key before the separator.
75 @param rValue (out parameter) The value following the separator.
76 @param rCodeLine The source key/value pair.
78 @return True = Equality sign separator found, and the returned key and
79 value are not empty. False otherwise.
84 const OUString
& rKeyValue
);
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */