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 #ifndef INCLUDED_SC_SOURCE_UI_INC_TPUSRLST_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_TPUSRLST_HXX
22 
23 #include <sfx2/tabdlg.hxx>
24 
25 class ScUserList;
26 class ScDocument;
27 class ScViewData;
28 class ScRefAddress;
29 
30 class ScTpUserLists : public SfxTabPage
31 {
32 public:
33  ScTpUserLists(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
34  static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController,
35  const SfxItemSet* rAttrSet);
36  virtual ~ScTpUserLists() override;
37  virtual bool FillItemSet ( SfxItemSet* rCoreAttrs ) override;
38  virtual void Reset ( const SfxItemSet* rCoreAttrs ) override;
39  virtual DeactivateRC DeactivatePage ( SfxItemSet* pSet ) override;
40 
41 private:
42  std::unique_ptr<weld::Label> mxFtLists;
43  std::unique_ptr<weld::TreeView> mxLbLists;
44  std::unique_ptr<weld::Label> mxFtEntries;
45  std::unique_ptr<weld::TextView> mxEdEntries;
46  std::unique_ptr<weld::Label> mxFtCopyFrom;
47  std::unique_ptr<weld::Entry> mxEdCopyFrom;
48  std::unique_ptr<weld::Button> mxBtnNew;
49  std::unique_ptr<weld::Button> mxBtnDiscard;
50  std::unique_ptr<weld::Button> mxBtnAdd;
51  std::unique_ptr<weld::Button> mxBtnModify;
52  std::unique_ptr<weld::Button> mxBtnRemove;
53  std::unique_ptr<weld::Button> mxBtnCopy;
54 
55  const OUString aStrQueryRemove;
56  const OUString aStrCopyList;
57  const OUString aStrCopyFrom;
58  const OUString aStrCopyErr;
59 
60  const sal_uInt16 nWhichUserLists;
61  std::unique_ptr<ScUserList> pUserLists;
62 
65  OUString aStrSelectedArea;
66 
69  bool bCopyDone;
70  sal_Int32 nCancelPos;
71 
72  void Init ();
73  size_t UpdateUserListBox ();
74  void UpdateEntries ( size_t nList );
75  static void MakeListStr ( OUString& rListStr );
76  void AddNewList ( const OUString& rEntriesStr );
77  void RemoveList ( size_t nList );
78  void ModifyList ( size_t nSelList,
79  const OUString& rEntriesStr );
80  void CopyListFromArea ( const ScRefAddress& rStartPos,
81  const ScRefAddress& rEndPos );
82 
83  // Handler:
84  DECL_LINK( LbSelectHdl, weld::TreeView&, void );
85  DECL_LINK( BtnClickHdl, weld::Button&, void );
86  DECL_LINK( EdEntriesModHdl, weld::TextView&, void);
87 };
88 
89 #endif // INCLUDED_SC_SOURCE_UI_INC_TPUSRLST_HXX
90 
91 /* 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:52
std::unique_ptr< weld::Label > mxFtEntries
Definition: tpusrlst.hxx:44
std::unique_ptr< weld::TreeView > mxLbLists
Definition: tpusrlst.hxx:43
const SfxItemSet * pSet
std::unique_ptr< weld::Button > mxBtnDiscard
Definition: tpusrlst.hxx:49
size_t UpdateUserListBox()
Definition: tpusrlst.cxx:234
ScDocument * pDoc
Definition: tpusrlst.hxx:63
ScViewData * pViewData
Definition: tpusrlst.hxx:64
virtual void Reset(const SfxItemSet *rCoreAttrs) override
Definition: tpusrlst.cxx:137
static void MakeListStr(OUString &rListStr)
Definition: tpusrlst.cxx:278
const OUString aStrCopyList
Definition: tpusrlst.hxx:56
std::unique_ptr< weld::Button > mxBtnModify
Definition: tpusrlst.hxx:51
void UpdateEntries(size_t nList)
Definition: tpusrlst.cxx:253
sal_Int32 nCancelPos
Definition: tpusrlst.hxx:70
OUString aStrSelectedArea
Definition: tpusrlst.hxx:65
std::unique_ptr< weld::Label > mxFtLists
Definition: tpusrlst.hxx:42
bool bCopyDone
Definition: tpusrlst.hxx:69
virtual ~ScTpUserLists() override
Definition: tpusrlst.cxx:81
std::unique_ptr< weld::Label > mxFtCopyFrom
Definition: tpusrlst.hxx:46
void Init()
Definition: tpusrlst.cxx:85
void RemoveList(size_t nList)
Definition: tpusrlst.cxx:424
const sal_uInt16 nWhichUserLists
Definition: tpusrlst.hxx:60
void CopyListFromArea(const ScRefAddress &rStartPos, const ScRefAddress &rEndPos)
Definition: tpusrlst.cxx:326
void AddNewList(const OUString &rEntriesStr)
Definition: tpusrlst.cxx:314
const OUString aStrCopyFrom
Definition: tpusrlst.hxx:57
void ModifyList(size_t nSelList, const OUString &rEntriesStr)
Definition: tpusrlst.cxx:412
bool bModifyMode
Definition: tpusrlst.hxx:67
DECL_LINK(LbSelectHdl, weld::TreeView &, void)
bool bCancelMode
Definition: tpusrlst.hxx:68
std::unique_ptr< weld::Entry > mxEdCopyFrom
Definition: tpusrlst.hxx:47
virtual bool FillItemSet(SfxItemSet *rCoreAttrs) override
Definition: tpusrlst.cxx:187
ScTpUserLists(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpusrlst.cxx:48
std::unique_ptr< weld::Button > mxBtnCopy
Definition: tpusrlst.hxx:53
DeactivateRC
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tpusrlst.cxx:226
std::unique_ptr< weld::TextView > mxEdEntries
Definition: tpusrlst.hxx:45
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tpusrlst.cxx:132
const OUString aStrCopyErr
Definition: tpusrlst.hxx:58
std::unique_ptr< ScUserList > pUserLists
Definition: tpusrlst.hxx:61
std::unique_ptr< weld::Button > mxBtnAdd
Definition: tpusrlst.hxx:50
std::unique_ptr< weld::Button > mxBtnNew
Definition: tpusrlst.hxx:48
const OUString aStrQueryRemove
Definition: tpusrlst.hxx:55