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 DBACCESS_SOURCE_UI_INC_OPENDOCCONTROLS_HXX
25 #define DBACCESS_SOURCE_UI_INC_OPENDOCCONTROLS_HXX
26 
27 #ifndef _SV_BUTTON_HXX
28 #include <vcl/button.hxx>
29 #endif
30 #ifndef _SV_LSTBOX_HXX
31 #include <vcl/lstbox.hxx>
32 #endif
33 #ifndef _RTL_USTRING_HXX_
34 #include <rtl/ustring.hxx>
35 #endif
36 #include <map>
37 
38 //........................................................................
39 namespace dbaui
40 {
41 //........................................................................
42 
43 	//====================================================================
44 	//= OpenDocumentButton
45 	//====================================================================
46     /** a button which can be used to open a document
47 
48         The text of the button is the same as for the "Open" command in the application
49         UI. Additionally, the icon for this command is also displayed on the button.
50     */
51     class OpenDocumentButton : public PushButton
52 	{
53     private:
54         ::rtl::OUString     m_sModule;
55 
56     public:
57         OpenDocumentButton( Window* _pParent, const sal_Char* _pAsciiModuleName, const ResId& _rResId );
58 
59     protected:
60         void    impl_init( const sal_Char* _pAsciiModuleName );
61 	};
62 
63 	//====================================================================
64 	//= OpenDocumentListBox
65 	//====================================================================
66     class OpenDocumentListBox : public ListBox
67     {
68     private:
69         typedef ::std::pair< String, String >       StringPair;
70         typedef ::std::map< sal_uInt16, StringPair >    MapIndexToStringPair;
71 
72         ::rtl::OUString         m_sModule;
73         MapIndexToStringPair    m_aURLs;
74 
75     public:
76         OpenDocumentListBox( Window* _pParent, const sal_Char* _pAsciiModuleName, const ResId& _rResId );
77 
78         String  GetSelectedDocumentURL() const;
79         String  GetSelectedDocumentFilter() const;
80 
81     protected:
82         virtual void        RequestHelp( const HelpEvent& _rHEvt );
83 
84         StringPair  impl_getDocumentAtIndex( sal_uInt16 _nListIndex, bool _bSystemNotation = false ) const;
85 
86     private:
87         void    impl_init( const sal_Char* _pAsciiModuleName );
88     };
89 
90 //........................................................................
91 } // namespace dbaui
92 //........................................................................
93 
94 #endif // DBACCESS_SOURCE_UI_INC_OPENDOCCONTROLS_HXX
95 
96