xref: /aoo42x/main/sw/source/filter/ww8/WW8FFData.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #include <vector>
25 #include <rtl/ustring.hxx>
26 
27 class SvStream;
28 
29 namespace sw
30 {
31 
32 class WW8FFData
33 {
34 private:
35     // offset 0x4
36     sal_uInt8 mnType; // :2 0x3
37     sal_uInt8 mnResult; // :5 0x7c
38     bool mbOwnHelp; // :1 0x80
39 
40     // offset 5
41     bool mbOwnStat; // :1 0x01
42     bool mbProtected; // :1 0x02
43     bool mbSize; // :1 0x04
44     sal_uInt8 mnTextType; // :3 0x38
45     bool mbRecalc; // :1 0x4
46     bool mbListBox; // :1 0x80
47 
48     // offset 6
49     sal_uInt16 mnMaxLen; // :15 0x7fff maximum length of text field, 0 <=> no limit
50 
51     // offset 8
52     sal_uInt16 mnCheckboxHeight;
53 
54     // offset 10 and beyond
55     ::rtl::OUString msName;
56     ::rtl::OUString msDefault; // only for type == 0
57     sal_uInt16 mnDefault; // only for type != 0
58     ::rtl::OUString msFormat;
59     ::rtl::OUString msHelp;
60     ::rtl::OUString msStatus;
61     ::rtl::OUString msMacroEnter;
62     ::rtl::OUString msMacroExit;
63 
64     ::std::vector< ::rtl::OUString > msListEntries;
65 
66 protected:
67     void WriteOUString(SvStream * pStream, const ::rtl::OUString & rStr, bool bAddZero);
68 
69 public:
70     WW8FFData();
71     ~WW8FFData();
72 
setType(sal_uInt8 nType)73     void setType(sal_uInt8 nType) { mnType = nType; }
getType() const74     sal_uInt8 getType() const { return mnType; }
setResult(sal_uInt8 nResult)75     void setResult(sal_uInt8 nResult) { mnResult = nResult; }
getResult() const76     sal_uInt8 getResult() const { return mnResult; }
setProptexted(bool bProtected)77     void setProptexted(bool bProtected) { mbProtected = bProtected; }
getProtected() const78     bool getProtected() const { return mbProtected; }
setSize(bool bSize)79     void setSize(bool bSize) { mbSize = bSize; }
getSize() const80     bool getSize() const { return mbSize; }
setTextType(sal_uInt8 nTextType)81     void setTextType(sal_uInt8 nTextType) { mnTextType = nTextType; }
getTextType() const82     sal_uInt8 getTextType() const { return mnTextType; }
setRecalc(bool bRecalc)83     void setRecalc(bool bRecalc) { mbRecalc = bRecalc; }
getRecalc() const84     bool getRecalc() const { return mbRecalc; }
setListBox(bool bListBox)85     void setListBox(bool bListBox) { mbListBox = bListBox; }
getListBox() const86     bool getListBox() const { return mbListBox; }
setMaxLen(sal_uInt16 nMaxLen)87     void setMaxLen(sal_uInt16 nMaxLen) { mnMaxLen = nMaxLen; }
getMaxLen() const88     sal_uInt16 getMaxLen() const { return mnMaxLen; }
setCheckboxHeight(sal_uInt16 nCheckboxHeight)89     void setCheckboxHeight(sal_uInt16 nCheckboxHeight) { mnCheckboxHeight = nCheckboxHeight; }
getCheckboxHeight() const90     sal_uInt16 getCheckboxHeight() const { return mnCheckboxHeight; }
setName(const::rtl::OUString & rName)91     void setName(const ::rtl::OUString & rName) { msName = rName; }
getName() const92     const ::rtl::OUString & getName() const { return msName; }
setDefaultString(const::rtl::OUString & rDefault)93     void setDefaultString(const ::rtl::OUString & rDefault) { msDefault = rDefault; }
getDefaultString() const94     const ::rtl::OUString & getDefaultString() const { return msDefault; }
setDefaultResult(sal_uInt16 nDefault)95     void setDefaultResult(sal_uInt16 nDefault) { mnDefault = nDefault; }
getDefaultResult() const96     sal_uInt16 getDefaultResult() const { return mnDefault; }
setFormat(const::rtl::OUString & rFormat)97     void setFormat(const ::rtl::OUString & rFormat) { msFormat = rFormat; }
getFormat() const98     const ::rtl::OUString & getFormat() const { return msFormat; }
99     void setHelp(const ::rtl::OUString & rHelp);
getHelp() const100     const ::rtl::OUString getHelp() const { return msHelp; }
101     void setStatus(const ::rtl::OUString & rStatus);
getStatus() const102     const ::rtl::OUString & getStatus() const { return msStatus; }
setMacroEnter(const::rtl::OUString & rMacroEnter)103     void setMacroEnter(const ::rtl::OUString & rMacroEnter) { msMacroEnter = rMacroEnter; }
getMacroEnter() const104     const ::rtl::OUString & getMacroEnter() const { return msMacroEnter; }
setMacroExit(const::rtl::OUString & rMacroExit)105     void setMacroExit(const ::rtl::OUString & rMacroExit) { msMacroExit = rMacroExit; }
getMacroExit() const106     const ::rtl::OUString & getMacroExit() const { return msMacroExit; }
107 
108     void addListboxEntry(const ::rtl::OUString & rEntry);
109 
110     void Write(SvStream * pDataStrm);
111 };
112 }
113