xref: /trunk/main/unotools/inc/unotools/saveopt.hxx (revision ee366e9e8b4eb60255c9136b2b9fe875b1e11938)
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 #ifndef INCLUDED_unotools_SAVEOPT_HXX
24 #define INCLUDED_unotools_SAVEOPT_HXX
25 
26 #include "unotools/unotoolsdllapi.h"
27 #include <unotools/options.hxx>
28 
29 struct SvtLoadSaveOptions_Impl;
30 class UNOTOOLS_DLLPUBLIC SvtSaveOptions: public utl::detail::Options
31 {
32     SvtLoadSaveOptions_Impl*    pImp;
33 
34 public:
35 
36     enum EOption
37     {
38         E_AUTOSAVETIME,
39         E_USEUSERDATA,
40         E_BACKUP,
41         E_AUTOSAVE,
42         E_AUTOSAVEPROMPT,
43         E_DOCINFSAVE,
44         E_SAVEWORKINGSET,
45         E_SAVEDOCVIEW,
46         E_SAVERELINET,
47         E_SAVERELFSYS,
48         E_SAVEUNPACKED,
49         E_DOPRETTYPRINTING,
50         E_WARNALIENFORMAT,
51         E_LOADDOCPRINTER,
52         E_ODFDEFAULTVERSION,
53         E_USESHA1INODF12,
54         E_USEBLOWFISHINODF12
55     };
56 
57     // keep enum values sorted that a less or greater compare maps to older and newer versions!
58     enum ODFDefaultVersion
59     {
60         ODFVER_UNKNOWN = 0, // unknown
61         ODFVER_010 = 1,         // ODF 1.0
62         ODFVER_011 = 2,         // ODF 1.1
63         DO_NOT_USE = 3,         // Do not use this, only here for compatibility with pre OOo 3.2 configuration
64         ODFVER_012 = 4,         // ODF 1.2
65         ODFVER_012_EXT = 5,     // ODF 1.2 with extensions
66         ODFVER_013 = 6,         // ODF 1.3
67         ODFVER_013_EXT = 7,     // ODF 1.3 with extensions
68         ODFVER_014 = 8,         // ODF 1.4
69         ODFVER_014_EXT = 9,     // ODF 1.4 with extensions
70 
71         ODFVER_EXTENSION = SAL_MAX_ENUM,   // only in property map tables: export in the extended modes only
72         ODFVER_EXTENSION_PRE_013 = SAL_MAX_ENUM - 1,   // only in property map tables: export in the extended modes below ODF 1.3
73     };
74 
75     // Test the mode with these, not with a compare against a version: the extended modes sort above the strict ones.
76     static sal_Bool         IsODFExtended( ODFDefaultVersion eVersion );
77     static sal_Bool         IsODFStrict( ODFDefaultVersion eVersion );
78 
79     SvtSaveOptions();
80     virtual ~SvtSaveOptions();
81 
82     void                    SetAutoSaveTime( sal_Int32 n );
83     sal_Int32               GetAutoSaveTime() const;
84 
85     void                    SetUseUserData( sal_Bool b );
86     sal_Bool                IsUseUserData() const;
87 
88     void                    SetBackup( sal_Bool b );
89     sal_Bool                IsBackup() const;
90 
91     void                    SetAutoSave( sal_Bool b );
92     sal_Bool                IsAutoSave() const;
93 
94     void                    SetAutoSavePrompt( sal_Bool b );
95     sal_Bool                IsAutoSavePrompt() const;
96 
97     void                    SetDocInfoSave(sal_Bool b);
98     sal_Bool                IsDocInfoSave() const;
99 
100     void                    SetSaveWorkingSet( sal_Bool b );
101     sal_Bool                IsSaveWorkingSet() const;
102 
103     void                    SetSaveDocView( sal_Bool b );
104     sal_Bool                IsSaveDocView() const;
105 
106     void                    SetSaveRelINet( sal_Bool b );
107     sal_Bool                IsSaveRelINet() const;
108 
109     void                    SetSaveRelFSys( sal_Bool b );
110     sal_Bool                IsSaveRelFSys() const;
111 
112     void                    SetSaveUnpacked( sal_Bool b );
113     sal_Bool                IsSaveUnpacked() const;
114 
115     void                    SetLoadUserSettings(sal_Bool b);
116     sal_Bool                IsLoadUserSettings() const;
117 
118     void                    SetPrettyPrinting( sal_Bool _bEnable );
119     sal_Bool                IsPrettyPrinting( ) const;
120 
121     void                    SetWarnAlienFormat( sal_Bool _bEnable );
122     sal_Bool                IsWarnAlienFormat( ) const;
123 
124     void                    SetLoadDocumentPrinter( sal_Bool _bEnable );
125     sal_Bool                IsLoadDocumentPrinter( ) const;
126 
127     void                    SetODFDefaultVersion( ODFDefaultVersion eVersion );
128     ODFDefaultVersion       GetODFDefaultVersion() const;
129 
130     void                    SetUseSHA1InODF12( sal_Bool bUse );
131     sal_Bool                IsUseSHA1InODF12() const;
132 
133     void                    SetUseBlowfishInODF12( sal_Bool bUse );
134     sal_Bool                IsUseBlowfishInODF12() const;
135 
136     sal_Bool                IsReadOnly( EOption eOption ) const;
137 };
138 
139 #endif
140