Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SVX_DBREGISTER_HXX
30 : : #define SVX_DBREGISTER_HXX
31 : :
32 : : #include "optpath.hxx"
33 : : #include <tools/string.hxx>
34 : : #include <comphelper/stl_types.hxx>
35 : : #include <svl/poolitem.hxx>
36 : : #include "ControlFocusHelper.hxx"
37 : : #include <sfx2/basedlgs.hxx>
38 : :
39 : : class SvLBoxEntry;
40 : : namespace svx
41 : : {
42 : : class OptHeaderTabListBox;
43 : : }
44 : : //........................................................................
45 : : namespace svx
46 : : {
47 : : //........................................................................
48 : :
49 : : //====================================================================
50 : : //= DbRegistrationOptionsPage
51 : : //====================================================================
52 : : class DbRegistrationOptionsPage : public SfxTabPage
53 : : {
54 : : private:
55 : : FixedLine aStdBox;
56 : : FixedText aTypeText;
57 : : FixedText aPathText;
58 : : SvxControlFocusHelper aPathCtrl;
59 : : PushButton m_aNew;
60 : : PushButton m_aEdit;
61 : : PushButton m_aDelete;
62 : :
63 : : HeaderBar* pHeaderBar;
64 : : ::svx::OptHeaderTabListBox* pPathBox;
65 : : SvLBoxEntry* m_pCurEntry;
66 : : sal_uLong m_nOldCount;
67 : : sal_Bool m_bModified;
68 : :
69 : : #ifdef SVX_DBREGISTER_HXX
70 : : DECL_LINK( NewHdl, void * );
71 : : DECL_LINK( EditHdl, void * );
72 : : DECL_LINK( DeleteHdl, void * );
73 : :
74 : : DECL_LINK(PathSelect_Impl, void *);
75 : :
76 : : DECL_LINK( HeaderSelect_Impl, HeaderBar * );
77 : : DECL_LINK( HeaderEndDrag_Impl, HeaderBar * );
78 : : DECL_LINK( NameValidator, String*);
79 : :
80 : :
81 : : /** inserts a new entry in the tablistbox
82 : : @param _sName
83 : : The name of the entry.
84 : : @param _sLocation
85 : : The location of the file.
86 : : */
87 : : void insertNewEntry( const ::rtl::OUString& _sName,const ::rtl::OUString& _sLocation, const bool bReadOnly );
88 : :
89 : : /** opens the LinkDialog to create a register pair
90 : : @param _sOldName
91 : : The old name of the entry may be empty.
92 : : @param _sOldLocation
93 : : The old location of the entry may be empty.
94 : : @param _pEntry
95 : : The entry to remove if the entry will be changed
96 : : */
97 : : void openLinkDialog(const String& _sOldName,const String& _sOldLocation,SvLBoxEntry* _pEntry = NULL);
98 : :
99 : : #endif
100 : :
101 : : public:
102 : : DbRegistrationOptionsPage( Window* pParent, const SfxItemSet& rSet );
103 : : virtual ~DbRegistrationOptionsPage();
104 : :
105 : : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
106 : : static sal_uInt16* GetRanges();
107 : :
108 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
109 : : virtual void Reset( const SfxItemSet& rSet );
110 : : virtual void FillUserData();
111 : : };
112 : :
113 : : //====================================================================
114 : : //= RegistrationItemSetHolder
115 : : //====================================================================
116 : : /** helper for DatabaseRegistrationDialog
117 : :
118 : : Necessary so that DatabaseRegistrationDialog is self-contained, i.e. always reflects
119 : : the current registration state.
120 : : */
121 : : class RegistrationItemSetHolder
122 : : {
123 : : private:
124 : : SfxItemSet m_aRegistrationItems;
125 : :
126 : : protected:
127 : : RegistrationItemSetHolder( const SfxItemSet& _rMasterSet );
128 : : ~RegistrationItemSetHolder();
129 : :
130 : : protected:
131 : 0 : const SfxItemSet& getRegistrationItems() const { return m_aRegistrationItems; }
132 : : };
133 : :
134 : : //====================================================================
135 : : //= DatabaseRegistrationDialog
136 : : //====================================================================
137 : : class DatabaseRegistrationDialog :public RegistrationItemSetHolder
138 : : ,public SfxSingleTabDialog
139 : : {
140 : : public:
141 : : DatabaseRegistrationDialog( Window* pParent, const SfxItemSet& rAttr );
142 : : ~DatabaseRegistrationDialog();
143 : :
144 : : virtual short Execute();
145 : : };
146 : :
147 : : //........................................................................
148 : : } // namespace svx
149 : : //........................................................................
150 : :
151 : : #endif // SVX_DBREGISTER_HXX
152 : :
153 : :
154 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|