xref: /aoo41x/main/basctl/source/basicide/objdlg.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _OBJDLG_HXX
29 #define _OBJDLG_HXX
30 
31 #include <svheader.hxx>
32 #include <vcl/floatwin.hxx>
33 #include <vcl/toolbox.hxx>
34 #include <vcl/fixed.hxx>
35 #include "vcl/image.hxx"
36 
37 #include <bastype2.hxx>
38 
39 class StarBASIC;
40 
41 class ObjectTreeListBox : public BasicTreeListBox
42 {
43 private:
44 
45 	virtual void	Command( const CommandEvent& rCEvt );
46 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
47 
48 public:
49 			ObjectTreeListBox( Window* pParent, const ResId& rRes );
50 			~ObjectTreeListBox();
51 };
52 
53 class ObjectCatalogToolBox_Impl: public ToolBox
54 {
55 public:
56     ObjectCatalogToolBox_Impl(Window * pParent, ResId const & rResId,
57                               ResId const & rImagesHighContrastId);
58 
59 private:
60     virtual void DataChanged(DataChangedEvent const & rDCEvt);
61 
62     void setImages();
63 
64     ImageList m_aImagesNormal;
65     ImageList m_aImagesHighContrast;
66     bool m_bHighContrast;
67 };
68 
69 class ObjectCatalog : public FloatingWindow
70 {
71 private:
72 	ObjectTreeListBox	aMacroTreeList;
73     ObjectCatalogToolBox_Impl aToolBox;
74 	FixedText			aMacroDescr;
75 	Link				aCancelHdl;
76 
77 protected:
78 	DECL_LINK( ToolBoxHdl, ToolBox* );
79 	void				CheckButtons();
80 	DECL_LINK( TreeListHighlightHdl, SvTreeListBox * );
81 	void				UpdateFields();
82 	virtual void		Move();
83 	virtual sal_Bool		Close();
84 	virtual void		Resize();
85 
86 public:
87 	ObjectCatalog( Window * pParent );
88 	virtual ~ObjectCatalog();
89 
90 	void				UpdateEntries();
91     void                SetCurrentEntry( BasicEntryDescriptor& rDesc );
92 
93 	void				SetCancelHdl( const Link& rLink ) { aCancelHdl = rLink; }
94 };
95 
96 #endif	//_OBJDLG_HXX
97 
98