xref: /trunk/main/dbaccess/source/ui/dlg/tablespage.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
12e2212a7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
32e2212a7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
42e2212a7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
52e2212a7SAndrew Rist  * distributed with this work for additional information
62e2212a7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
72e2212a7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
82e2212a7SAndrew Rist  * "License"); you may not use this file except in compliance
92e2212a7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
112e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
132e2212a7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
142e2212a7SAndrew Rist  * software distributed under the License is distributed on an
152e2212a7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162e2212a7SAndrew Rist  * KIND, either express or implied.  See the License for the
172e2212a7SAndrew Rist  * specific language governing permissions and limitations
182e2212a7SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
202e2212a7SAndrew Rist  *************************************************************/
212e2212a7SAndrew Rist 
222e2212a7SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _DBAUI_TABLESPAGE_HXX_
25cdf0e10cSrcweir #define _DBAUI_TABLESPAGE_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _DBAUI_ADMINPAGES_HXX_
28cdf0e10cSrcweir #include "adminpages.hxx"
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _COM_SUN_STAR_I18N_XCOLLATOR_HPP_
31cdf0e10cSrcweir #include <com/sun/star/i18n/XCollator.hpp>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _OSL_MUTEX_HXX_
34cdf0e10cSrcweir #include <osl/mutex.hxx>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #ifndef _COMPHELPER_STLTYPES_HXX_
37cdf0e10cSrcweir #include <comphelper/stl_types.hxx>
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir #ifndef _SV_FIXED_HXX
40cdf0e10cSrcweir #include <vcl/fixed.hxx>
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir #ifndef _DBAUI_TABLETREE_HXX_
43cdf0e10cSrcweir #include "tabletree.hxx"
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
46cdf0e10cSrcweir #include <com/sun/star/sdbc/XConnection.hpp>
47cdf0e10cSrcweir #endif
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 
50cdf0e10cSrcweir //.........................................................................
51cdf0e10cSrcweir namespace dbaui
52cdf0e10cSrcweir {
53cdf0e10cSrcweir //.........................................................................
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     //========================================================================
56cdf0e10cSrcweir     //= OTableSubscriptionPage
57cdf0e10cSrcweir     //========================================================================
58cdf0e10cSrcweir     class OTableSubscriptionDialog;
59cdf0e10cSrcweir     class OTableSubscriptionPage
60cdf0e10cSrcweir             :public OGenericAdministrationPage
61cdf0e10cSrcweir     {
62cdf0e10cSrcweir     private:
63cdf0e10cSrcweir         FixedLine               m_aTables;
64cdf0e10cSrcweir         OTableTreeListBox       m_aTablesList;
65cdf0e10cSrcweir         FixedText               m_aExplanation;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir         ::rtl::OUString         m_sCatalogSeparator;
68cdf0e10cSrcweir         sal_Bool                m_bCheckedAll : 1;
69cdf0e10cSrcweir         sal_Bool                m_bCatalogAtStart : 1;
70cdf0e10cSrcweir 
71cdf0e10cSrcweir         ::osl::Mutex            m_aNotifierMutex;
72cdf0e10cSrcweir 
73cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
74cdf0e10cSrcweir                                 m_xCurrentConnection;   /// valid as long as the page is active
75cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator >
76cdf0e10cSrcweir                                 m_xCollator;
77cdf0e10cSrcweir         OTableSubscriptionDialog* m_pTablesDlg;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     public:
80cdf0e10cSrcweir         virtual sal_Bool            FillItemSet(SfxItemSet& _rCoreAttrs);
81cdf0e10cSrcweir         virtual int             DeactivatePage(SfxItemSet* _pSet);
82cdf0e10cSrcweir         using OGenericAdministrationPage::DeactivatePage;
83cdf0e10cSrcweir 
84cdf0e10cSrcweir         virtual void            StateChanged( StateChangedType nStateChange );
85cdf0e10cSrcweir         virtual void            DataChanged( const DataChangedEvent& rDCEvt );
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 
88cdf0e10cSrcweir         /** will be called when the controls need to be resized.
89cdf0e10cSrcweir         */
90cdf0e10cSrcweir         virtual void            resizeControls(const Size& _rDiff);
91cdf0e10cSrcweir 
92cdf0e10cSrcweir         OTableSubscriptionPage( Window* pParent, const SfxItemSet& _rCoreAttrs ,OTableSubscriptionDialog* _pTablesDlg);
93cdf0e10cSrcweir         virtual ~OTableSubscriptionPage();
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     protected:
96cdf0e10cSrcweir         virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
97cdf0e10cSrcweir         virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
98cdf0e10cSrcweir 
99cdf0e10cSrcweir         DECL_LINK( OnTreeEntryCompare, const SvSortData* );
100cdf0e10cSrcweir         DECL_LINK( OnTreeEntryChecked, Control* );
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     private:
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 
105cdf0e10cSrcweir         /** check the tables in <member>m_aTablesList</member> according to <arg>_rTables</arg>
106cdf0e10cSrcweir         */
107cdf0e10cSrcweir         void implCheckTables(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rTables);
108cdf0e10cSrcweir 
109cdf0e10cSrcweir         /// returns the next sibling, if not available, the next sibling of the parent, a.s.o.
110cdf0e10cSrcweir         SvLBoxEntry* implNextSibling(SvLBoxEntry* _pEntry) const;
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         /** return the current selection in <member>m_aTablesList</member>
113cdf0e10cSrcweir         */
114cdf0e10cSrcweir         ::com::sun::star::uno::Sequence< ::rtl::OUString > collectDetailedSelection() const;
115cdf0e10cSrcweir 
116cdf0e10cSrcweir         /// (un)check all entries
117cdf0e10cSrcweir         void CheckAll( sal_Bool bCheck = sal_True );
118cdf0e10cSrcweir 
119cdf0e10cSrcweir         virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
120cdf0e10cSrcweir 
121cdf0e10cSrcweir         // checks the tables according to the filter given
122*2814ae3cSJohn Bampton         // in opposite to implCheckTables, this method handles the case of an empty sequence, too ...
123cdf0e10cSrcweir         void implCompleteTablesCheck( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rTableFilter );
124cdf0e10cSrcweir     };
125cdf0e10cSrcweir 
126cdf0e10cSrcweir //.........................................................................
127cdf0e10cSrcweir }   // namespace dbaui
128cdf0e10cSrcweir //.........................................................................
129cdf0e10cSrcweir 
130cdf0e10cSrcweir #endif // _DBAUI_TABLESPAGE_HXX_
131