Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / padmin / source / helper.hxx
blobd252c17309f3a0c3932af35b98bcbb1a3278766b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _PAD_HELPER_HXX_
21 #define _PAD_HELPER_HXX_
23 #include <list>
24 #include <tools/string.hxx>
25 #include <tools/resid.hxx>
26 #include <vcl/dialog.hxx>
27 #include <vcl/button.hxx>
28 #include <vcl/edit.hxx>
29 #include <vcl/fixed.hxx>
30 #include <vcl/lstbox.hxx>
31 #include <vcl/combobox.hxx>
33 #if defined SPA_DLLIMPLEMENTATION
34 #define SPA_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
35 #else
36 #define SPA_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
37 #endif
40 class Config;
42 namespace padmin
44 class DelMultiListBox : public MultiListBox
46 Link m_aDelPressedLink;
47 public:
48 DelMultiListBox( Window* pParent, const ResId& rResId ) :
49 MultiListBox( pParent, rResId ) {}
50 ~DelMultiListBox() {}
52 virtual long Notify( NotifyEvent& rEvent );
54 Link setDelPressedLink( const Link& rLink )
56 Link aOldLink( m_aDelPressedLink );
57 m_aDelPressedLink = rLink;
58 return aOldLink;
60 const Link& getDelPressedLink() const { return m_aDelPressedLink; }
63 class DelListBox : public ListBox
65 Link m_aDelPressedLink;
66 public:
67 DelListBox( Window* pParent, const ResId& rResId ) :
68 ListBox( pParent, rResId ) {}
69 ~DelListBox() {}
71 virtual long Notify( NotifyEvent& rEvent );
73 Link setDelPressedLink( const Link& rLink )
75 Link aOldLink( m_aDelPressedLink );
76 m_aDelPressedLink = rLink;
77 return aOldLink;
79 const Link& getDelPressedLink() const { return m_aDelPressedLink; }
82 class QueryString : public ModalDialog
84 private:
85 OKButton m_aOKButton;
86 CancelButton m_aCancelButton;
87 FixedText m_aFixedText;
88 Edit m_aEdit;
89 ComboBox m_aComboBox;
91 String& m_rReturnValue;
92 bool m_bUseEdit;
94 DECL_LINK( ClickBtnHdl, Button* );
96 public:
97 QueryString( Window*, String &, String &, const ::std::list< String >& rChoices = ::std::list<String>() );
98 // parent window, Query text, initial value
99 ~QueryString();
102 sal_Bool AreYouSure( Window*, int nRid = -1 );
104 ResId PaResId( sal_uInt32 nId );
106 void FindFiles( const String& rDirectory, ::std::list< String >& rResult, const String& rSuffixes, bool bRecursive = false );
108 Config& getPadminRC();
109 void freePadminRC();
111 bool chooseDirectory( String& rInOutPath );
113 } // namespace padmin
115 #endif
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */