1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef EXTENSIONS_SOURCE_PROPCTRLR_TABORDER_HXX
25 #define EXTENSIONS_SOURCE_PROPCTRLR_TABORDER_HXX
26 
27 #include <svtools/svtreebx.hxx>
28 #include <com/sun/star/awt/XTabControllerModel.hpp>
29 #include <com/sun/star/awt/XControlContainer.hpp>
30 #include <com/sun/star/beans/XPropertySet.hpp>
31 
32 #ifndef _DIALOG_HXX //autogen
33 #include <vcl/dialog.hxx>
34 #endif
35 
36 #ifndef _BUTTON_HXX //autogen
37 #include <vcl/button.hxx>
38 #endif
39 #include <vcl/lstbox.hxx>
40 
41 #ifndef _FIXED_HXX //autogen
42 #include <vcl/fixed.hxx>
43 #endif
44 
45 #ifndef _TOOLS_LIST_HXX
46 #include <tools/list.hxx>
47 #endif
48 #include <comphelper/uno3.hxx>
49 
50 //............................................................................
51 namespace pcr
52 {
53 //............................................................................
54 
55     //========================================================================
56     //= TabOrderListBox
57     //========================================================================
58     class TabOrderListBox : public SvTreeListBox
59     {
60     public:
61         TabOrderListBox( Window* pParent, const ResId& rResId  );
62         virtual ~TabOrderListBox();
63 
64         void            MoveSelection( long nRelPos );
65 
66     protected:
67         virtual void    ModelHasMoved(SvListEntry* pSource );
68 
69     private:
70         using SvTreeListBox::MoveSelection;
71     };
72 
73 
74     //========================================================================
75     //= TabOrderDialog
76     //========================================================================
77     class TabOrderDialog : public ModalDialog
78     {
79         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel >
80                                     m_xTempModel;
81         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel >
82                                     m_xModel;
83         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
84                                     m_xControlContainer;
85         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
86                                     m_xORB;
87 
88         FixedText                   aFT_Controls;
89         TabOrderListBox         aLB_Controls;
90 
91         OKButton                    aPB_OK;
92         CancelButton                aPB_CANCEL;
93         HelpButton                  aPB_HELP;
94 
95         PushButton                  aPB_MoveUp;
96         PushButton                  aPB_MoveDown;
97         PushButton                  aPB_AutoOrder;
98 
99         ImageList*                  pImageList;
100 
101         DECL_LINK( MoveUpClickHdl, Button* );
102         DECL_LINK( MoveDownClickHdl, Button* );
103         DECL_LINK( AutoOrderClickHdl, Button* );
104         DECL_LINK( OKClickHdl, Button* );
105 
106         void FillList();
107         Image GetImage(
108             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _rxSet
109         ) const;
110 
111     public:
112         TabOrderDialog(
113             Window* _pParent,
114             const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel >& _rxTabModel,
115             const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _rxControlCont,
116             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
117         );
118 
119         virtual ~TabOrderDialog();
120 
121         void SetModified();
122     };
123 
124 //............................................................................
125 }  // namespace pcr
126 //............................................................................
127 
128 #endif  // EXTENSIONS_SOURCE_PROPCTRLR_TABORDER_HXX
129