xref: /aoo4110/main/uui/source/fltdlg.hxx (revision b1cdbd2c)
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 UUI_FLTDLG_HXX
25 #define UUI_FLTDLG_HXX
26 
27 //_________________________________________________________________________________________________________________
28 //  includes
29 //_________________________________________________________________________________________________________________
30 
31 #include <vcl/dialog.hxx>
32 
33 #ifndef _MSGBOX_HXX
34 #include <vcl/msgbox.hxx>
35 #endif
36 #include <vcl/lstbox.hxx>
37 
38 #ifndef _SV_BUTTON_HXX
39 #include <vcl/button.hxx>
40 #endif
41 #include <vcl/fixed.hxx>
42 #include <tools/string.hxx>
43 
44 #include <vector>
45 
46 //_________________________________________________________________________________________________________________
47 //  namespace
48 //_________________________________________________________________________________________________________________
49 
50 namespace uui
51 {
52 
53 //_________________________________________________________________________________________________________________
54 //  definitions
55 //_________________________________________________________________________________________________________________
56 
57 struct FilterNamePair
58 {
59     String sInternal;
60     String sUI      ;
61 };
62 
63 typedef ::std::vector< FilterNamePair > FilterNameList   ;
64 typedef FilterNameList::const_iterator  FilterNameListPtr;
65 
66 class FilterDialog : public ModalDialog
67 {
68     // public interface
69     public:
70              FilterDialog (       Window*            pParentWindow  ,
71                                   ResMgr*            pResMgr        );
72         void SetURL       ( const String&            sURL           );
73         void ChangeFilters( const FilterNameList*    pFilterNames   );
74         bool AskForFilter (       FilterNameListPtr& pSelectedItem  );
75 
76     // helper (or hided functions!)
77     private:
Execute()78         short Execute() { return RET_CANCEL; };
79         String impl_buildUIFileName( const String& sURL );
80 
81     // member
82     private:
83               FixedText       m_ftURL       ;
84               ListBox         m_lbFilters   ;
85               OKButton        m_btnOK       ;
86               CancelButton    m_btnCancel   ;
87               HelpButton      m_btnHelp     ;
88         const FilterNameList* m_pFilterNames;
89 
90 };  // class FilterDialog
91 
92 }   // namespace uui
93 
94 #endif // UUI_FLTDLG_HXX
95