LibreOffice Module sc (master)  1
tpusrlst.hxx
Go to the documentation of this file.
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 <sfx2/tabdlg.hxx>
23 
24 class ScUserList;
25 class ScDocument;
26 class ScViewData;
27 class ScRefAddress;
28 
29 class ScTpUserLists : public SfxTabPage
30 {
31 public:
32  ScTpUserLists(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
33  static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController,
34  const SfxItemSet* rAttrSet);
35  virtual ~ScTpUserLists() override;
36  virtual bool FillItemSet ( SfxItemSet* rCoreAttrs ) override;
37  virtual void Reset ( const SfxItemSet* rCoreAttrs ) override;
38  virtual DeactivateRC DeactivatePage ( SfxItemSet* pSet ) override;
39 
40 private:
41  std::unique_ptr<weld::Label> mxFtLists;
42  std::unique_ptr<weld::TreeView> mxLbLists;
43  std::unique_ptr<weld::Label> mxFtEntries;
44  std::unique_ptr<weld::TextView> mxEdEntries;
45  std::unique_ptr<weld::Label> mxFtCopyFrom;
46  std::unique_ptr<weld::Entry> mxEdCopyFrom;
47  std::unique_ptr<weld::Button> mxBtnNew;
48  std::unique_ptr<weld::Button> mxBtnDiscard;
49  std::unique_ptr<weld::Button> mxBtnAdd;
50  std::unique_ptr<weld::Button> mxBtnModify;
51  std::unique_ptr<weld::Button> mxBtnRemove;
52  std::unique_ptr<weld::Button> mxBtnCopy;
53 
54  const OUString aStrQueryRemove;
55  const OUString aStrCopyList;
56  const OUString aStrCopyFrom;
57  const OUString aStrCopyErr;
58 
59  const sal_uInt16 nWhichUserLists;
60  std::unique_ptr<ScUserList> pUserLists;
61 
64  OUString aStrSelectedArea;
65 
68  bool bCopyDone;
69  sal_Int32 nCancelPos;
70 
71  void Init ();
72  size_t UpdateUserListBox ();
73  void UpdateEntries ( size_t nList );
74  static void MakeListStr ( OUString& rListStr );
75  void AddNewList ( const OUString& rEntriesStr );
76  void RemoveList ( size_t nList );
77  void ModifyList ( size_t nSelList,
78  const OUString& rEntriesStr );
79  void CopyListFromArea ( const ScRefAddress& rStartPos,
80  const ScRefAddress& rEndPos );
81 
82  // Handler:
83  DECL_LINK( LbSelectHdl, weld::TreeView&, void );
84  DECL_LINK( BtnClickHdl, weld::Button&, void );
85  DECL_LINK( EdEntriesModHdl, weld::TextView&, void);
86 };
87 
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Collection of user-defined sort lists.
Definition: userlist.hxx:66
std::unique_ptr< weld::Button > mxBtnRemove
Definition: tpusrlst.hxx:51
std::unique_ptr< weld::Label > mxFtEntries
Definition: tpusrlst.hxx:43
std::unique_ptr< weld::TreeView > mxLbLists
Definition: tpusrlst.hxx:42
const SfxItemSet * pSet
std::unique_ptr< weld::Button > mxBtnDiscard
Definition: tpusrlst.hxx:48
size_t UpdateUserListBox()
Definition: tpusrlst.cxx:235
ScDocument * pDoc
Definition: tpusrlst.hxx:62
ScViewData * pViewData
Definition: tpusrlst.hxx:63
virtual void Reset(const SfxItemSet *rCoreAttrs) override
Definition: tpusrlst.cxx:138
static void MakeListStr(OUString &rListStr)
Definition: tpusrlst.cxx:279
const OUString aStrCopyList
Definition: tpusrlst.hxx:55
std::unique_ptr< weld::Button > mxBtnModify
Definition: tpusrlst.hxx:50
void UpdateEntries(size_t nList)
Definition: tpusrlst.cxx:254
sal_Int32 nCancelPos
Definition: tpusrlst.hxx:69
OUString aStrSelectedArea
Definition: tpusrlst.hxx:64
std::unique_ptr< weld::Label > mxFtLists
Definition: tpusrlst.hxx:41
bool bCopyDone
Definition: tpusrlst.hxx:68
virtual ~ScTpUserLists() override
Definition: tpusrlst.cxx:82
std::unique_ptr< weld::Label > mxFtCopyFrom
Definition: tpusrlst.hxx:45
void Init()
Definition: tpusrlst.cxx:86
void RemoveList(size_t nList)
Definition: tpusrlst.cxx:425
const sal_uInt16 nWhichUserLists
Definition: tpusrlst.hxx:59
void CopyListFromArea(const ScRefAddress &rStartPos, const ScRefAddress &rEndPos)
Definition: tpusrlst.cxx:327
void AddNewList(const OUString &rEntriesStr)
Definition: tpusrlst.cxx:315
const OUString aStrCopyFrom
Definition: tpusrlst.hxx:56
void ModifyList(size_t nSelList, const OUString &rEntriesStr)
Definition: tpusrlst.cxx:413
bool bModifyMode
Definition: tpusrlst.hxx:66
DECL_LINK(LbSelectHdl, weld::TreeView &, void)
bool bCancelMode
Definition: tpusrlst.hxx:67
std::unique_ptr< weld::Entry > mxEdCopyFrom
Definition: tpusrlst.hxx:46
virtual bool FillItemSet(SfxItemSet *rCoreAttrs) override
Definition: tpusrlst.cxx:188
ScTpUserLists(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpusrlst.cxx:49
std::unique_ptr< weld::Button > mxBtnCopy
Definition: tpusrlst.hxx:52
DeactivateRC
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tpusrlst.cxx:227
std::unique_ptr< weld::TextView > mxEdEntries
Definition: tpusrlst.hxx:44
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tpusrlst.cxx:133
const OUString aStrCopyErr
Definition: tpusrlst.hxx:57
std::unique_ptr< ScUserList > pUserLists
Definition: tpusrlst.hxx:60
std::unique_ptr< weld::Button > mxBtnAdd
Definition: tpusrlst.hxx:49
std::unique_ptr< weld::Button > mxBtnNew
Definition: tpusrlst.hxx:47
const OUString aStrQueryRemove
Definition: tpusrlst.hxx:54