Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _XMLFILTERSETTINGSDIALOG_HXX_
29 : : #define _XMLFILTERSETTINGSDIALOG_HXX_
30 : :
31 : : #include <com/sun/star/lang/XComponent.hpp>
32 : : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 : : #include <com/sun/star/container/XHierarchicalName.hpp>
34 : : #include <com/sun/star/container/XNameContainer.hpp>
35 : : #include <vcl/wrkwin.hxx>
36 : :
37 : : #include <vcl/button.hxx>
38 : : #include <svtools/svtabbx.hxx>
39 : : #include <svl/poolitem.hxx>
40 : : #include <unotools/moduleoptions.hxx>
41 : :
42 : : #include "xmlfiltercommon.hxx"
43 : :
44 : : // --------------------------------------------------------------------
45 : :
46 : 0 : class SvxPathControl_Impl : public Control
47 : : {
48 : : private:
49 : : Control* m_pFocusCtrl;
50 : :
51 : : public:
52 : 0 : SvxPathControl_Impl( Window* pParent, const ResId& rId ) :
53 : 0 : Control( pParent, rId ), m_pFocusCtrl( NULL ) {}
54 : :
55 : 0 : void SetFocusControl( Control* pCtrl ) { m_pFocusCtrl = pCtrl; }
56 : :
57 : : virtual long Notify( NotifyEvent& rNEvt );
58 : : };
59 : :
60 : : // --------------------------------------------------------------------
61 : :
62 : : class HeaderBar;
63 : :
64 : : class XMLFilterListBox : public SvTabListBox
65 : : {
66 : : private:
67 : : bool mbFirstPaint;
68 : : HeaderBar* mpHeaderBar;
69 : :
70 : : DECL_LINK( TabBoxScrollHdl_Impl, SvTabListBox* );
71 : : DECL_LINK( HeaderEndDrag_Impl, HeaderBar* );
72 : :
73 : : String getEntryString( const filter_info_impl* pInfo ) const;
74 : :
75 : : public:
76 : : XMLFilterListBox( SvxPathControl_Impl* pParent );
77 : : ~XMLFilterListBox();
78 : :
79 : : void Reset();
80 : :
81 : : /** adds a new filter info entry to the ui filter list */
82 : : void addFilterEntry( const filter_info_impl* pInfo );
83 : :
84 : : void changeEntry( const filter_info_impl* pInfo );
85 : :
86 : : virtual void Paint( const Rectangle& rRect );
87 : : };
88 : :
89 : : // --------------------------------------------------------------------
90 : :
91 : : class XMLFilterSettingsDialog : public WorkWindow
92 : : {
93 : : public:
94 : : XMLFilterSettingsDialog( Window* pParent, ResMgr& rResMgr, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxMSF );
95 : : virtual ~XMLFilterSettingsDialog();
96 : :
97 : : DECL_LINK(ClickHdl_Impl, PushButton * );
98 : : DECL_LINK(SelectionChangedHdl_Impl, void * );
99 : : DECL_LINK(DoubleClickHdl_Impl, void * );
100 : :
101 : : void ShowWindow();
102 : :
103 : : void onNew();
104 : : void onEdit();
105 : : void onTest();
106 : : void onDelete();
107 : : void onSave();
108 : : void onOpen();
109 : : void onClose();
110 : :
111 : : void updateStates();
112 : :
113 : : virtual long Notify( NotifyEvent& rNEvt );
114 : :
115 : : bool isClosable();
116 : :
117 : : static ResMgr* mpResMgr;
118 : :
119 : : private:
120 : : void initFilterList();
121 : : void disposeFilterList();
122 : :
123 : : bool insertOrEdit( filter_info_impl* pNewInfo, const filter_info_impl* pOldInfo = NULL );
124 : :
125 : : rtl::OUString createUniqueFilterName( const rtl::OUString& rUIName );
126 : : rtl::OUString createUniqueTypeName( const rtl::OUString& rTypeName );
127 : : rtl::OUString createUniqueInterfaceName( const rtl::OUString& rInterfaceName );
128 : :
129 : : private:
130 : :
131 : : com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
132 : : com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxFilterContainer;
133 : : com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxTypeDetection;
134 : : com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxExtendedTypeDetection;
135 : :
136 : : std::vector< filter_info_impl* > maFilterVector;
137 : :
138 : : XMLFilterListBox* mpFilterListBox;
139 : : SvxPathControl_Impl maCtrlFilterList;
140 : : PushButton maPBNew;
141 : : PushButton maPBEdit;
142 : : PushButton maPBTest;
143 : : PushButton maPBDelete;
144 : : PushButton maPBSave;
145 : : PushButton maPBOpen;
146 : : HelpButton maPBHelp;
147 : : PushButton maPBClose;
148 : :
149 : : bool mbIsClosable;
150 : :
151 : : ::rtl::OUString sTemplatePath;
152 : : ::rtl::OUString sDocTypePrefix;
153 : :
154 : : SvtModuleOptions maModuleOpt;
155 : : };
156 : :
157 : : #endif
158 : :
159 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|