fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / retypepassdlg.hxx
blob8c746c1438f0c9353b73715e586ca6f9b7220a6a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_RETYPEPASSDLG_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_RETYPEPASSDLG_HXX
23 #include <vcl/button.hxx>
24 #include <vcl/dialog.hxx>
25 #include <vcl/edit.hxx>
26 #include <vcl/fixed.hxx>
27 #include <vcl/layout.hxx>
28 #include <vcl/scrbar.hxx>
29 #include <svx/checklbx.hxx>
30 #include <svtools/stdctrl.hxx>
32 #include "tabprotection.hxx"
34 #include <boost/shared_ptr.hpp>
36 namespace vcl { class Window; }
37 class ScDocProtection;
38 class ScTableProtection;
39 class ScDocument;
41 class ScRetypePassDlg : public ModalDialog
43 public:
44 typedef ::boost::shared_ptr<ScDocProtection> DocProtectionPtr;
45 typedef ::boost::shared_ptr<ScTableProtection> TabProtectionPtr;
47 explicit ScRetypePassDlg(vcl::Window* pParent);
48 virtual ~ScRetypePassDlg();
49 virtual void dispose() SAL_OVERRIDE;
51 virtual short Execute() SAL_OVERRIDE;
53 void SetDataFromDocument(const ScDocument& rDoc);
54 void SetDesiredHash(ScPasswordHash eHash);
56 /** Write the new set of password data to the document instance to
57 overwrite the current ones. */
58 void WriteNewDataToDocument(ScDocument& rDoc) const;
60 private:
61 ScRetypePassDlg(); // disabled
63 void Init();
64 void PopulateDialog();
65 void SetDocData();
66 void SetTableData(size_t nRowPos, SCTAB nTab);
68 /** Check the status of all hash values to see if it's okay to enable
69 the OK button. */
70 void CheckHashStatus();
72 void DeleteSheets();
74 private:
75 VclPtr<OKButton> mpBtnOk;
76 VclPtr<FixedText> mpTextDocStatus;
77 VclPtr<PushButton> mpBtnRetypeDoc;
78 VclPtr<VclVBox> mpSheetsBox;
80 std::vector<VclPtr<VclHBox>> maSheets;
82 OUString maTextNotProtected;
83 OUString maTextNotPassProtected;
84 OUString maTextHashBad;
85 OUString maTextHashGood;
86 OUString maTextHashRegen;
88 DECL_LINK( OKHdl, void* );
89 DECL_LINK( RetypeBtnHdl, PushButton* );
91 struct TableItem
93 OUString maName;
94 TabProtectionPtr mpProtect;
96 ::std::vector<TableItem> maTableItems;
98 DocProtectionPtr mpDocItem;
99 size_t mnCurScrollPos;
100 ScPasswordHash meDesiredHash;
103 class ScRetypePassInputDlg : public ModalDialog
105 public:
106 explicit ScRetypePassInputDlg(vcl::Window* pParent, ScPassHashProtectable* pProtected);
107 virtual ~ScRetypePassInputDlg();
108 virtual void dispose() SAL_OVERRIDE;
110 virtual short Execute() SAL_OVERRIDE;
112 bool IsRemovePassword() const;
113 OUString GetNewPassword() const;
115 private:
116 ScRetypePassInputDlg(); // disabled
118 void Init();
119 void CheckPasswordInput();
121 private:
122 VclPtr<OKButton> m_pBtnOk;
124 VclPtr<RadioButton> m_pBtnRetypePassword;
126 VclPtr<VclContainer> m_pPasswordGrid;
127 VclPtr<Edit> m_pPassword1Edit;
128 VclPtr<Edit> m_pPassword2Edit;
130 VclPtr<CheckBox> m_pBtnMatchOldPass;
132 VclPtr<RadioButton> m_pBtnRemovePassword;
134 DECL_LINK( OKHdl, void* );
135 DECL_LINK( RadioBtnHdl, RadioButton* );
136 DECL_LINK( CheckBoxHdl, void* );
137 DECL_LINK( PasswordModifyHdl, void* );
139 ScPassHashProtectable* mpProtected;
142 #endif
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */