update dev300-m58
[ooovba.git] / sc / source / ui / inc / warnbox.hxx
blob816ee8934c80c65289930f4620ff96aa5c040ef3
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: warnbox.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_WARNBOX_HXX
32 #define SC_WARNBOX_HXX
34 #include <vcl/msgbox.hxx>
37 // ============================================================================
39 /** Message box with warning image and "Do not show again" checkbox. */
40 class ScCbWarningBox : public WarningBox
42 public:
43 /** @param rMsgStr Resource ID for the message text.
44 @param bDefYes true = "Yes" focused, false = "No" focused. */
45 ScCbWarningBox( Window* pParent, const String& rMsgStr, bool bDefYes = true );
47 /** Opens dialog if IsDialogEnabled() returns true.
48 @descr If after executing the dialog the checkbox "Do not show again" is set,
49 the method DisableDialog() will be called. */
50 virtual sal_Int16 Execute();
52 /** Called before executing the dialog. If this method returns false, the dialog will not be opened. */
53 virtual bool IsDialogEnabled();
54 /** Called, when dialog is exited and the option "Do not show again" is set. */
55 virtual void DisableDialog();
59 // ----------------------------------------------------------------------------
61 /** Warning box for "Replace cell contents?". */
62 class ScReplaceWarnBox : public ScCbWarningBox
64 public:
65 ScReplaceWarnBox( Window* pParent );
67 /** Reads the configuration key "ReplaceCellsWarning". */
68 virtual bool IsDialogEnabled();
69 /** Sets the configuration key "ReplaceCellsWarning" to false. */
70 virtual void DisableDialog();
74 // ============================================================================
76 #endif