1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_INSCODLG_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_INSCODLG_HXX
22 
23 #include <vcl/weld.hxx>
24 #include <global.hxx>
25 
26 #include "scui_def.hxx"
27 
28 class ScInsertContentsDlg : public weld::GenericDialogController
29 {
30 public:
31             ScInsertContentsDlg( weld::Window*      pParent,
32                                  const OUString*   pStrTitle );
33     virtual ~ScInsertContentsDlg() override;
34 
35     InsertDeleteFlags GetInsContentsCmdBits() const;
36     ScPasteFunc       GetFormulaCmdBits() const;
37     bool            IsSkipEmptyCells() const;
38     bool            IsTranspose() const;
39     bool            IsLink() const;
40     InsCellCmd      GetMoveMode() const;
41 
42     void    SetOtherDoc( bool bSet );
43     void    SetFillMode( bool bSet );
44     void    SetChangeTrack( bool bSet );
45     void    SetCellShiftDisabled( CellShiftDisabledFlags nDisable );
46 
47 private:
48     bool              bOtherDoc;
49     bool              bFillMode;
50     bool              bChangeTrack;
51     bool              bMoveDownDisabled;
52     bool              bMoveRightDisabled;
53     bool              bUsedShortCut;
54 
55     InsertDeleteFlags nShortCutInsContentsCmdBits;
56     bool              bShortCutTranspose;
57 
58 
59     std::unique_ptr<weld::CheckButton>        mxBtnInsAll;
60     std::unique_ptr<weld::CheckButton>        mxBtnInsStrings;
61     std::unique_ptr<weld::CheckButton>        mxBtnInsNumbers;
62     std::unique_ptr<weld::CheckButton>        mxBtnInsDateTime;
63     std::unique_ptr<weld::CheckButton>        mxBtnInsFormulas;
64     std::unique_ptr<weld::CheckButton>        mxBtnInsNotes;
65     std::unique_ptr<weld::CheckButton>        mxBtnInsAttrs;
66     std::unique_ptr<weld::CheckButton>        mxBtnInsObjects;
67 
68     std::unique_ptr<weld::CheckButton>        mxBtnSkipEmptyCells;
69     std::unique_ptr<weld::CheckButton>        mxBtnTranspose;
70     std::unique_ptr<weld::CheckButton>        mxBtnLink;
71 
72     std::unique_ptr<weld::RadioButton>     mxRbNoOp;
73     std::unique_ptr<weld::RadioButton>     mxRbAdd;
74     std::unique_ptr<weld::RadioButton>     mxRbSub;
75     std::unique_ptr<weld::RadioButton>     mxRbMul;
76     std::unique_ptr<weld::RadioButton>     mxRbDiv;
77 
78     std::unique_ptr<weld::RadioButton>     mxRbMoveNone;
79     std::unique_ptr<weld::RadioButton>     mxRbMoveDown;
80     std::unique_ptr<weld::RadioButton>     mxRbMoveRight;
81 
82     std::unique_ptr<weld::Button>      mxBtnShortCutPasteValuesOnly;
83     std::unique_ptr<weld::Button>      mxBtnShortCutPasteValuesFormats;
84     std::unique_ptr<weld::Button>      mxBtnShortCutPasteTranspose;
85 
86     static bool         bPreviousAllCheck;
87     static InsertDeleteFlags nPreviousChecks;
88     static InsertContentsFlags nPreviousChecks2;
89     static ScPasteFunc  nPreviousFormulaChecks;
90     static sal_uInt16   nPreviousMoveMode;          // enum InsCellCmd
91 
92     void DisableChecks( bool bInsAllChecked );
93     void TestModes();
94 
95     // Handler
96     DECL_LINK( InsAllHdl, weld::ToggleButton&, void );
97     DECL_LINK( LinkBtnHdl, weld::ToggleButton&, void );
98     DECL_LINK( ShortCutHdl, weld::Button&, void );
99 };
100 
101 #endif // INCLUDED_SC_SOURCE_UI_INC_INSCODLG_HXX
102 
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
104