xref: /trunk/main/unotools/inc/unotools/saveopt.hxx (revision d666495c4f609ab94ddded8b0141831070b22d11)
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 
69         ODFVER_EXTENSION = SAL_MAX_ENUM,   // only in property map tables: export in the extended modes only
70         ODFVER_EXTENSION_PRE_013 = SAL_MAX_ENUM - 1,   // only in property map tables: export in the extended modes below ODF 1.3
71     };
72 
73     // Test the mode with these, not with a compare against a version: the extended modes sort above the strict ones.
74     static sal_Bool         IsODFExtended( ODFDefaultVersion eVersion );
75     static sal_Bool         IsODFStrict( ODFDefaultVersion eVersion );
76 
77     SvtSaveOptions();
78     virtual ~SvtSaveOptions();
79 
80     void                    SetAutoSaveTime( sal_Int32 n );
81     sal_Int32               GetAutoSaveTime() const;
82 
83     void                    SetUseUserData( sal_Bool b );
84     sal_Bool                IsUseUserData() const;
85 
86     void                    SetBackup( sal_Bool b );
87     sal_Bool                IsBackup() const;
88 
89     void                    SetAutoSave( sal_Bool b );
90     sal_Bool                IsAutoSave() const;
91 
92     void                    SetAutoSavePrompt( sal_Bool b );
93     sal_Bool                IsAutoSavePrompt() const;
94 
95     void                    SetDocInfoSave(sal_Bool b);
96     sal_Bool                IsDocInfoSave() const;
97 
98     void                    SetSaveWorkingSet( sal_Bool b );
99     sal_Bool                IsSaveWorkingSet() const;
100 
101     void                    SetSaveDocView( sal_Bool b );
102     sal_Bool                IsSaveDocView() const;
103 
104     void                    SetSaveRelINet( sal_Bool b );
105     sal_Bool                IsSaveRelINet() const;
106 
107     void                    SetSaveRelFSys( sal_Bool b );
108     sal_Bool                IsSaveRelFSys() const;
109 
110     void                    SetSaveUnpacked( sal_Bool b );
111     sal_Bool                IsSaveUnpacked() const;
112 
113     void                    SetLoadUserSettings(sal_Bool b);
114     sal_Bool                IsLoadUserSettings() const;
115 
116     void                    SetPrettyPrinting( sal_Bool _bEnable );
117     sal_Bool                IsPrettyPrinting( ) const;
118 
119     void                    SetWarnAlienFormat( sal_Bool _bEnable );
120     sal_Bool                IsWarnAlienFormat( ) const;
121 
122     void                    SetLoadDocumentPrinter( sal_Bool _bEnable );
123     sal_Bool                IsLoadDocumentPrinter( ) const;
124 
125     void                    SetODFDefaultVersion( ODFDefaultVersion eVersion );
126     ODFDefaultVersion       GetODFDefaultVersion() const;
127 
128     void                    SetUseSHA1InODF12( sal_Bool bUse );
129     sal_Bool                IsUseSHA1InODF12() const;
130 
131     void                    SetUseBlowfishInODF12( sal_Bool bUse );
132     sal_Bool                IsUseBlowfishInODF12() const;
133 
134     sal_Bool                IsReadOnly( EOption eOption ) const;
135 };
136 
137 #endif
138