xref: /trunk/main/sc/source/ui/inc/tpusrlst.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_TPUSRLST_HXX
29 #define SC_TPUSRLST_HXX
30 
31 #include <sfx2/tabdlg.hxx>
32 #include <vcl/fixed.hxx>
33 #include <vcl/lstbox.hxx>
34 #include <svtools/svmedit.hxx>
35 
36 //========================================================================
37 // Benutzerdefinierte Listen:
38 
39 class ScUserList;
40 class ScDocument;
41 class ScViewData;
42 class ScRangeUtil;
43 
44 class ScTpUserLists : public SfxTabPage
45 {
46 public:
47     static  SfxTabPage* Create          ( Window*               pParent,
48                                           const SfxItemSet&     rAttrSet );
49     static  sal_uInt16*     GetRanges       ();
50     virtual sal_Bool        FillItemSet     ( SfxItemSet& rCoreAttrs );
51     virtual void        Reset           ( const SfxItemSet& rCoreAttrs );
52     using SfxTabPage::DeactivatePage;
53     virtual int         DeactivatePage  ( SfxItemSet* pSet = NULL );
54 
55 private:
56             ScTpUserLists( Window*              pParent,
57                            const SfxItemSet&    rArgSet );
58             ~ScTpUserLists();
59 
60 private:
61     FixedText       aFtLists;
62     ListBox         aLbLists;
63     FixedText       aFtEntries;
64     MultiLineEdit   aEdEntries;
65     FixedText       aFtCopyFrom;
66     Edit            aEdCopyFrom;
67     PushButton      aBtnNew;
68     PushButton      aBtnAdd;
69     PushButton      aBtnRemove;
70     PushButton      aBtnCopy;
71 
72     const String    aStrQueryRemove;
73     const String    aStrNew;
74     const String    aStrCancel;
75     const String    aStrAdd;
76     const String    aStrModify;
77     const String    aStrCopyList;
78     const String    aStrCopyFrom;
79     const String    aStrCopyErr;
80 
81     const sal_uInt16    nWhichUserLists;
82     ScUserList*     pUserLists;
83 
84     ScDocument*     pDoc;
85     ScViewData*     pViewData;
86     ScRangeUtil*    pRangeUtil;
87     String          aStrSelectedArea;
88 
89     sal_Bool            bModifyMode;
90     sal_Bool            bCancelMode;
91     sal_Bool            bCopyDone;
92     sal_uInt16          nCancelPos;
93 
94 #ifdef _TPUSRLST_CXX
95 private:
96     void    Init                ();
97     sal_uInt16  UpdateUserListBox   ();
98     void    UpdateEntries       ( sal_uInt16 nList );
99     void    MakeListStr         ( String& rListStr );
100     void    AddNewList          ( const String& rEntriesStr );
101     void    RemoveList          ( sal_uInt16 nList );
102     void    ModifyList          ( sal_uInt16        nSelList,
103                                   const String& rEntriesStr );
104     void    CopyListFromArea    ( const ScRefAddress& rStartPos,
105                                   const ScRefAddress& rEndPos );
106 
107     // Handler:
108     DECL_LINK( LbSelectHdl,     ListBox* );
109     DECL_LINK( BtnClickHdl,     PushButton* );
110     DECL_LINK( EdEntriesModHdl, MultiLineEdit* );
111 #endif
112 };
113 
114 
115 
116 #endif // SC_TPUSRLST_HXX
117 
118