xref: /aoo42x/main/sc/source/ui/inc/warnbox.hxx (revision 38d50f7b)
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 #ifndef SC_WARNBOX_HXX
25 #define SC_WARNBOX_HXX
26 
27 #include <vcl/msgbox.hxx>
28 
29 
30 // ============================================================================
31 
32 /** Message box with warning image and "Do not show again" checkbox. */
33 class ScCbWarningBox : public WarningBox
34 {
35 public:
36     /** @param rMsgStr  Resource ID for the message text.
37         @param bDefYes  true = "Yes" focused, false = "No" focused. */
38                                 ScCbWarningBox( Window* pParent, const String& rMsgStr, bool bDefYes = true );
39 
40     /** Opens dialog if IsDialogEnabled() returns true.
41         @descr  If after executing the dialog the checkbox "Do not show again" is set,
42                 the method DisableDialog() will be called. */
43     virtual sal_Int16           Execute();
44 
45     /** Called before executing the dialog. If this method returns false, the dialog will not be opened. */
46     virtual bool                IsDialogEnabled();
47     /** Called, when dialog is exited and the option "Do not show again" is set. */
48     virtual void                DisableDialog();
49 };
50 
51 
52 // ----------------------------------------------------------------------------
53 
54 /** Warning box for "Replace cell contents?". */
55 class ScReplaceWarnBox : public ScCbWarningBox
56 {
57 public:
58                                 ScReplaceWarnBox( Window* pParent );
59 
60     /** Reads the configuration key "ReplaceCellsWarning". */
61     virtual bool                IsDialogEnabled();
62     /** Sets the configuration key "ReplaceCellsWarning" to false. */
63     virtual void                DisableDialog();
64 };
65 
66 
67 // ============================================================================
68 
69 #endif
70 
71