xref: /trunk/main/svtools/inc/svtools/templdlg.hxx (revision b5da552ccefc4034e06a43bfae43fb8a8b64a7ad)
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 #ifndef _SVTOOLS_TEMPLDLG_HXX
24 #define _SVTOOLS_TEMPLDLG_HXX
25 
26 #include "svtools/svtdllapi.h"
27 
28 #include <vcl/button.hxx>
29 #include <vcl/dialog.hxx>
30 #include <vcl/fixed.hxx>
31 #include <svtools/fixedhyper.hxx>
32 
33 struct SvtTmplDlg_Impl;
34 
35 // class SvtDocumentTemplateDialog ---------------------------------------
36 
37 class SvtTemplateWindow;
38 
39 class SVT_DLLPUBLIC SvtDocumentTemplateDialog : public ModalDialog
40 {
41 private:
42     svt::FixedHyperlink aMoreTemplatesLink;
43     FixedLine           aLine;
44     PushButton          aManageBtn;
45     PushButton          aEditBtn;
46     OKButton            aOKBtn;
47     CancelButton        aCancelBtn;
48     HelpButton          aHelpBtn;
49 
50     SvtTmplDlg_Impl*    pImpl;
51 
52     DECL_DLLPRIVATE_LINK(           SelectHdl_Impl, SvtTemplateWindow* );
53     DECL_DLLPRIVATE_LINK(           DoubleClickHdl_Impl, SvtTemplateWindow* );
54     DECL_DLLPRIVATE_LINK(           NewFolderHdl_Impl, SvtTemplateWindow* );
55     DECL_DLLPRIVATE_LINK(           SendFocusHdl_Impl, SvtTemplateWindow* );
56     DECL_DLLPRIVATE_LINK(           OKHdl_Impl, PushButton* );
57     DECL_DLLPRIVATE_LINK(           OrganizerHdl_Impl, PushButton* );
58     DECL_DLLPRIVATE_LINK(           UpdateHdl_Impl, Timer* );
59     DECL_DLLPRIVATE_LINK(           OpenLinkHdl_Impl, svt::FixedHyperlink* );
60 
61 public:
62     SvtDocumentTemplateDialog( Window* pParent );
63 
64     /** ctor for calling the dialog for <em>selection</em> only, not for <em>opening</em> a document
65         <p>If you use this ctor, the dialog will behave differently in the following areas:
66         <ul><li>The <em>Edit</em> button will be hidden.</li>
67             <li>Upon pressing em>Open</em>, the selected file will not be opened. Instead, it's
68                 URL is available (see <method>GetSelectedFileURL</method>).</li>
69         </ul>
70 
71     */
72     struct SelectOnly { };
73     SvtDocumentTemplateDialog( Window* _pParent, SelectOnly );
74 
75     ~SvtDocumentTemplateDialog();
76 
77     sal_Bool    IsFileSelected( ) const;
78     String      GetSelectedFileURL( ) const;
79 
80     void        SelectTemplateFolder();
81 
82 private:
83     SVT_DLLPRIVATE void InitImpl( );
84     SVT_DLLPRIVATE sal_Bool CanEnableEditBtn() const;
85 };
86 
87 #endif // _SVTOOLS_TEMPLDLG_HXX
88 
89