merge the formfield patch from ooo-build
[ooovba.git] / padmin / source / helper.hxx
blob4136e62a67cc1c93f9d48843b4c02729f753c0e0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: helper.hxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _PAD_HELPER_HXX_
32 #define _PAD_HELPER_HXX_
34 #ifndef __SGI_STL_LIST
35 #include <list>
36 #endif
37 #include <tools/string.hxx>
38 #ifndef _RESID_HXX
39 #include <tools/resid.hxx>
40 #endif
41 #include <vcl/dialog.hxx>
42 #ifndef _SV_BUTTON_HXX
43 #include <vcl/button.hxx>
44 #endif
45 #include <vcl/edit.hxx>
46 #include <vcl/fixed.hxx>
47 #ifndef _SV_LISTBOX_HXX
48 #include <vcl/lstbox.hxx>
49 #endif
50 #include <vcl/combobox.hxx>
52 class Config;
54 #define PSPRINT_PPDDIR "driver"
56 namespace padmin
58 class DelMultiListBox : public MultiListBox
60 Link m_aDelPressedLink;
61 public:
62 DelMultiListBox( Window* pParent, const ResId& rResId ) :
63 MultiListBox( pParent, rResId ) {}
64 ~DelMultiListBox() {}
66 virtual long Notify( NotifyEvent& rEvent );
68 Link setDelPressedLink( const Link& rLink )
70 Link aOldLink( m_aDelPressedLink );
71 m_aDelPressedLink = rLink;
72 return aOldLink;
74 const Link& getDelPressedLink() const { return m_aDelPressedLink; }
77 class DelListBox : public ListBox
79 Link m_aDelPressedLink;
80 public:
81 DelListBox( Window* pParent, const ResId& rResId ) :
82 ListBox( pParent, rResId ) {}
83 ~DelListBox() {}
85 virtual long Notify( NotifyEvent& rEvent );
87 Link setDelPressedLink( const Link& rLink )
89 Link aOldLink( m_aDelPressedLink );
90 m_aDelPressedLink = rLink;
91 return aOldLink;
93 const Link& getDelPressedLink() const { return m_aDelPressedLink; }
96 class QueryString : public ModalDialog
98 private:
99 OKButton m_aOKButton;
100 CancelButton m_aCancelButton;
101 FixedText m_aFixedText;
102 Edit m_aEdit;
103 ComboBox m_aComboBox;
105 String& m_rReturnValue;
106 bool m_bUseEdit;
108 DECL_LINK( ClickBtnHdl, Button* );
110 public:
111 QueryString( Window*, String &, String &, const ::std::list< String >& rChoices = ::std::list<String>() );
112 // parent window, Query text, initial value
113 ~QueryString();
116 BOOL AreYouSure( Window*, int nRid = -1 );
118 ResId PaResId( sal_uInt32 nId );
120 void FindFiles( const String& rDirectory, ::std::list< String >& rResult, const String& rSuffixes, bool bRecursive = false );
122 Config& getPadminRC();
123 void freePadminRC();
125 bool chooseDirectory( String& rInOutPath );
127 } // namespace padmin
129 #endif