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