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 #pragma once
21 
22 #include <unotools/configitem.hxx>
23 
24 class ScInputOptions
25 {
26 private:
27     sal_uInt16  nMoveDir;           // enum ScDirection
28     bool        bMoveSelection;
29     bool        bEnterEdit;
30     bool        bExtendFormat;
31     bool        bRangeFinder;
32     bool        bExpandRefs;
33     bool        mbSortRefUpdate;
34     bool        bMarkHeader;
35     bool        bUseTabCol;
36     bool        bTextWysiwyg;
37     bool        bReplCellsWarn;
38     bool        bLegacyCellSelection;
39     bool        bEnterPasteMode;
40 
41 public:
42                 ScInputOptions();
43 
44     void        SetDefaults();
45 
SetMoveDir(sal_uInt16 nNew)46     void        SetMoveDir(sal_uInt16 nNew)         { nMoveDir = nNew;       }
GetMoveDir() const47     sal_uInt16      GetMoveDir() const              { return nMoveDir;       }
SetMoveSelection(bool bSet)48     void        SetMoveSelection(bool bSet)     { bMoveSelection = bSet; }
GetMoveSelection() const49     bool        GetMoveSelection() const        { return bMoveSelection; }
SetEnterEdit(bool bSet)50     void        SetEnterEdit(bool bSet)         { bEnterEdit = bSet;     }
GetEnterEdit() const51     bool        GetEnterEdit() const            { return bEnterEdit;     }
SetExtendFormat(bool bSet)52     void        SetExtendFormat(bool bSet)      { bExtendFormat = bSet;  }
GetExtendFormat() const53     bool        GetExtendFormat() const         { return bExtendFormat;  }
SetRangeFinder(bool bSet)54     void        SetRangeFinder(bool bSet)       { bRangeFinder = bSet;   }
GetRangeFinder() const55     bool        GetRangeFinder() const          { return bRangeFinder;   }
SetExpandRefs(bool bSet)56     void        SetExpandRefs(bool bSet)        { bExpandRefs = bSet;    }
GetExpandRefs() const57     bool        GetExpandRefs() const           { return bExpandRefs;    }
SetSortRefUpdate(bool bSet)58     void        SetSortRefUpdate(bool bSet)     { mbSortRefUpdate = bSet; }
GetSortRefUpdate() const59     bool        GetSortRefUpdate() const        { return mbSortRefUpdate; }
SetMarkHeader(bool bSet)60     void        SetMarkHeader(bool bSet)        { bMarkHeader = bSet;    }
GetMarkHeader() const61     bool        GetMarkHeader() const           { return bMarkHeader;    }
SetUseTabCol(bool bSet)62     void        SetUseTabCol(bool bSet)         { bUseTabCol = bSet;     }
GetUseTabCol() const63     bool        GetUseTabCol() const            { return bUseTabCol;     }
SetTextWysiwyg(bool bSet)64     void        SetTextWysiwyg(bool bSet)       { bTextWysiwyg = bSet;   }
GetTextWysiwyg() const65     bool        GetTextWysiwyg() const          { return bTextWysiwyg;   }
SetReplaceCellsWarn(bool bSet)66     void        SetReplaceCellsWarn(bool bSet)  { bReplCellsWarn = bSet; }
GetReplaceCellsWarn() const67     bool        GetReplaceCellsWarn() const     { return bReplCellsWarn; }
SetLegacyCellSelection(bool bSet)68     void        SetLegacyCellSelection(bool bSet)   { bLegacyCellSelection = bSet; }
GetLegacyCellSelection() const69     bool        GetLegacyCellSelection() const      { return bLegacyCellSelection; }
SetEnterPasteMode(bool bSet)70     void        SetEnterPasteMode(bool bSet)    { bEnterPasteMode = bSet; }
GetEnterPasteMode() const71     bool        GetEnterPasteMode() const       { return bEnterPasteMode; }
72 };
73 
74 // CfgItem for input options
75 
76 class ScInputCfg final : public ScInputOptions,
77                   public utl::ConfigItem
78 {
79     static css::uno::Sequence<OUString> GetPropertyNames();
80 
81     virtual void    ImplCommit() override;
82 
83 public:
84             ScInputCfg();
85 
86     void            SetOptions( const ScInputOptions& rNew );
87     void            OptionsChanged();   // after direct access to SetOptions base class
88 
89     virtual void    Notify( const css::uno::Sequence<OUString>& aPropertyNames ) override;
90 };
91 
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
93