Line data Source code
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 SVX_DBREGISTER_HXX
21 : #define SVX_DBREGISTER_HXX
22 :
23 : #include "optpath.hxx"
24 : #include <tools/string.hxx>
25 : #include <comphelper/stl_types.hxx>
26 : #include <svl/poolitem.hxx>
27 : #include "ControlFocusHelper.hxx"
28 : #include <sfx2/basedlgs.hxx>
29 :
30 : class SvTreeListEntry;
31 : namespace svx
32 : {
33 : class OptHeaderTabListBox;
34 : }
35 : //........................................................................
36 : namespace svx
37 : {
38 : //........................................................................
39 :
40 : //====================================================================
41 : //= DbRegistrationOptionsPage
42 : //====================================================================
43 : class DbRegistrationOptionsPage : public SfxTabPage
44 : {
45 : private:
46 : FixedLine aStdBox;
47 : FixedText aTypeText;
48 : FixedText aPathText;
49 : SvxControlFocusHelper aPathCtrl;
50 : PushButton m_aNew;
51 : PushButton m_aEdit;
52 : PushButton m_aDelete;
53 :
54 : HeaderBar* pHeaderBar;
55 : ::svx::OptHeaderTabListBox* pPathBox;
56 : SvTreeListEntry* m_pCurEntry;
57 : sal_uLong m_nOldCount;
58 : sal_Bool m_bModified;
59 :
60 : #ifdef SVX_DBREGISTER_HXX
61 : DECL_LINK( NewHdl, void * );
62 : DECL_LINK( EditHdl, void * );
63 : DECL_LINK( DeleteHdl, void * );
64 :
65 : DECL_LINK(PathSelect_Impl, void *);
66 :
67 : DECL_LINK( HeaderSelect_Impl, HeaderBar * );
68 : DECL_LINK( HeaderEndDrag_Impl, HeaderBar * );
69 : DECL_LINK( NameValidator, String*);
70 :
71 :
72 : /** inserts a new entry in the tablistbox
73 : @param _sName
74 : The name of the entry.
75 : @param _sLocation
76 : The location of the file.
77 : */
78 : void insertNewEntry( const ::rtl::OUString& _sName,const ::rtl::OUString& _sLocation, const bool bReadOnly );
79 :
80 : /** opens the LinkDialog to create a register pair
81 : @param _sOldName
82 : The old name of the entry may be empty.
83 : @param _sOldLocation
84 : The old location of the entry may be empty.
85 : @param _pEntry
86 : The entry to remove if the entry will be changed
87 : */
88 : void openLinkDialog(const String& _sOldName,const String& _sOldLocation,SvTreeListEntry* _pEntry = NULL);
89 :
90 : #endif
91 :
92 : public:
93 : DbRegistrationOptionsPage( Window* pParent, const SfxItemSet& rSet );
94 : virtual ~DbRegistrationOptionsPage();
95 :
96 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
97 : static sal_uInt16* GetRanges();
98 :
99 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
100 : virtual void Reset( const SfxItemSet& rSet );
101 : virtual void FillUserData();
102 : };
103 :
104 : //====================================================================
105 : //= RegistrationItemSetHolder
106 : //====================================================================
107 : /** helper for DatabaseRegistrationDialog
108 :
109 : Necessary so that DatabaseRegistrationDialog is self-contained, i.e. always reflects
110 : the current registration state.
111 : */
112 : class RegistrationItemSetHolder
113 : {
114 : private:
115 : SfxItemSet m_aRegistrationItems;
116 :
117 : protected:
118 : RegistrationItemSetHolder( const SfxItemSet& _rMasterSet );
119 : ~RegistrationItemSetHolder();
120 :
121 : protected:
122 0 : const SfxItemSet& getRegistrationItems() const { return m_aRegistrationItems; }
123 : };
124 :
125 : //====================================================================
126 : //= DatabaseRegistrationDialog
127 : //====================================================================
128 : class DatabaseRegistrationDialog :public RegistrationItemSetHolder
129 : ,public SfxSingleTabDialog
130 : {
131 : public:
132 : DatabaseRegistrationDialog( Window* pParent, const SfxItemSet& rAttr );
133 : ~DatabaseRegistrationDialog();
134 :
135 : virtual short Execute();
136 : };
137 :
138 : //........................................................................
139 : } // namespace svx
140 : //........................................................................
141 :
142 : #endif // SVX_DBREGISTER_HXX
143 :
144 :
145 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|