Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / inc / dbregister.hxx
blob224b393bb4936455389a7c45ded799e6e5ebf844
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef SVX_DBREGISTER_HXX
21 #define SVX_DBREGISTER_HXX
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>
30 class SvTreeListEntry;
31 namespace svx
33 class OptHeaderTabListBox;
35 //........................................................................
36 namespace svx
38 //........................................................................
40 //====================================================================
41 //= DbRegistrationOptionsPage
42 //====================================================================
43 class DbRegistrationOptionsPage : public SfxTabPage
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;
54 HeaderBar* pHeaderBar;
55 ::svx::OptHeaderTabListBox* pPathBox;
56 SvTreeListEntry* m_pCurEntry;
57 sal_uLong m_nOldCount;
58 sal_Bool m_bModified;
60 #ifdef SVX_DBREGISTER_HXX
61 DECL_LINK( NewHdl, void * );
62 DECL_LINK( EditHdl, void * );
63 DECL_LINK( DeleteHdl, void * );
65 DECL_LINK(PathSelect_Impl, void *);
67 DECL_LINK( HeaderSelect_Impl, HeaderBar * );
68 DECL_LINK( HeaderEndDrag_Impl, HeaderBar * );
69 DECL_LINK( NameValidator, String*);
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.
78 void insertNewEntry( const ::rtl::OUString& _sName,const ::rtl::OUString& _sLocation, const bool bReadOnly );
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
88 void openLinkDialog(const String& _sOldName,const String& _sOldLocation,SvTreeListEntry* _pEntry = NULL);
90 #endif
92 public:
93 DbRegistrationOptionsPage( Window* pParent, const SfxItemSet& rSet );
94 virtual ~DbRegistrationOptionsPage();
96 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
97 static sal_uInt16* GetRanges();
99 virtual sal_Bool FillItemSet( SfxItemSet& rSet );
100 virtual void Reset( const SfxItemSet& rSet );
101 virtual void FillUserData();
104 //====================================================================
105 //= RegistrationItemSetHolder
106 //====================================================================
107 /** helper for DatabaseRegistrationDialog
109 Necessary so that DatabaseRegistrationDialog is self-contained, i.e. always reflects
110 the current registration state.
112 class RegistrationItemSetHolder
114 private:
115 SfxItemSet m_aRegistrationItems;
117 protected:
118 RegistrationItemSetHolder( const SfxItemSet& _rMasterSet );
119 ~RegistrationItemSetHolder();
121 protected:
122 const SfxItemSet& getRegistrationItems() const { return m_aRegistrationItems; }
125 //====================================================================
126 //= DatabaseRegistrationDialog
127 //====================================================================
128 class DatabaseRegistrationDialog :public RegistrationItemSetHolder
129 ,public SfxSingleTabDialog
131 public:
132 DatabaseRegistrationDialog( Window* pParent, const SfxItemSet& rAttr );
133 ~DatabaseRegistrationDialog();
135 virtual short Execute();
138 //........................................................................
139 } // namespace svx
140 //........................................................................
142 #endif // SVX_DBREGISTER_HXX
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */